In addition to the performance library interface, we propose to add a new directive to give the programmer control over when the performance collection is done:
For normal OpenMP compilation this directive is ignored. Otherwise, it is translated into calls of pomp_init(), pomp_finalize(), pomp_on(), and pomp_off() calls when performance instrumentation is requested. If compatibility with existing OpenMP compilers is essential, new directives with the sentinel !$POMP could be used. Yet another approach (which does not extend the set of OpenMP directives) would be to have the programmer add the performance tool interface calls directly, but this then requires either stub routines, conditional compilation, or the removal of the instrumentation to be used when performance monitoring is not desired. Our proposed new directive approach is more portable, effective, and easier to maintain.
Table 3: POMP OpenMP Performance API.