Question about gcc support related to file kmp_gsupport.cpp

Hi,
Could anyone familiar with the gcc support for llvm-openmp help with this:

When I build everything with gcc, and using debug mode, the debugger refuses to stop at

#pragma omp parallel
#pragma omp for schedule(static)

It seems that for schedule(static) is not mapped to GCC.

Or is there any marco that are introduced inside function

KMP_EXPAND_NAME(KMP_API_NAME_GOMP_PARALLEL)

As It is only calling this function when I was running the program.

however, if I use

#pragma omp parallel
#pragma omp for schedule(dynamic)

it is calling

void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_PARALLEL_LOOP_DYNAMIC)

Thanks,
Tianyi

Your question is really about the code which is generated by gcc for a statically scheduled loop, which has nothing to do with the runtime.

If you investigate how gcc compiles a statically scheduled OpenMP loop (look at https://godbolt.org/z/GtUnND for instance), you’ll see that there are no calls into the runtime for static loop scheduling.

– Jim

Jim Cownie james.h.cownie@intel.com
CVCG/DPD/TCAR (Technical Computing, Analyzers, and Runtimes)

Tel: +44 117 9071438

Thanks, Jim,
I was wondering why there is a function :

PARALLEL_LOOP(KMP_EXPAND_NAME(KMP_API_NAME_GOMP_PARALLEL_LOOP_STATIC),
              kmp_sch_static, OMPT_LOOP_PRE, OMPT_LOOP_POST)

which maps gcc call to clang but never used or called.

If you look in kmp_ftn_os.h you can see the GOMP names, along with the interface version in which they were defined.

That entry appears to be required for GOMP 4.0 compatibility.

– Jim

Jim Cownie james.h.cownie@intel.com
CVCG/DPD/TCAR (Technical Computing, Analyzers, and Runtimes)

Tel: +44 117 9071438

If this function is also in the interface of libgomp.so, there might be a use case for this function. You can either look into the codegen source of gcc or ask at the gcc compiler list.

-joachim