My intention for the following omp construct is that more than one thread will be used only if (n>64)
#pragma omp parallel for schedule(guided) if(n>64)
// do stuff with array
On a 6 core machine, I found that my code was "hanging" reproducibly.
When I debugged the code (debug mode, no optimization on.) I found that
Could you please share a bit more details on the problem, so that we would be able to reproduce it and understand the reason.
E.g. what is array size in your hanging example, which OS you are using? If possible, please provide the complete test case.
I tried to create an example from your pattern, and it works fine for me (I used n=128, compiler version 18.104.22.168 on Windows).