On April 4, 2018 at 1:12:25 AM, Richard Biener (richard.guent...@gmail.com(mailto:richard.guent...@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