[Openmp-dev] PPC64 patch from Intel's fourth cmake patch

Cownie, James H james.h.cownie at intel.com
Wed Aug 6 08:36:24 PDT 2014


Thanks, I’ll leave this until tomorrow morning (UK time) to give a window for any final reviews, then commit it assuming no objections.

-- Jim

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

From: Carlo Bertolli [mailto:cbertol at us.ibm.com]
Sent: Wednesday, August 06, 2014 4:28 PM
To: Cownie, James H
Cc: C. Bergström; Michael Wong; openmp-dev at dcs-maillist2.engr.illinois.edu; Hal Finkel
Subject: RE: [Openmp-dev] PPC64 patch from Intel's fourth cmake patch


Hi James,


Attached a second version of my patch addressing C. Bergström concerns (again, thanks for this).

(See attached file: ppc64-second-patch-from-fourth-intel-cmake)

There were issues that remained unsolved - here are my answers:

1. I removed the use of uname from everywhere. The user has to specify the value of the variable "arch" on the command line (e.g. ppc64), otherwise 32e is assumed.

2. The old cmake has a very complex way of setting the OpenMP version (3 variables are used). I removed all my attempts to make them homogeneous, and left it as it was before I worked on it.

3. I left the implementation of kmp_invoke_microtask as Hal Finkel did it because there is no time to implement a better version - incidentally, this will work for the foreseeable future.


Please, let me know of any comments and I'll quickly fix the thing and send a revised patch.
In the meantime, thanks for holding this while I was fixing my patch.

Cheers

-- Carlo

[Inactive hide details for "Cownie, James H" ---08/06/2014 05:23:22 AM---Carlo, If you send a new patch soon, I'll commit it *be]"Cownie, James H" ---08/06/2014 05:23:22 AM---Carlo, If you send a new patch soon, I'll commit it *before* I push to the 3.5 branch.

From: "Cownie, James H" <james.h.cownie at intel.com<mailto:james.h.cownie at intel.com>>
To: Carlo Bertolli/Watson/IBM at IBMUS, C. Bergström <cbergstrom at pathscale.com<mailto:cbergstrom at pathscale.com>>
Cc: "openmp-dev at dcs-maillist2.engr.illinois.edu<mailto:openmp-dev at dcs-maillist2.engr.illinois.edu>" <openmp-dev at dcs-maillist2.engr.illinois.edu<mailto:openmp-dev at dcs-maillist2.engr.illinois.edu>>, Michael Wong <michaelw at ca.ibm.com<mailto:michaelw at ca.ibm.com>>
Date: 08/06/2014 05:23 AM
Subject: RE: [Openmp-dev] PPC64 patch from Intel's fourth cmake patch

________________________________



Carlo,

If you send a new patch soon, I’ll commit it *before* I push to the 3.5 branch.

-- Jim

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

From: openmp-dev-bounces at cs.uiuc.edu<mailto:openmp-dev-bounces at cs.uiuc.edu> [mailto:openmp-dev-bounces at cs.uiuc.edu] On Behalf Of Carlo Bertolli
Sent: Tuesday, August 05, 2014 11:52 PM
To: C. Bergström
Cc: openmp-dev at dcs-maillist2.engr.illinois.edu<mailto:openmp-dev at dcs-maillist2.engr.illinois.edu>; Michael Wong
Subject: Re: [Openmp-dev] PPC64 patch from Intel's fourth cmake patch


Hi C. Bergstrom,

Thanks *very much* for the review. Below, my detailed comments on this, interspersed with your comments:




"C. Bergström" <cbergstrom at pathscale.com<mailto:cbergstrom at pathscale.com>> wrote on 08/05/2014 05:11:10 PM:

> From: "C. Bergström" <cbergstrom at pathscale.com<mailto:cbergstrom at pathscale.com>>
> To: Carlo Bertolli/Watson/IBM at IBMUS
> Cc: openmp-dev at dcs-maillist2.engr.illinois.edu<mailto:openmp-dev at dcs-maillist2.engr.illinois.edu>, Michael Wong
> <michaelw at ca.ibm.com<mailto:michaelw at ca.ibm.com>>
> Date: 08/05/2014 05:13 PM
> Subject: Re: [Openmp-dev] PPC64 patch from Intel's fourth cmake patch
>
> On 08/ 6/14 01:26 AM, Carlo Bertolli wrote:
> >
> > Hi all,
> >
> > I managed to create a git patch on top of latest Intel's cmake patch
> > from Jonathan Peyton.
> >
> > /(See attached file: ppc64-patch-from-fourth-intel-cmake)/
> >
> > This patch adds the ppc64 architecture and enables the current
> > Makefile system, the old cmake system, and the new cmake system on
> > that architecture.
> > It completely replaces the previous patch I sent on the openmp-commits
> > list.
> >
> >
> > Please let me know of any comments.
> >
> Hi Carlo!
>
> Thanks a lot for sending this
>
> Here's my off the cuff review
> ---------
> using uname to detect the host/target was rejected before. Please use
> the "cmake" way of detecting things.
> +EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE
> DETECT_ARCH )
> +EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCH )
>

