Open elliebinkley opened 3 years ago
In test3; using gdb10 using a ompd plugin I see that there is no annotation on the task for frame0, indicating that it is an explicit task. That is because the icv value for the icv-name "active_levels_var" for that associated task came back with a value of zero, indicating that the task was NOT associated with a parallel region.
(gdb) bt
at /home/lburley/src/tools-external/llvm-project-OpenMPToolsInterface/llvm-project/openmp/runtime/src/kmp_tasking.cpp:1578
at /home/lburley/src/tools-external/llvm-project-OpenMPToolsInterface/llvm-project/openmp/runtime/src/kmp_tasking.cpp:1700
at /home/lburley/src/tools-external/llvm-project-OpenMPToolsInterface/llvm-project/openmp/runtime/src/kmp_tasking.cpp:1760
at ../../src/tx_omp_parallel_simple.c:49
See the program below. Imagine 4 test cases, where a debugger halts all threads at lines 29, 39, 52 and 65. All fo the lines have the same code, e.g. int k=id; // someplace to put a breakpoint.
So there are four test cases. At each breakpoint, query the OMPD runtime library for task information. For test cases 2 and 3, at lines 29 and 39 respectively, the retrieved task information indicates the tasks are NOT associated with a parallel_region. For test case 2 and 4, at lines 39 and 65 respectively, the retrieved task information indicates the tasks are associated with a parallel_region. The differences is that cases 1 and 3 pass in a #threads=1; e.g. #pragma omp parallel num_threads(1) while 2 and 4 pass in #threads>2; e.g. #pragma omp parallel num_threads(2)
It appears that a num_threads(1) results in the ompd library not indicating that the associated tasks in the parallel region are actually NOT in the parallel regions, when to the casual programmer, they actually are in a parallel region.
/ Sample OpenMP program to test OMPD handling. /
include
include
include
include <sys/wait.h>
include
include
static volatile int volatile_int;
int main ( int argc, char *argv [] ) {
pragma omp parallel num_threads(i), private(id)
pragma omp parallel num_threads(i), private(id)
pragma omp parallel num_threads(i), private(id)
pragma omp task
pragma omp parallel num_threads(i), private(id)
pragma omp task
} / main /