[Openmp-dev] KMP_GOMP_COMPAT now required?

Finkel, Hal J. hfinkel at anl.gov
Mon Mar 17 07:43:13 PDT 2014


I think that the build system is okay, I was just experimenting, trying to understand what the various preprocessor macros do.

Thanks again,
Hal

Sent from my Verizon Wireless 4G LTE DROID


"Cownie, James H" <james.h.cownie at intel.com> wrote:

KMP_GOMP_COMPAT has always been required. That is the intent.
If KMP_GOMP_COMPAT is not being set automatically by the build system then that has got broken somewhere. (Maybe one of Alp's recent changes broke this unintentionally?)

-- Jim

James Cownie <james.h.cownie at intel.com>
SSG/DPD/TCAR (Technical Computing, Analyzers and Runtimes)
Tel: +44 117 9071438


-----Original Message-----
From: openmp-dev-bounces at cs.uiuc.edu [mailto:openmp-dev-bounces at cs.uiuc.edu] On Behalf Of Hal Finkel
Sent: Monday, March 17, 2014 1:15 PM
To: openmp-dev
Subject: [Openmp-dev] KMP_GOMP_COMPAT now required?

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
_______________________________________________
Openmp-dev mailing list
Openmp-dev at dcs-maillist2.engr.illinois.edu
http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20140317/69040592/attachment.html>


More information about the Openmp-dev mailing list