OK. I did some investigation on this and have done it again just now but was not able to find a way of doing this natively in cmake.
Actually, I found comments about how cmake does not support this natively (may be an old cmake version).
Can you suggest how to do this? (a link to a web page with an example is fine too).


>
> Please don't use !not when it can be avoided - It can be slightly
> confusing at a glance
> # Is this a work-around to something? Why not just test for ppc64 and
> handle that condition?
> if(NOT "${DETECT_ARCH}" STREQUAL "ppc64")

I agree this is just a stupid way of coding things - I will fix it.

>
> why change the minimum cmake version?
> +cmake_minimum_required(VERSION 3.0)

I got an annoying warning from cmake when running on one of the machines here - I added it to get rid to the warning, but I will delete this.

>
> --------
> We should find a correct solution instead of "ugly work-around" - I hope
> Intel can chime in here
> +#ugly workaround because these variables are not really set
> // For PathScale on BGQ - we are only able to support OMP2.5 for now.
> Advertising support all the way to 4.x would possibly lead to weird
> things. This should be done with care

This is a quick fixup that I made to the old cmake to have it work again on the machine I was using. I can get rid of those and ask who runs cmake to set them up. Would that be fine by you?


> --------
> I don't know if this is limited to linux only, but it isn't a correct
> assumption for Solaris and possibly FreeBSD
> -  set(CMAKE_SHARED_LINKER_FLAGS
> "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports_so.txt")
> +  set(CMAKE_SHARED_LINKER_FLAGS
> "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports_so.txt -ldl")
>

I think this only triggered an error on ppc64 linux. x86_64 linux did not raise any issue. What is your suggestion? Should I guard it as "if linux && ppc64"?

> --------
> I think this sneaked in
> -#define KMP_VERSION_BUILD    00000000
> +//#define KMP_VERSION_BUILD    00000000
>

Yep, it did!

> --------
> I don't have the time to review makefile.mk/perl module - someone else
> should do that..
> # Personally, I think it should be removed

runtime/src/makefile.mk is used by the current Makefile (not sure about cmakes). In general, I am happier if Makefile stays in its place.


> ----------
>
> // This looks really weird and I'd need more details before accepting it
> // I also think we may want to limit this damage to very specifically
> "clang" instead of just PPC64
> // Please provide more details
> +__kmp_invoke_microtask
>

About this: I am not aware of any compiler that will target PPC64 using IOMP, except CLANG (I am happy to be told I am wrong). CLANG does currently gather all arguments to the microtask into a struct of pointers. That is the reason for my comment. There is ongoing discussion at Intel, I think, about why this is/is not bad.

From PPC64 perspective, we are happy the way it is. This implementation is coming from Hal Finkel (I am cc-ing him) that actually implemented that function. I had some discussion with my colleagues here and, if eventually this implementation gets in the way of getting better performance, we shall be able to provide an assembly version of this.
For this patch, we feel comfortable as it is.


>
> How do you plan to test this?
> Does it pass the testsuite which has been made available?
> I believe ANL did some work on this (Jeff Hammond) - is any of his work
> used in this?

Yes, it passes the testsuite with similar results as with gcc on x86_64. If you need them, I can provide detailed information.
Once we have clarified the remaining details, I will provide a new patch.


Thanks again for your detailed review and apologies about my inexperience in llvm-related projects.



Cheers

-- Carlo

---------------------------------------------------------------------
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.
---------------------------------------------------------------------
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/20140806/acee42c3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 105 bytes
Desc: image001.gif
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20140806/acee42c3/attachment.gif>


More information about the Openmp-dev mailing list