From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) by sourceware.org (Postfix) with ESMTPS id E12A83858C00 for ; Thu, 23 Feb 2023 15:24:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E12A83858C00 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sourceryinstitute.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sourceryinstitute.org Received: by mail-vs1-xe31.google.com with SMTP id d7so10272411vsj.2 for ; Thu, 23 Feb 2023 07:24:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceryinstitute.org; s=google; t=1677165877; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qlBqNzUdCUeeCwQLzFxO6zGxIwLInO/z12ivkD7yVCU=; b=Zl58CmapP9Rwd9y/MGrHoGhTG93VwjdBAiOZxgZsnW+zzSu2dbZMLJVxS2K32g5qNx 5tEL6b5L6Nlf2VOi+zpdSusZ7qB38Q0TzSoHK/vYI5a70qfZzjcHa3BoRlfi9An9BZa6 3+1FspwMiIVWG/9iv4zWyMCh8gaHLNurZmsb0yV6gy5e+0IIH56hVEyu1dwBKThJWVxM Skv+to+GjhxHH+7X9WcOCkcvqPeUOl2qDArZLpDBDRD+md6rTkqknx0tmB6J0Q560ble D7jrnxTX8r+l4q9fSjqhi4WhvlHoffmUB2WlcUeTar5fDIBFNuSsDd7VxqqLiH47XopF Xdcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677165877; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qlBqNzUdCUeeCwQLzFxO6zGxIwLInO/z12ivkD7yVCU=; b=lD9WK36vWq3k/ixQjmYuuVK9XzPu7s8ygOkyC0Y0ZCP/m2vVf7vNTwPSohDJhm+JKk Aq90+ahQo26CTN9P2XqzchDNYNC7MGTwhZvus5ynF3W5f/CxYmTg/4FkCOKh4aZe7D0d SlgALN3si38oqyfJJ6ATG0R1It74ws2o9Uvn/2yfEZp73gynezt5Emo1/HT4wOaBNsGy GWJnzKYHjxD3ohFPOvG2w6YdgnP+yVsHQNXSf2hLeU01q0znuAR9yxhRSxkdx+joVcSv 7H3HF1xHV9SyV75bxO8RN4pesu9gsXSiRPk5eiUSK115WgjNpFtMntpu5fV8B6ckuSEm gG+A== X-Gm-Message-State: AO0yUKUf8gQ6usmt8QXlMDH1MLFcUo+blHPy9btH6WllXYW/Y6nYQ5p7 XagOpmBmRukuArnwq+KCrKkuNa8Ylzkq2EtJDqZpbg== X-Google-Smtp-Source: AK7set9ylbb2MX/qQUc9Q6sDIynAY7ArAQYSLKcmZ1QYipu46hi5e54ARuhMQojG1D3oMKL766cxnWFNPO6lbcX0/BM= X-Received: by 2002:a05:6102:2321:b0:414:4c51:fe1f with SMTP id b1-20020a056102232100b004144c51fe1fmr2923397vsa.85.1677165877107; Thu, 23 Feb 2023 07:24:37 -0800 (PST) MIME-Version: 1.0 References: <17ddcd30-2e60-5397-433e-e974559515d6@codesourcery.com> In-Reply-To: <17ddcd30-2e60-5397-433e-e974559515d6@codesourcery.com> From: Damian Rouson Date: Thu, 23 Feb 2023 07:24:26 -0800 Message-ID: Subject: =?UTF-8?Q?Re=3A_Willing_to_contribute_to_the_project_Idea_=22Fortr?= =?UTF-8?Q?an_=E2=80=93_DO_CONCURRENT=22?= To: Tobias Burnus Cc: fortran , gcc-patches , varma datla Content-Type: multipart/alternative; boundary="00000000000055b76705f55f9cdd" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000055b76705f55f9cdd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I wonder if a relatively easy starting point would be enabling the declaration of do concurrent construct variables: do concurrent (integer :: i =3D 1:n) It=E2=80=99s a minor convenience and less exciting than adding locality spe= cifiers but possibly a good first exercise. Damian On Thu, Feb 23, 2023 at 07:08 Tobias Burnus wrote: > Hi, > > and welcome to the GCC / gfortran community. > > On 23.02.23 14:15, varma datla via Fortran wrote: > > I am willing to contribute to the project idea "Fortran =E2=80=93 DO CO= NCURRENT". > > I hope the following helps a bit =E2=80=93 it is admittedly a bit chaotic= , but I > try to write something cleaner later. > > But to have something to think of and to startwith, it should be > sufficient: > > I think there are two parts to it: First, to add the changes of newer > Fortran to gfortran and then to actually use them to generate > concurrently running code. (Internally, gfortran currently handles 'do > concurrent' to run mostly like a normal loop =E2=80=93 except that it ann= otates > the loops are independent. =E2=80=93 Real parallelization would be useful, > however.) > > If you want to see examples, see do_concurrent_1.f90 to > do_concurrent_6.f90 in gfortran's testsuite, i.e. > gcc/testsuite/gfortran.dg/ in the GCC sources. That's at > > https://gcc.gnu.org/git/?p=3Dgcc.git;a=3Dtree;f=3Dgcc/testsuite/gfortran.= dg;hb=3Drefs/heads/master > / But it is best to download GCC yourself via Git as described at > https://gcc.gnu.org/git.html > > I want to note that the DO CONCURRENT syntax also permits a mask > argument, like in 'do concurrent (i=3D1:5, j=3D1:5, (i/=3Dj))' where the = last > argument selects a subset. > > For the Fortran standard, see https://gcc.gnu.org/wiki/GFortranStandards > > Fortran 2018 (=3D 18-007r1) adds for locality specifiers: LOCAL, > LOCAL_INIT, SHARED and DEFAULT(NONE). > > Fortran 202x alias 2023 adds 'reduce' as in 'do concurrent (i =3D 1, n) > reduce(+:a, b, c) reduce(max:d, e, f)' > > I think the first step is to add parsing support for those new features, > i.e. store them, check for issues (diagnostic) and then fail with a > 'sorry not yet implemented'. > > The next step would be to implement LOCAL/LOCAL_INIT for running on the > host. > > And then, finally, would be to translate into code which can then be run > concurrently. I was thinking of mapping it internally to OpenMP or > OpenACC, to be toggled via a commandline option like > -fdo-concurrent=3D. > > * * * > > I think the first step would be to download GCC and build it. Something > like "git clone" as described above, then "mkdir build" (some > directory); "cd build" and then "../configure --prefix=3Dwhere-to-install" > followed by "make -j12" and "make install". The "-j12" runs 12 build > jobs in parallel. How much to use depends on your system. > > You probably need to install some development versions of libraries such > as ISL, gmp, mpfr and mpc. If you don't have them readily, an option is > to run ./contrib/download_prerequisites to download those and build them > automatically alongside GCC. > > So far for now. If you have questions, please ask. =E2=80=94 And I will t= ry to > write something more structured later. > > Tobias > > -- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 2= 01, > 80634 M=C3=BCnch > en; > Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3=A4ftsf=C3=BChrer: Th= omas Heurung, > Frank Th=C3=BCrauf; Sitz der Gesellschaft: M=C3=BCnchen; Registergericht = M=C3=BCnchen, HRB > 106955 > > ----------------- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 2= 01, > 80634 M=C3=BCnch > en; > Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3=A4ftsf=C3=BChrer: Th= omas Heurung, > Frank Th=C3=BCrauf; Sitz der Gesellschaft: M=C3=BCnchen; Registergericht = M=C3=BCnchen, HRB > 106955 > --00000000000055b76705f55f9cdd--