When clang generates the code of serialized parallel region whose omp parallel
directive contains if(0) clause, then the implicit task of the corresponding
region is invoked directly by the application, so the invoker takes the value
of “ompt_parallel_invoker_program” flag.
For all other cases, implicit tasks of the parallel regions are invoked by
the runtime, so “ompt_parallel_invoker_runtime” flag is used instead.
Four test cases have been introduced to prove that the “invoker” argument
is determined correctly while dispatching “ompt_callback_parallel_begin”
and “ompt_callback_parallel_end” callbacks. Each test case supplies the
master thread’s call stack which points to the call site of the corresponding
implicit task and argues about the right value of the “invoker” argument.