[Openmp-dev] KMP_GOMP_COMPAT now required?

Hal Finkel hfinkel at anl.gov
Mon Mar 17 06:15:28 PDT 2014


Hello,

I've noticed that KMP_GOMP_COMPAT is now required? Is this the intended behavior?

Specifically, because of this in kmp_ftn_entry.h:

/*
 * For compatibility with the Gnu/MS Open MP codegen, omp_set_num_threads(),
 * omp_set_nested(), and omp_set_dynamic() [in lowercase on MS, and w/o
 * a trailing underscore on Linux* OS] take call by value integer arguments.
 * + omp_set_max_active_levels()
 * + omp_set_schedule()
 *
 * For backward compatibility with 9.1 and previous Intel compiler, these
 * entry points take call by reference integer arguments.
 */
#ifdef KMP_GOMP_COMPAT
# if (KMP_FTN_ENTRIES == KMP_FTN_PLAIN) || (KMP_FTN_ENTRIES == KMP_FTN_UPPER)
#  define PASS_ARGS_BY_VALUE 1
# endif
#endif
#if KMP_OS_WINDOWS
# if (KMP_FTN_ENTRIES == KMP_FTN_PLAIN) || (KMP_FTN_ENTRIES == KMP_FTN_APPEND)
#  define PASS_ARGS_BY_VALUE 1
# endif
#endif

As a result, if KMP_GOMP_COMPAT is not defined, and we're not on Windows, the omp_set_num_threads expects its argument by reference. This is incompatible with its signature (and the standard):

  omp_set_num_threads (int);

and obviously attempting to dereference the argument will segfault.

Would it make more sense to define a special build flag for Intel 9.1 compatibility, and otherwise do the expected thing and expect these arguments by value?

Thanks again,
Hal

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the Openmp-dev mailing list