From: Damian Rouson <damian@sourceryinstitute.org>
To: sgk@troutmask.apl.washington.edu
Cc: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Implementation of RANDOM_INIT from F2018
Date: Tue, 09 Jan 2018 23:33:00 -0000 [thread overview]
Message-ID: <etPan.5a555144.3af58dfe.411a@sourceryinstitute.org> (raw)
In-Reply-To: <20180109020322.GA16271@troutmask.apl.washington.edu>
Hi Steve,
Here are the results of compiling with the OpenCoarrays “caf” compiler wrapper, which uses -fcoarray=lib -lcaf_mpi:
1. random_init(repeatable=.true., image_distinct=.true.) gives repeatable sequences that are distinct on each image.
2. random_init(.true., .false.) gives repeatable sequences that are identical on all images.
3. random_init(.false.,.true.) gives non-repeatable sequences that are distinct on each image.
4. random_init(.false.,.false.) gives non-repeatable sequences that are distinct on each image.
The behavior with test 2 differs from the description in the email below. I hope this is helpful. I can provide the raw output if so desired.
In case it’s of interest, there’s a script in OpenCoarrays that checks out the trunk, applies a provided patch to it, and then does a non-bootstrap build of the patched trunk, MPICH, and OpenCoarrays. These were my steps:
git clone https://github.com/sourceryinstitute/opencoarrays
cd opencoarrays
./developer-scripts/patched-trunk-instal.sh random_init.diff
source prerequisites/installations/setup.sh
caf repeatable-distinct.f90
cafrun -n 4 ./a.out
If you decide to try this, please let me know. I can edit the above script to give an option for multithreaded builds to speed things up quite a bit.
Damian
On January 8, 2018 at 6:03:26 PM, Steve Kargl (sgk@troutmask.apl.washington.edu) wrote:
On Mon, Jan 08, 2018 at 05:33:01PM -0800, Damian Rouson wrote:
> I’ll be glad to test with -fcoarray=lib -lcaf_mpi with two caveats:
>
> 1. My turnaround time will probably usually be 48-72 hours for
> such tests.
Turn around time is unimportant to me. I'm simply interested if
what I have done work or if I need to fix a bug.
> 2. I don’t monitor this mailing list very closely so I might miss
> similar requests unless they are also submitted as issues on the
> OpenCoarrays GitHub repository.
That's understandable. There is only so much time in a day.
> For clarification, are you asking for simple execution of the
> existing tests or do you suspect that the tests might need
> modification (or new tests) to exercise the -fcoarray=lib option?
Hopefully, this clarifies the situation. Suppose, you have a co-array
program that causes execution of 2 images, say, image0 and image1.
If the program contains
call random_init(repeatable=.true., image_distinct=.true.)
then image0 and image1 will have distinct PRNG sequences. Now, if you
re-run the program, then image0 and image1 will have the same distinct
sequences. If you have
call random_init(.true., .false.)
image0 and image1 do not need to have distinct PRNG sequences, but
I set up gfortran to have distinct sequences. If you re-run the
program image0 and image1 should have the same sequences. Finally,
if you have
call random_init(.false.,.true.)
image0 and image1 will have distinct sequence, and if you re-run the
program image and image1 will should have different sequence than
what was seen in the previous and these are distinct.
There is one final detail, the standard says that calling random_init
in one image cannot affect the PRNG sequence in another image if
image_distinct=.false.
--
Steve
next prev parent reply other threads:[~2018-01-09 23:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 2:52 Steve Kargl
2018-01-09 0:58 ` Steve Kargl
2018-01-09 1:33 ` Damian Rouson
2018-01-09 2:03 ` Steve Kargl
2018-01-09 23:33 ` Damian Rouson [this message]
2018-01-10 1:10 ` Steve Kargl
2018-01-12 0:54 ` Steve Kargl
2018-01-12 3:11 ` Damian Rouson
2018-01-12 4:17 ` Steve Kargl
2018-01-12 5:52 ` Damian Rouson
2018-01-12 6:57 ` Steve Kargl
2018-01-16 20:30 ` Damian Rouson
2018-01-09 2:51 ` Jerry DeLisle
2018-01-09 3:21 ` Steve Kargl
2018-01-09 17:11 ` Steve Kargl
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=etPan.5a555144.3af58dfe.411a@sourceryinstitute.org \
--to=damian@sourceryinstitute.org \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=sgk@troutmask.apl.washington.edu \
/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).