I am trying to sort an array in x10 using qsort().
First I was writing sequential code, so there were no issues. Now, I am trying to parallelize my code. Now I need to run this sort function from different places.
public def qsort_cmp_idx(var a:Long,var b:Long):Int
{
if(item_order(a)<item_order(b)) return x10.lang.Int.operator_as(-1);
else if (item_order(a)>item_order(b))
return x10.lang.Int.operator_as(1);
else return x10.lang.Int.operator_as(0);
}
x10.util.RailUtils.qsort(jump,jt,jump_siz-1,(i:Long,j:Long)=>qsort_cmp_idx(i,j));
item_order is a Rail[Long] at Place 0, and jump is a Rail[Long] at some other Place x.
What is the best way to achieve this?