last function executed before cilk runtime ends

last function executed before cilk runtime ends


I’m experimenting with cilk runtime code and I was wondering what is the last function executed before cilk runtime ends.

When I run, for example ./fib 30 in linux, what is the last function that executes in cilk runtime assuming execution went without any problems.

By last function I mean any code before cilk runtime shuts down properly after ./fib 30 has completed, maybe some sort of cleanup code or some sort of memory free-up or anything in that sort.

Thanks for the help or any hints.

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

You're probably looking for __cilkrts_c_return_from_initial() in scheduler.c.

Note that the Cilk runtime does not do it's cleanup until __cilkrts_end_cilk() is called. If you're hunting for a leak, adding a call to __cilkrts_end_cilk() is the first thing to try.  Our assumption is that you're likely to re-enter a spawning function and we can reuse the data structures, worker threads, etc.  Since most applications don't call __cilkrts_end_cilk(), the resources are released by process rundown.

     - Barry

Leave a Comment

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