[J3] Questions about DO CONCURRENT and locality
Daniel C Chen
cdchen at ca.ibm.com
Fri Jul 3 21:54:54 EDT 2020
I think the question of "CAN all DO CONCURRENT loops be parallelized"
should be a
question for the vendors, not the standard committee as it is an
implementation detail.
The standard does (should) not specify how a feature is implemented.
The processor can choose to implement it in parallel whenever it is
possible or
sequentially as long as the result is the same (as Bob said).
DEFAULT(NONE) will force users to specify
the locality of all variables that appear in a DO CONCURRENT construct. The
processor should be able to parallelize the loops accordingly. That being
said,
it would be users responsibility to specify the correct locality. For
example,
not marking a variable that is defined in two different iterations SHARED.
Daniel
XL Fortran Development, Fortran Standard Representative
IBM Toronto Software Lab
Phone: 905-413-3056
Tie: 969-3056
Email: cdchen at ca.ibm.com
http://www.ibm.com/software/awdtools/fortran/xlfortran
From: "Ondřej Čertík via J3" <j3 at mailman.j3-fortran.org>
To: "J3 Mailinglist" <j3 at mailman.j3-fortran.org>
Cc: "Ondřej Čertík" <ondrej at certik.us>
Date: 2020-07-03 09:03 PM
Subject: [EXTERNAL] Re: [J3] Questions about DO CONCURRENT and locality
Sent by: "J3" <j3-bounces at mailman.j3-fortran.org>
Robert,
On Fri, Jul 3, 2020, at 6:23 PM, Robert Corbett via J3 wrote:
> I am not sure of the question here.
> If the question is "can all DO
> CONCURRENT loops be
> parallelized?", the answer is
> clearly "no". The Fortran 2008
> and 2018 standards specify that
> the iterations of a DO
> CONCURRENT loop can be
> executed in any order. They do
> not specify that the
> executions of the iterations of
> a DO CONCURRENT loop can
> be intermingled. Each iteration
> is executed to completion
> before the next iteration begins.
Thanks a lot for this excellent clarification.
Not being a native speaker, my understanding of the word concurrent is
either "occurring at the same time" or "parallel", as I just looked up
here:
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.merriam-2Dwebster.com_dictionary_concurrent&d=DwIBAg&c=jf_iaSHvJObTbx-siA1ZOg&r=57cafTO2T1scnwZfrlLPsghkmjFH2AuUtlcWE5nRktg&m=HJTr1IugmX1Y8faCpH98_bXBVvyC4yKPYBS_T9K-l9Y&s=OXgWOAXzgDN2dywg-xmuWfrXf2fLhTti4zEk3xBl_Gw&e=
But according to the current interpretation of the standard, "do
concurrent" doesn't specify concurrent execution. Is my understanding
correct?
I would be in favor to change the standard to ensure "do concurrent"
specifies concurrent execution. As expected by a lot of people as well as
the meaning of the word.
Ondrej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20200703/ab646351/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20200703/ab646351/attachment-0001.gif>
More information about the J3
mailing list