- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following program causes a runtime crash reducer_impl.cpp:527: cilk assertion failed: h
My compiler is icc 13.1.1 on Ubuntu 12.04.
[cpp]
#include <cilk/reducer.h>
#include <cilk/reducer_opadd.h>
#include <cilk/cilk.h>
#include void empty() {}
std::atomic n;
int test(int *x) {
cilk::reducer_opadd r;
n = 40000;
while (n--) {
cilk_spawn empty();
}
return 0;
}
int main() {
int x = 1;
return test(&x);
}
[/cpp]
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are some missing pieces due to the formating
std::atomic should be std::atmoic<unsigned>
and
cilk::reducer_opadd should be cilk::reducer_opadd<unsigned>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reporting this bug. I was able to reproduce the problem even without using an atomic variable (see below) I'll forward it to the right folk.
- Arch
[cpp]
#include <cilk/reducer_opadd.h>
#include <cilk/cilk.h>
void empty() {}
int main() {
cilk::reducer_opadd<unsigned> r;
int n = 40000;
while (n--) {
cilk_spawn empty();
}
return 0;
}
[/cpp]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A work-around for now is to insert a cilk_sync right before the destructor for r runs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! I was not sure if there is a limit on the number of spawns and confirms this is a bug or not.

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