From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72202 invoked by alias); 9 Apr 2018 11:43:45 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 72182 invoked by uid 89); 9 Apr 2018 11:43:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_1,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-lf0-f53.google.com Received: from mail-lf0-f53.google.com (HELO mail-lf0-f53.google.com) (209.85.215.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Apr 2018 11:43:43 +0000 Received: by mail-lf0-f53.google.com with SMTP id e5-v6so6089505lfb.7; Mon, 09 Apr 2018 04:43:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=lsfCtdqEQCvE3SWQfGrEj/prxduMHuINnGa6Azx2+Vs=; b=O+pKaXsZ3wa+GDqgqmL+4bSvgsoNYpYAzc886CM7g9Rxgpp/tZDegtrHAZrZP5NSYz A3sB7tl/KP1UzZUrTQX2D+Z3kuuo5Camtdab6y8Km2W2vqO/I+dwXk0BDZzM2Cw+hq4Q JW0ZoC1mMaPvojO/dxToHIABPXiI9QPt4zrJRYO5WrLwXiuM2Nz8liQ72kHZVBvNKwgh uy57m0/Yqywt6uSsMO95xctsreRCru6gvRJ46OsnKkxnAdYeMMdOM7CjVhRJY8hFHoFT huU6Dj4unllGeW0JrgXYXk5hV/MjUAcvhlzBi2ficx8yfkXM68Mnxu+cANyccx13XRsL l0BA== X-Gm-Message-State: ALQs6tDk0WOkSRx+upKidr5y1gewAWR0jUORbe1Bt5nveMutnxctobj5 2GDwKREtS3LTpTYorvTBrax3J9kHtrdDeZ/NFbI= X-Google-Smtp-Source: AIpwx48zKI5m9cPJdf67EP2KUcrq5bqMQ11UyNZXYCzl5aHjS0uy3oM3oR24ANBI2m8v8ciYyh3U4MY8f9qAy3Aq0+Y= X-Received: by 2002:a19:2041:: with SMTP id g62-v6mr20566908lfg.133.1523274220936; Mon, 09 Apr 2018 04:43:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.66.218 with HTTP; Mon, 9 Apr 2018 04:43:40 -0700 (PDT) In-Reply-To: References: From: Richard Biener Date: Mon, 09 Apr 2018 11:43:00 -0000 Message-ID: Subject: Re: Patching the GCC build system to build MPICH and OpenCoarrays To: Damian Rouson Cc: Daniel Celis Garza , Jerry DeLisle , gfortran , "Filippone, Salvatore" , GCC Development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00030.txt.bz2 On Sun, Apr 8, 2018 at 8:56 PM, Damian Rouson wrote: > On April 4, 2018 at 1:12:25 AM, Richard Biener (richard.guenther@gmail.co= m(mailto:richard.guenther@gmail.com)) wrote: > >> In that case user programs compiled with -fcoarray=3Dlib 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=E2=80=A6 > > Yes. Many gfortran users and developers who will be glad to see this bot= h 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 t= he default model because it provides the broadest coverage of the required = features. OpenCoarrays also offers alternatives to MPI, but those are expe= rimental and support a more restricted subset of Fortran 2008/2018. > >> I'm still lacking an idea of what it takes to enable coarrays with gfort= ran > > We will mimic the OpenCoarrays build system, which installs =E2=80=9Ccaf"= and =E2=80=9Ccafrun" scripts analogous to MPI's "mpifort" and =E2=80=9Cmpi= run,=E2=80=9D respectively. These are used to compile and launch parallel = programs: > > $ cat hello.f90 > print *,=E2=80=9DHello from image =E2=80=9C,this_image(),=E2=80=9D of =E2= =80=9C,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 prereq= uesites >> section nor in a fortran/coarray specific section. > > If there are guidelines for modifying install.texi and invoke.texi, pleas= e send a link. It appears install.texi is written in raw TeX. I use LaTeX= regularly but haven=E2=80=99t touched TeX in decades. I=E2=80=99ll give it= a shot. I also don=E2=80=99t 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 exa= mple https://gcc.gnu.org/install/ >> In fact the only thing I find is in invoke.texi which says >> >> @item -fcoarray=3D@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 automatical= ly >> 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 c= hain (e.g., ensuring the employed MPI was built by the employed compiler). = This allows for reusing one gfortran installation with multiple parallel pr= ogramming models. > >> I'd love to "enable" coarray support for openSUSE but as said I have a h= ard >> time assessing what I'd need to do here. > > Until we figure out how to get the GCC build system to build MPICH and Op= enCoarrays, enabling coarray support requires downloading and building MPIC= H and OpenCoarrays separately. Please see the instructions for GCC develop= ers: 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=E2=80=99m hopeful that your advice will be h= elpful 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 > >