From the bug report, the runtime needs to initialize the nproc variables (inside middle init) for each root when the task is encountered, otherwise, a segfault can occur.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
This doesn't seem to work with GOMP interface. I think the initialization should be moved to __kmp_task_alloc (or __kmp_omp_task, is there a reason this has to happen when allocating?)?
Comment Actions
Yes, should be fine to move it to __kmp_task_alloc. An alternative would be to change middle initialization to initialize nproc not only for current task, but for all its parents, that looks a bit trickier to write at first glance...
Regarding __kmp_omp_task - this looks worse, because it may be skipped. E.g. Intel compiler can skip it for "task if(0)". So the allocation routine looks preferable.