Just was thinking of parallel recursion, I explain what it is (its just my
thinking, it may be hypothetical), suppose I have an algorithm which is
using recursion, just suppose its just sum of array algorithm, I want to
know if there is a way in chapel which can use recursion to work in
parallel, to support it I provide a simple algorithm below to add the
numbers of array:
Algo sumOfArray(A, i, j):
if j - i + 1 == 2:
return A[i] + A[j]
else if j - i + 1 == 1:
return A[i]
else:
mid = (i + j) / 2 //this integer division
return sumOfArray(A, i, mid) + sumOfArray(A, mid + 1, j)
The above algorithm works as given, it sums the sum of left and right
subsection of array from mid of array, this type of recursion is simple, in
sense that it makes the *disjoint* sections, disjoint in sense that ranges
between different recursions don't overlap with i and j, so any recursion
which is disjoint, even if its updating the data structure can be executed
parallely, so I want to know if there is a way to run these two calls as in
the above algorithm sumOfArrays parallely, this idea will also work in
segment trees, where even the ranges made are disjoint.
I want to know if there is any way to work parallely, this comes in handy,
I want to implement and see the effect of parallelism for a segment tree.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users