Cilk plus implicit threshold

Cilk plus implicit threshold


I'm new to cilk, and i wanted to ask if it has an implicit threshold for the task creation, in recursive computations like fib?

If so, is it based on the number of tasks created, or in the depth of the computation?



2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The short answer is "no", there are no implicit threshholds for recursive computations like fib.   Any coarsening you might want in the base case to stop the recursion early needs to be specified manually. 

Every cilk_spawn in fib should be doing roughly the same work at every level of the recursion, to push something onto the current worker's deque and allow for stealing of the continuation of the spawn.For an arbitrary computation, coarsening based on number of tasks created or task depth may not always do the right thing, since doing so often makes some implicit assumption about balance in the recursion.    There is, however, an implicit calculation of grainsize of a cilk_for loop by default.



Leave a Comment

Please sign in to add a comment. Not a member? Join today