- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello.
In my code, I need to pass the information,hiding from the user, about running time and etc. to the processor which spawns from spawned evaluations. For that I need in processor to know, from what processor's deque he has stolen the task. Is this possible?
Regards,
Aksenov Vitaly
In my code, I need to pass the information,hiding from the user, about running time and etc. to the processor which spawns from spawned evaluations. For that I need in processor to know, from what processor's deque he has stolen the task. Is this possible?
Regards,
Aksenov Vitaly
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In general, no. However, if you have complete control, you can manage it two ways:
- If the source code doesn't contain too many spawns, you can record the worker ID before a spawn and then again after the spawn. If they are different, then a steal occurred and the ID from before the spawn is the victim. You can then do whatever bookkeeping you want. Unfortunately, this approach doesn't work for cilk_for loops, which have hidden spawns.
- A more sophisticated but powerful technique is to modify the Cilk runtime library (which is open source). You can find the place in schedule.c where a steal is successful and you can add a little code to store the victim's worker ID (perhaps in thread-local storage).
-Pablo

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page