public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Damian Rouson <damian@sourceryinstitute.org>
To: Richard Biener <richard.guenther@gmail.com>
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: Sun, 08 Apr 2018 18:56:00 -0000	[thread overview]
Message-ID: <etPan.5aca65c0.4debbeeb.7e7a@sourceryinstitute.org> (raw)
In-Reply-To: <CAFiYyc1bkNudccK4yHe0QEx2aEi3aRP5ASjoaeObWFpvgUn9fA@mail.gmail.com>

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

> 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

> 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 for your feedback.  I’m hopeful that your advice will be helpful for Daniel in figuring out how to modify the GCC build system. 

Damian


  reply	other threads:[~2018-04-08 18:56 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 [this message]
2018-04-09 11:43         ` Richard Biener
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=etPan.5aca65c0.4debbeeb.7e7a@sourceryinstitute.org \
    --to=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=richard.guenther@gmail.com \
    --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).