[Openmp-dev] KMP query question
Alexandre Eichenberger
alexe at us.ibm.com
Mon May 19 06:53:46 PDT 2014
There are three kmpc querries (kmpc_bound_thread_num,
kmpc_bound_num_threads, and kmpc_in_parallel) that refer to the innermost
active parallel construct.
I just want to make sure that "active" is really ment as defined in the OMP
specs.
For example, the traditional omp_get_num_threads gets the number of threads
in the current region. But the kmpt_bound_num_threads request this info in
the innermost active parallel construct.
They differ in this context:
#pragma omp parallel num_thread(4) if(1)
{
// code A
#pramga omp parallel num_thread(1)
{
// code B
}
}
In Code A... both calls return the same number 4 as the parallel region is
active (i.e. more than one thread).
In Code B, however, the innermost parallel region is not active. So the omp
calls return 1, and the kmpc calls return 4 (as the outer parallel region
is the innermost active region).
Is this understanding correct? If so, what is the default answer when there
are no active parallel region?
Thanks
Alexandre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20140519/8391bb31/attachment.html>
More information about the Openmp-dev
mailing list