public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Damian Rouson <damian@sourceryinstitute.org>
To: Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc: gfortran <fortran@gcc.gnu.org>,
	Andre Vehreschild <vehre@badgersystems.de>
Subject: Re: RANDOM_INIT() and coarray Fortran
Date: Sat, 3 Apr 2021 20:30:31 -0700	[thread overview]
Message-ID: <CACR8rvcRRnz4fzbzp+b-J6Y040Udy6v99NH4_1TXfnAmBDmSaA@mail.gmail.com> (raw)
In-Reply-To: <20210403172846.GA14134@troutmask.apl.washington.edu>

Hi Steve,

I hope the gfortran developers won't commit a patch that replaces
existing behavior with a stub that simply emits an error message.  It
has been a while since I looked at the previous emails regarding
problems with the current behavior so I'm not expressing an opinion
about the current behavior.  I'm simply advocating against breaking
existing codes that rely on the current behavior if nothing better is
being provided.

Or as a compromise, would you mind changing the patch so that the
error message is emitted only in the problematic cases? You presented
one problematic case out of the four possible combinations of
RANDOM_INIT() arguments.  With only four possible combinations to
enumerate, I hope this suggestion isn't burdensome.

Regarding "someone who cares about coarray Fortran," finding people to
work on such an effort is quite challenging.  I believe Andre
Verheschild has some limited availability so I'm cc'ing him and will
discuss it with him if he's interested.  If you know others who might
be interested, please let us know.

Damian

On Sat, Apr 3, 2021 at 10:28 AM Steve Kargl via Fortran
<fortran@gcc.gnu.org> wrote:
>
> What to do about RANDOM_INIT() and coarray Fortran?
>
> The main issue is that if one compiles with -fcoarray=lib
> (or the WIP -fcoarray=shared), then RANDOM_INIT() may
> require communication between images.  Thus, RANDOM_INIT()
> cannot live in libgfortran for at least -fcoarray=lib.
>
> Consider the simple code:
>
> subroutine foo
>    call random_init(.true., .false.)
> end subroutine foo
>
> I have updated the patch for
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98301
> to use a stub routine for -fcoarray=lib and -fcoarray=shared.
> Anyone, who knows how to use git, is encouraged to commit the patch.
>
> For -fcoarray=none (default option) and -fcoarray=single, the
> patch will cause gfortran to generate
>
> __attribute__((fn spec (". ")))
> void foo ()
> {
>   _gfortran_random_init (1, 0, 0);
> }
>
> _gfortran_random_init() live in libgfortran and it has been updated
> to meet the intended requires of the Fortran standard.
>
> With -fcoarray=lib and -fcoarray=shared, gfortran will now generate
>
> __attribute__((fn spec (". ")))
> void foo ()
> {
>   _gfortran_random_init_foobar (1, 0);
> }
>
> where _gfortran_random_init_foobar() lives in libgfortran.  It prints
> an error message that RANDOM_INIT() is not yet supported for coarray
> Fortran and exits.  Someone, who cares about coarray Fortran, can fix
> -fcoarray=lib and -fcoarray=shared by updating trans-decl.c (see the
> FIXME for random_init()) to emit
>
> __attribute__((fn spec (". ")))
> void foo ()
> {
>   _gfortran_caf_random_init (1, 0);
> }
>
> or
>
> __attribute__((fn spec (". ")))
> void foo ()
> {
>   _gfortran_cas_random_init (1, 0);
> }
>
> --
> Steve

  reply	other threads:[~2021-04-04  3:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-03 17:28 Steve Kargl
2021-04-04  3:30 ` Damian Rouson [this message]
2021-04-04  5:33   ` Steve Kargl
2021-04-23 16:43     ` [Patch, Fortran] PR98301 " Andre Vehreschild
2021-04-23 17:18       ` Steve Kargl
2021-04-24 10:49         ` [Patch, Fortran, Update] " Andre Vehreschild
2021-04-24 15:44           ` Steve Kargl
2021-04-24 15:56             ` Dr. Andre Vehreschild
2021-04-25 20:03           ` Steve Kargl
2021-04-26 10:36             ` [Patch, Fortran, Update 2] " Andre Vehreschild
2021-05-03  9:21               ` [Ping, Patch, " Andre Vehreschild
2021-05-03 15:20                 ` Steve Kargl
2021-05-21  8:09                   ` [Ping^2, Patch, Fortran] " Andre Vehreschild
2021-05-21 15:08                     ` Steve Kargl
2021-05-22  2:38                       ` Jerry D
2021-05-22 11:39                         ` Andre Vehreschild
2021-05-22 17:58                           ` Martin Liška
2021-05-23 11:59                             ` Andre Vehreschild
2021-05-23 12:17                               ` Martin Liška
2021-06-05 14:04                           ` [Patch, Fortran, backport 2 gcc-11] " Andre Vehreschild
2021-06-05 16:27                             ` Steve Kargl
2021-06-06 10:14                               ` [COMITTED, Patch, " Andre Vehreschild

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=CACR8rvcRRnz4fzbzp+b-J6Y040Udy6v99NH4_1TXfnAmBDmSaA@mail.gmail.com \
    --to=damian@sourceryinstitute.org \
    --cc=fortran@gcc.gnu.org \
    --cc=sgk@troutmask.apl.washington.edu \
    --cc=vehre@badgersystems.de \
    /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).