Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
1696 Discussions

Can a master region appear in OpenMP work-sharing region?

ClayB
New Contributor I
310 Views
A question came up today about whether or not an OpenMP work-sharing region could contain a master region. There was no apparent language in the OpenMP Fortran spec that disallowed this (even in the latest 2.5 version). However, the compiler was not allowing this particular nesting of directives.
Anyone have any thoughts or advice on using a master region (code will only be executed by the master thread) inside a work-sharing construct (like parallel do)? Can you think of any algorithm that might need this functionality? Should this be allowed? If not, how would you try to "fix" the code that was written this way?
--clay
0 Kudos
0 Replies
Reply