EZTrace fails to build with NVHPC & potential issues with OMPT
Heya,
while taking a look at your OMPT module, I've noticed a potential issue I wanted to verify with NVHPC 24.3. When trying to build EZTrace from master
however, compilation quickly aborts with the following error message:
[ 1%] Building C object src/core/CMakeFiles/eztrace-core.dir/ezt_demangle.c.o
[ 2%] Building C object src/core/CMakeFiles/eztrace-core.dir/eztrace_array.c.o
[ 3%] Building C object src/core/CMakeFiles/eztrace-core.dir/eztrace_htable.c.o
"/home/jreuter/Projects/External/eztrace/src/core/include/eztrace-core/eztrace_spinlock.h", line 30: error: argument of type "ezt_spinlock *" (aka "volatile atomic_flag *") is incompatible with parameter of type "volatile void *" [incompatible_param]
atomic_flag_clear(l);
^
Remark: individual warnings can be suppressed with "--diag_suppress <warning-name>"
"/home/jreuter/Projects/External/eztrace/src/core/include/eztrace-core/eztrace_spinlock.h", line 36: error: argument of type "ezt_spinlock *" (aka "volatile atomic_flag *") is incompatible with parameter of type "volatile void *" [incompatible_param]
while(atomic_flag_test_and_set(l)) {
^
"/home/jreuter/Projects/External/eztrace/src/core/include/eztrace-core/eztrace_spinlock.h", line 49: error: argument of type "ezt_spinlock *" (aka "volatile atomic_flag *") is incompatible with parameter of type "volatile void *" [incompatible_param]
atomic_flag_clear(l);
^
3 errors detected in the compilation of "/home/jreuter/Projects/External/eztrace/src/core/eztrace_htable.c".
make[2]: *** [src/core/CMakeFiles/eztrace-core.dir/build.make:104: src/core/CMakeFiles/eztrace-core.dir/eztrace_htable.c.o] Error 2
make[1]: *** [CMakeFiles/Makefile2:1272: src/core/CMakeFiles/eztrace-core.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
NVHPC is quite strict when it comes to errors.
As for the issues with OMPT:
In on_ompt_callback_work
, only ompt_work_loop
is checked. Since NVHPC 23.7, the runtime has changed to report more information about the loop schedule, resulting in loops being missed entirely when only ompt_work_loop
is checked. Right now, NVHPC is the only compiler doing this, but this may change in the future. To be safe, you should check:
case ompt_work_loop:
case ompt_work_loop_static:
case ompt_work_loop_dynamic:
case ompt_work_loop_guided:
case ompt_work_loop_other: