public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Priyabrata Mondal <priyabratamondal622@gmail.com>
Cc: GCC Mailing List <gcc@gcc.gnu.org>, <fortran@gcc.gnu.org>
Subject: Re: Request for participation in GSoC
Date: Wed, 8 Mar 2023 14:28:53 +0100	[thread overview]
Message-ID: <216e7ff9-4b18-503c-c01f-702ffaba1f9c@codesourcery.com> (raw)
In-Reply-To: <ri61qlzl7kw.fsf@suse.cz>

Hello,

welcome to the GCC/gfortran community.

On 08.03.23 14:02, Martin Jambor wrote:
> On Sat, Mar 04 2023, Priyabrata Mondal via Gcc wrote:
>> I want to
>> participate in Google Summer of Code 2023 by contributing to the *Fortran –
>> DO CONCURRENT* project, an implementation of loop that executes
>> concurrently. I have started to learn about parallel programming and
>> Fortran programming language.
>>               I have good knowledge of C, C++, Javascript, HTML, and CSS.
>>              can you suggest some resources so I can learn the technologies
>> that are required for this project?
>>               I will be highly grateful to you forever if you allow me to do
>> this project under your guidance.
> I assume you have read through
>    https://gcc.gnu.org/wiki/SummerOfCode#Before_you_apply
> have you managed to complete the steps outlined there?

I wrote the following the other day regarding 'do concurrent':

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 – except that it annotates
the loops are independent. – 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=gcc.git;a=tree;f=gcc/testsuite/gfortran.dg;hb=refs/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=1:5, j=1:5, (i/=j))' where the last
argument selects a subset.

For the Fortran standard, see https://gcc.gnu.org/wiki/GFortranStandards

Fortran 2018 (= 18-007r1) adds for locality specifiers: LOCAL,
LOCAL_INIT, SHARED and DEFAULT(NONE).

Fortran 202x alias 2023 adds 'reduce' as in 'do concurrent (i = 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=<openmp,openmp-target,openacc,...>.

* * *

And for getting started with GCC, I wrote:

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=where-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.

I hope it helps to get started

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

      reply	other threads:[~2023-03-08 13:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-04 15:26 Priyabrata Mondal
2023-03-06 16:29 ` David Malcolm
2023-03-07 18:26   ` Priyabrata Mondal
2023-03-08 13:02 ` Martin Jambor
2023-03-08 13:28   ` Tobias Burnus [this message]

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=216e7ff9-4b18-503c-c01f-702ffaba1f9c@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=priyabratamondal622@gmail.com \
    /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).