Skip to content

Conversation

@marvinfriede
Copy link
Member

Replace reductions on arrays, which can lead to stack overflow errors for large(r) arrays. Reductions on arrays usually require increasing both OMP_STACKSIZE for the worker threads, but also setting ulimit -s unlimited to allow the stack size of the main thread to grow beyond the limit set upon starting the process. This is because reductions put the arrays on the stack, not on the heap.
We avoid this by creating private copies on the heap for each thread and add up all copies after the loop in a critical section, effectively emulating the reduction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants