[J3] [EXTERNAL] Questions about DO CONCURRENT and locality

Bill Long longb at cray.com
Tue Jul 7 17:28:29 EDT 2020

I see DEFAULT(NONE) for DO CONCURRENT in the same was I see IMPLICIT NONE.  It is a good documentation idea, as well as a handy way to catch typos in variable names.  Additionally, for DO CONCURRENT, having to specify SHARED, LOCAL, or LOCAL_INIT for each variable can help the compiler generate optimal code for the loop. 


> On Jul 7, 2020, at 4:16 PM, Damian Rouson via J3 <j3 at mailman.j3-fortran.org> wrote:
> Steve suggested adding a note to the standard earlier in the discussion.  Given the amount of discussion this has generated, it would be great if a note could be added.  I'm trying to distill from this discussion what useful advice to incorporate into upcoming Fortran 2018 courses.  Is it correct to take away from this discussion that DEFAULT(NONE) is a good practice to ensure that the programmer thinks through locality and explicitly specifies it?
> Damian
> On Tue, Jul 7, 2020 at 9:29 AM Steve Lionel via J3 <j3 at mailman.j3-fortran.org> wrote:
> On 7/6/2020 10:47 PM, Malcolm Cohen via J3 wrote:
> > Someone who prefers the OpenMP “pedal-to-the-metal and no brakes” 
> > approach can just add DEFAULT(SHARED) to the DO CONCURRENT statement; 
> > yes, that does require writing something marginally different, but it 
> > is hardly a huge imposition.
> Nit - there is no DEFAULT(SHARED), and I think it's good that there 
> isn't as I'd rather that all localities be explicitly specified.
> Steve

Bill Long                                                                       longb at cray.com
Principal Engineer, Fortran Technical Support &   voice:  651-605-9024
Bioinformatics Software Development                      fax:  651-605-9143
Cray, a Hewlett Packard Enterprise company/ 2131 Lindau Lane/  Suite 1000/  Bloomington, MN  55425

More information about the J3 mailing list