[Openmp-dev] OS definitions

Cownie, James H james.h.cownie at intel.com
Fri Aug 8 05:57:39 PDT 2014


> Technically it's linux, but for consistency it may make sense to add the additional case. 

Well, that depends; if it is also setting KMP_OS_LINUX, then if I add + KMP_OS_CNK then the test will fail (since
1 (from KMP_OS_LINUX) + 1 (from KMP_OS_CNK) == 2, not the one that we're checking for.

> In the comment above you'll see // in some ppc64 linux installations, only the second condition is met
Yes, I saw that, but it didn't add much light to this aspect of the discussion :-)

It seems a bit odd to me to claim to be two different OSes at the same time. 
Wouldn't it be cleaner to have something like KMP_OS_DIALECT_CNK and set that and KMP_OS_LINUX?

-- Jim

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


-----Original Message-----
From: "C. Bergström" [mailto:cbergstrom at pathscale.com] 
Sent: Friday, August 08, 2014 1:48 PM
To: Cownie, James H
Cc: openmp-dev at dcs-maillist2.engr.illinois.edu; Carlo Bertolli (cbertol at us.ibm.com)
Subject: Re: [Openmp-dev] OS definitions

On 08/ 8/14 07:02 PM, Cownie, James H wrote:
>
> Carlo,
>
> I'm integrating the BGQ stuff into the code we're getting ready to 
> push, and I have a question.
>
> In kmp_os.h there's this code
>
> /* ---------------------- Operating system recognition
> ------------------- */
>
> #define KMP_OS_LINUX 0
>
> #define KMP_OS_FREEBSD 0
>
> #define KMP_OS_DARWIN 0
>
> #define KMP_OS_FREEBSD 0
>
> #define KMP_OS_WINDOWS 0
>
> #define KMP_OS_CNK 0
>
> #define KMP_OS_UNIX 0 /* disjunction of KMP_OS_LINUX, KMP_OS_DARWIN 
> etc. */
>
> #define KMP_ARCH_X86 0
>
> #define KMP_ARCH_X86_64 0
>
> #define KMP_ARCH_PPC64 0
>
> #ifdef _WIN32
>
> # undef KMP_OS_WINDOWS
>
> # define KMP_OS_WINDOWS 1
>
> #endif
>
> #if ( defined __APPLE__ && defined __MACH__ )
>
> # undef KMP_OS_DARWIN
>
> # define KMP_OS_DARWIN 1
>
> #endif
>
> // in some ppc64 linux installations, only the second condition is met
>
> #if ( defined __linux )
>
> # undef KMP_OS_LINUX
>
> # define KMP_OS_LINUX 1
>
> #elif ( defined __linux__)
>
> # undef KMP_OS_LINUX
>
> # define KMP_OS_LINUX 1
>
> #else
>
> #endif
>
> #if ( defined __FreeBSD__ )
>
> # undef KMP_OS_FREEBSD
>
> # define KMP_OS_FREEBSD 1
>
> #endif
>
> #if ( defined __bgq__ )
>
> # undef KMP_OS_CNK
>
> # define KMP_OS_CNK 1
>
> #endif
>
> #if (1 != KMP_OS_LINUX + KMP_OS_FREEBSD + KMP_OS_DARWIN + 
> KMP_OS_WINDOWS)
>
> # error Unknown OS
>
> #endif
>
> Shouldn't that last test also include KMP_OS_CNK? Or does CNK pretend 
> to be one of the other OSes as well?
>
Technically it's linux, but for consistency it may make sense to add the additional case. In the comment above you'll see // in some ppc64 linux installations, only the second condition is met


---------------------------------------------------------------------
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.





More information about the Openmp-dev mailing list