public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Damian Rouson <damian@sourceryinstitute.org>
Cc: Daniel Celis Garza <daniel.celisgarza@hmc.ox.ac.uk>,
	Jerry DeLisle <jvdelisle@charter.net>,
		gfortran <fortran@gcc.gnu.org>,
		"Filippone, Salvatore" <salvatore.filippone@cranfield.ac.uk>,
	GCC Development <gcc@gcc.gnu.org>
Subject: Re: Patching the GCC build system to build MPICH and OpenCoarrays
Date: Mon, 09 Apr 2018 11:43:00 -0000	[thread overview]
Message-ID: <CAFiYyc2dLjkoDHbWTMYXA0bu__bO4c1PXDWa_ASntKMrZPSY7g@mail.gmail.com> (raw)
In-Reply-To: <etPan.5aca65c0.4debbeeb.7e7a@sourceryinstitute.org>

On Sun, Apr 8, 2018 at 8:56 PM, Damian Rouson
<damian@sourceryinstitute.org> wrote:
> On April 4, 2018 at 1:12:25 AM, Richard Biener (richard.guenther@gmail.com(mailto:richard.guenther@gmail.com)) wrote:
>
>> In that case user programs compiled with -fcoarray=lib are but gfortran
>> or libgfortran itself is not linked against OpenCoarrays?
>
> Yes.  OpenCoarrays produces the parallel runtime library libcaf_mpi using MPI.
>
>> So if we consider OpenCoarrays part of the gfortran runtime then
>> it makes sense to build it in-tree…
>
> Yes.  Many gfortran users and developers who will be glad to see this both because it enables the Fortran 2008/2018 parallel features and because it facilitates building related tests.
>
>> ... but building an mpi library in-tree might not?
>
> OpenCoarrays requires an underlying parallel programming model.  MPI is the default model because it provides the broadest coverage of the required features.  OpenCoarrays also offers alternatives to MPI, but those are experimental and support a more restricted subset of Fortran 2008/2018.
>
>> I'm still lacking an idea of what it takes to enable coarrays with gfortran
>
> We will mimic the OpenCoarrays build system, which installs “caf" and “cafrun" scripts analogous to MPI's "mpifort" and “mpirun,” respectively.  These are used to compile and launch parallel programs:
>
> $ cat hello.f90
> print *,”Hello from image “,this_image(),” of “,num_images()
> end
> $ caf hello.f90
> $ cafrun -n 4 ./a.out
>   Hello from image 2 of 4
>   Hello from image 1 of 4
>   Hello from image 4 of 4
>   Hello from image 3 of 4

I see.  So it's more like OpenCoarrays is in control of everything
rather than GCC...

>> since install.texi doesn't talk about this at all, neither in the prerequesites
>> section nor in a fortran/coarray specific section.
>
> If there are guidelines for modifying install.texi and invoke.texi, please send a link.  It appears install.texi is written in raw TeX.  I use LaTeX regularly but haven’t touched TeX in decades. I’ll give it a shot.  I also don’t understand how those files are used

There are no guidelines - simply follow surrounding code.  Note this
is texinfo, not tex.  We generate
man pages, html documentation and pdf docs from these sources.  See for example
https://gcc.gnu.org/install/

>> In fact the only thing I find is in invoke.texi which says
>>
>> @item -fcoarray=@var{}
>> @opindex @code{fcoarray}
>> ...
>> @item @samp{lib}
>> Library-based coarray parallelization; a suitable GNU Fortran coarray
>> library needs to be linked.
>> @end table
>>
>> which suggests linking to the coarray library doesn't happen automatically
>> but the user is supposed to link a suitable library?
>
> caf invokes gfortran and links against libcaf_mpi and the MPI libraries.  The OpenCoarrays build system customizes caf to ensure a consistent tool chain (e.g., ensuring the employed MPI was built by the employed compiler). This allows for reusing one gfortran installation with multiple parallel programming models.
>
>> I'd love to "enable" coarray support for openSUSE but as said I have a hard
>> time assessing what I'd need to do here.
>
> Until we figure out how to get the GCC build system to build MPICH and OpenCoarrays, enabling coarray support requires downloading and building MPICH and OpenCoarrays separately.  Please see the instructions for GCC developers: https://github.com/sourceryinstitute/opencoarrays/blob/master/INSTALL.

Thanks - I expected to find sth in the GCC manual or on the GCC wiki
;)  I'll have a look when I have some spare cycles.

> Thanks for your feedback.  I’m hopeful that your advice will be helpful for Daniel in figuring out how to modify the GCC build system.

As said I'm still not convinced building those libraries in-tree is
the best way forward.  I won't stand in the way of making that
work though.

Richard.

> Damian
>
>

  reply	other threads:[~2018-04-09 11:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31  0:44 Damian Rouson
2018-04-03 11:36 ` Richard Biener
2018-04-04  6:24   ` Damian Rouson
2018-04-04 11:12     ` Richard Biener
2018-04-08 18:56       ` Damian Rouson
2018-04-09 11:43         ` Richard Biener [this message]
2018-04-04 13:09     ` Toon Moene
2018-04-04 18:05       ` Damian Rouson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc2dLjkoDHbWTMYXA0bu__bO4c1PXDWa_ASntKMrZPSY7g@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=damian@sourceryinstitute.org \
    --cc=daniel.celisgarza@hmc.ox.ac.uk \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=jvdelisle@charter.net \
    --cc=salvatore.filippone@cranfield.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).