From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 072F83858C5E; Thu, 23 Feb 2023 15:08:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 072F83858C5E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.97,320,1669104000"; d="scan'208";a="97821614" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 23 Feb 2023 07:08:05 -0800 IronPort-SDR: 2rLua+9TNtMALH7la+G9aDwng0DlusxlNRIFn/VVH0ZhKFY4LagfvO0lSsIzu46ggW67Lk/Oaf 4JxubVlEFeQZ+ntfB2dbTDb98AqamnZCjCEzLY0f93S6XkdOA2898fSpat6wmWvTtju8nG9jcF GxRdABpNRhIHc8ga19SY6UcvoxSUWvsXwL5spt/64suD3y8J/Sk0PDnB5X0P3H2TxFR28iBR4F 5T8ILqB68PrI8SrJ6+ttIb49QG+68dqHITCxbS5UyrvEyYLCil8+d+27UIbn7KGQ7Q+Uq+HiyF BJU= Message-ID: <17ddcd30-2e60-5397-433e-e974559515d6@codesourcery.com> Date: Thu, 23 Feb 2023 16:07:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: =?UTF-8?Q?Re=3a_Willing_to_contribute_to_the_project_Idea_=22Fortra?= =?UTF-8?Q?n_=e2=80=93_DO_CONCURRENT=22?= Content-Language: en-US To: varma datla References: CC: fortran , gcc-patches From: Tobias Burnus In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 CONC= URRENT". 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 annot= ates 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 la= st 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 try= to write something more structured later. Tobias -- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955