the behavior of omp critical with nested level of parallelism

Viewed 2097

Considering the following scenario:

Function A creates a layer of OMP parallel region, and each OMP thread make a call to a function B, which itself contain another layer of OMP parallel region.

Then if within the parallel region of function B, there is a OMP critcal region, then, does that region is critical "globally" with respect to all threads created by function A and B, or it is merely locally to function B?

And what if B is a pre-bulit function (e.g. static or dynamic linked libraries)?

1 Answers
Related