Re: [llvm-dev] Adapting and open-sourcing PGI's Fortran frontend for LLVM

137 views
Skip to first unread message

Hal Finkel

unread,
May 26, 2016, 12:17:39 PM5/26/16
to mcro...@codeaurora.org, flang-dev, douglas miles (PGI), Rob Neely, Chris Lattner, llvm...@lists.llvm.org
Hi Chad,

I can tell you that progress is being made on PGI's side; I'll let Doug/Rob provide more detailed updates.

-Hal

----- Original Message -----
> From: "Chad Rosier" <mcro...@codeaurora.org>
> To: "Hal Finkel" <hfi...@anl.gov>
> Cc: "flang-dev" <flan...@googlegroups.com>, "douglas miles (PGI)" <dougla...@pgroup.com>, "Rob Neely"
> <nee...@llnl.gov>, "Chris Lattner" <clat...@apple.com>, llvm...@lists.llvm.org
> Sent: Thursday, May 26, 2016 10:47:19 AM
> Subject: RE: [llvm-dev] Adapting and open-sourcing PGI's Fortran frontend for LLVM
>
> Hi Hal,
> I haven't been following this closely, but has there been any updates
> recently.
>
> Regards,
> Chad
>
> -----Original Message-----
> From: llvm-dev [mailto:llvm-dev...@lists.llvm.org] On Behalf Of
> Chris Lattner via llvm-dev
> Sent: Sunday, November 15, 2015 12:46 AM
> To: Hal Finkel <hfi...@anl.gov>
> Cc: LLVM Dev <llvm...@lists.llvm.org>; flang-dev
> <flan...@googlegroups.com>; douglas miles (PGI)
> <dougla...@pgroup.com>; Rob Neely <nee...@llnl.gov>
> Subject: Re: [llvm-dev] Adapting and open-sourcing PGI's Fortran
> frontend for LLVM
>
>
> > On Nov 13, 2015, at 2:22 PM, Hal Finkel via llvm-dev
> > <llvm...@lists.llvm.org> wrote:
> >
> > Hi everyone,
> >
> > I have some very good news for everyone interested a
> > production-quality Fortran frontend for LLVM:
> >
> > The U.S. Department of Energy’s National Nuclear Security
> > Administration and its three national labs have reached an
> > agreement with NVIDIA's PGI division to adapt and open-source
> > PGI's Fortran frontend, and associated Fortran runtime library,
> > for contribution to the LLVM project. PGI is now working on
> > isolating the necessary frontend components from their existing
> > compiler code base and adapting those components to produce LLVM
> > IR for consumption by our existing infrastructure.
>
> This sounds very interesting Hal (and Doug), and I’m glad to hear
> about it. I look forward to when more details and code is
> available,
>
> -Chris
> _______________________________________________
> LLVM Developers mailing list
> llvm...@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>

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

C Bergström

unread,
May 27, 2016, 5:21:36 AM5/27/16
to Neely, Rob, Mehdi Amini, Pat McCormick, llvm...@lists.llvm.org, Mike Heroux, flang-dev, douglas miles (PGI)
This process is certainly only open to a select group, so
pragmatically it's closed. I can understand that it will certainly not
be an easy process once it's public due to the amount of code and
complexity.

Maybe someone can comment on a specific issue -

When we ported our Fortran front-end to target llvm, we found that
Fortran ENTRY doesn't map very well to llvm ir.

Can anyone who is actually working on this migration comment how they
plan to handle that?
ENTRY docs
http://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vn99/

