public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* co-arrays and libgfortran
@ 2020-12-18  4:28 Steve Kargl
  2020-12-18 12:26 ` Thomas Koenig
  0 siblings, 1 reply; 22+ messages in thread
From: Steve Kargl @ 2020-12-18  4:28 UTC (permalink / raw)
  To: fortran; +Cc: kargl

Dear All, 

At the risk of causing consternation among the few
active gfortran developers, I'll offer the observation
that libgfortran likely need to be built with -fcoarray=lib
if one wants to use OpenCoarrays.  I'm not sure what
the status of shared memory coarrays is.  Why, you ask?

J3 defined RANDOM_INIT() in a manner that requires it to be
aware of the backing coarray communication method.  That is,
RANDOM_INIT(repeatable=.false., image_distinct=.false.)
requires communication between image 1 and all other images
(if num_image > 1).  'repeatable=.false.' means that each
time a program is run, a different set of processor-dependent
seeds are used on image 1.  This is trivial to do with
Janne's reworking of random_seed() when he introduce gfortran 
to xshiro++.  Now, if num_images() > 1, then all other images
are required to use the same set of seeds as image 1 to initial
their PRNG.  Therefore, the other images must ask image 1 for
its seeds.  I don't use co-arrays, so I'm unsure of the
 semantics; but, I have used MPI.  With MPI, one would have
image 1 broadcast the seeds and all other images would receive
the seeds.   

Note, I've attached a patch that fixes random_init() for other
combinations of repeatable and image_distinct (if anyone case)
in https://gcc.gnu.org/pipermail/gcc-bugs/2020-December/723251.html

-- 
Steve

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2020-12-22 23:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18  4:28 co-arrays and libgfortran Steve Kargl
2020-12-18 12:26 ` Thomas Koenig
2020-12-18 15:52   ` Steve Kargl
2020-12-19 21:59     ` Steve Kargl
2020-12-20 10:52       ` Thomas Koenig
2020-12-20 17:47         ` Steve Kargl
2020-12-21  1:04           ` Steve Kargl
2020-12-21  2:01             ` Damian Rouson
2020-12-21 13:15     ` Thomas Koenig
2020-12-21 15:18       ` Steve Kargl
2020-12-21 23:44         ` Thomas Koenig
2020-12-22  0:18           ` Steve Kargl
2020-12-22  1:40             ` Steve Kargl
2020-12-22 10:04               ` Thomas Koenig
2020-12-22 18:32                 ` Steve Kargl
2020-12-22 19:33                   ` Steve Kargl
2020-12-22 20:12                     ` Steve Kargl
2020-12-22 20:20                       ` Steve Kargl
2020-12-22 22:08                         ` Steve Kargl
2020-12-22 22:22                           ` Steve Kargl
2020-12-22 23:24               ` Steve Kargl
2020-12-22 23:46                 ` Thomas Koenig

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).