- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using the gcc cilkplus branch, I consistently get a segmentation fault for a very simple example with a cilk_for loop:
#include
void do_work(int i)
{ }
int main(int argc, char* argv[])
{
int n = 10;
cilk_for(int i = 0; i != n; ++i)
{
do_work(i);
}
}
but if I add a dummy cilk_spawn/cilk_sync to that example, it starts to work as expected:
#include
void dummy()
{ }
void do_work(int i)
{ }
int main(int argc, char* argv[])
{
int n = 10;
cilk_spawn dummy();
cilk_sync;
cilk_for(int i = 0; i != n; ++i)
{
do_work(i);
}
}
So I am assuming that cilk_for is relyin on some runtime initialisation that's only being done by cilk_spawn/cilk_sync...
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the bug report. We have reproduced the problem and are fairly certain of the cause. We'll let you know when a fix is a available.
-Pablo
-Pablo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Cmeerw,
I think we have fixed this problem. Please checkout the latest Cilkplus GCC version and let us know if you still have problems.
Thanks,
Balaji V. Iyer.
I think we have fixed this problem. Please checkout the latest Cilkplus GCC version and let us know if you still have problems.
Thanks,
Balaji V. Iyer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Pablo and Balaji - it's working now.

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