ENTRY is I think officially deprecated, but dinosaurs won't nuke
anything, ever.. (It's still used in the wild as well... ugh)

/* btw for anyone actually reading this - I think it's odd that nobody
has emailed me to ask for help reviewing. I must have thought wrongly
that everyone around here knows we (PathScale) ported Fortran to LLVM
IR since 5 years.. */
-------------
I'm not sure if I asked before, but will any corresponding tests be
open sourced as well? I know of a handful of private Fortran
testsuites, but not much in the way of public.. (gfortran is about the
only game which comes to mind)


On Fri, May 27, 2016 at 5:32 AM, Neely, Rob via llvm-dev
<llvm...@lists.llvm.org> wrote:
> No closed doors intended here. Just a recognition that for something like
> an initial review to be useful, we probably have to be a bit careful in
> how many people we can reasonably involve before it could get unwieldy,
> and trying to be respectful of people’s time if we can nail down 90% of
> issues with a smaller group before going broader. I think we’d be fine
> with opening up the WebEx presentations to whoever wanted to observe and
> possibly chime in if it could be a managed process.
>
> —Rob
>
>
> On 5/26/16, 2:06 PM, "mehdi...@apple.com on behalf of Mehdi Amini"
> <mehdi...@apple.com> wrote:
>
>>
>>> On May 26, 2016, at 1:57 PM, Neely, Rob via llvm-dev
>>><llvm...@lists.llvm.org> wrote:
>>>
>>> Chad, et al,
>>>
>>> In addition to Doug’s excellent technical update, I’ll note that we are
>>> starting to have some discussions on the DOE side with PGI about
>>> establishing a more formal review team made up of some key LLVM
>>> stakeholders to help smooth the way for a broader public rollout of the
>>> Flang code base and eventual integration. We’ll probably rely on Hal and
>>> others here to help us figure out who that group might be. My
>>>expectation
>>> is that it would involve a few WebEx/telecons on an as-needed basis
>>> (perhaps quarterly?) starting later this summer when code starts to move
>>> out of PGI’s internal systems and into a private github space. Stay
>>>tuned
>>> - we (both DOE and PGI) are keenly interested in doing what we can to
>>>make
>>> this successful.
>>
>>It seems to me that this "let's do it with selected people behind close
>>doors" does not play well with "we are seeking to have some integration
>>in the open-source projects and its broaden community".
>>My own personal impression is that not conducting it in the open blurs
>>the "message" around Flang direction and goals.
>>
>>--
>>Mehdi
>>
>>
>>>
>>> —Rob Neely, LLNL
>>>
>>>
>>> On 5/26/16, 11:57 AM, "douglas miles (PGI)" <dougla...@pgroup.com>
>>> wrote:
>>>
>>>
>>>> Hi Chad - We have a functional Fortran compiler, with the PGI front-end
>>>> bridged directly to LLVM, all of our Fortran runtime libraries
>>>> integrated, and the Clang driver adapted for use with the Fortran
>>>> compiler. We're working with a few users at DOE who are trying to
>>>> compile big applications with a binary version of the compiler. Work
>>>>is
>>>> ongoing to migrate the source code into an LLVM-style repository, build
>>>> infrastructure, documentation and web pages. All of the compiler and
>>>> runtime source is now built with Clang or the Fortran front-end with
>>>> LLVM. Much work remains on source code refactoring and documentation;
>>>> we expect that work to accelerate once all the infrastructure work is
>>>> done.
>>>>
>>>> Doug
>>>>------------------------------------------------------------------------
>>>>--
>>>> ---------
>>>> This email message is for the sole use of the intended recipient(s) and
>>>> may contain
>>>> confidential information. Any unauthorized review, use, disclosure or
>>>> distribution
>>>> is prohibited. If you are not the intended recipient, please contact
>>>>the
>>>> sender by
>>>> reply email and destroy all copies of the original message.
>>>>
>>>>------------------------------------------------------------------------
>>>>--
>>>> ---------

Jeff Hammond

unread,
May 27, 2016, 9:02:30 AM5/27/16
to flang-dev, nee...@llnl.gov, mehdi...@apple.com, p...@lanl.gov, llvm...@lists.llvm.org, mah...@sandia.gov, dougla...@pgroup.com
Yes, ENTRY has deprecated for many years and was declared obsolescent in Fortran 2008 (http://fortranwiki.org/fortran/show/Modernizing+Old+Fortran - sorry, I don't have the ISO spec handy).

In any case, ENTRY is almost never used.  The only code i have ever heard of that uses it is GAMESS.  I know this because TAU ParaTools does not support ENTRY, and thus they know HPC codes that do not support it, because they get support issues related to them.  The TAU folks have a lot of experience across DOE and DOE workloads, so I would be willing to wager that if the only code they've encountered with this issue is GAMESS, it is fine for Flang to not support it.

From what I recall, it is not hard to refactor a code to not use ENTRY, and if GAMESS is a blocker for anyone, I will try to get GAMESS patched to not use ENTRY, if it even still does.

Best,

Jeff

Hal Finkel

unread,
May 27, 2016, 1:48:59 PM5/27/16
to C Bergström, Mehdi Amini, Pat McCormick, llvm...@lists.llvm.org, Mike Heroux, flang-dev, douglas miles (PGI), Rob Neely
----- Original Message -----
> From: "C Bergström" <cberg...@pathscale.com>
> To: "Rob Neely" <nee...@llnl.gov>
> Cc: "Mehdi Amini" <mehdi...@apple.com>, "Pat McCormick" <p...@lanl.gov>, llvm...@lists.llvm.org, "Mike Heroux"
> <mah...@sandia.gov>, "flang-dev" <flan...@googlegroups.com>, "douglas miles (PGI)" <dougla...@pgroup.com>
> Sent: Friday, May 27, 2016 4:21:16 AM
> Subject: [flang-dev] Re: [llvm-dev] Adapting and open-sourcing PGI's Fortran frontend for LLVM
>
> This process is certainly only open to a select group, so
> pragmatically it's closed. I can understand that it will certainly
> not
> be an easy process once it's public due to the amount of code and
> complexity.
>
> Maybe someone can comment on a specific issue -
>
> When we ported our Fortran front-end to target llvm, we found that
> Fortran ENTRY doesn't map very well to llvm ir.
>
> Can anyone who is actually working on this migration comment how they
> plan to handle that?
> ENTRY docs
> http://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vn99/
>
> ENTRY is I think officially deprecated, but dinosaurs won't nuke
> anything, ever.. (It's still used in the wild as well... ugh)

How do you handle it? Is there any reason we can't just generate one function body per entry point? Where these might call some internal implementation function which takes a hidden argument that feeds an initial jump table.

>
> /* btw for anyone actually reading this - I think it's odd that
> nobody
> has emailed me to ask for help reviewing. I must have thought wrongly
> that everyone around here knows we (PathScale) ported Fortran to LLVM
> IR since 5 years.. */

Lot's of people are reading ;) -- Thanks for volunteering! I don't think that we've really put together the external reviewers on DOE's side of things, but please do contact the PGI folks out-of-band about early access to provide feedback.

Thanks again,
Hal
> --
> You received this message because you are subscribed to the Google
> Groups "flang-dev" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to flang-dev+...@googlegroups.com.
> To post to this group, send email to flan...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/flang-dev/CAOnawYoXpBsM%3Dn2QX3V_%3D3N8nSpss9A%3DxG%3DtQwiaT2EQeuF51g%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages