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

Carlo Bertolli cbertol at us.ibm.com
Tue Aug 5 15:51:55 PDT 2014


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> wrote on 08/05/2014 05:11:10 PM:

> From: "C. Bergström" <cbergstrom at pathscale.com>
> To: Carlo Bertolli/Watson/IBM at IBMUS
> Cc: openmp-dev at dcs-maillist2.engr.illinois.edu, Michael Wong
> <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

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


More information about the Openmp-dev mailing list