Consider the two loops

1. forall (i,j) in [1..n,1..n] do if (i+j)==n+1 then A[i,j]=1;
and
2. forall (i,j) in {(1,5),(2,4),(3,3),(4,2),(5,1)} do A[i,j]=1;//n==5

I thought that the second would perform far better than the first, because
of the lesser number of iterations. But for n=10000, the timings was 0.9
seconds (for 1) and 0.6 seconds(for 2) on a desktop.


A) Why is it so?
B) Please give a clear picture of leader-follower. Has it got any role in
this problem?
C) What is a stand alone forall loop? please give an example.
------------------------------------------------------------------------------
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to