The first error message in my previous email led me to the following
constraint:
“*C1130* A *variable-name *that appears in a LOCAL or LOCAL_INIT
*locality-spec *shall not have the ALLOCATABLE, INTENT (IN), or OPTIONAL
attribute, shall not be of finalizable type, shall not have an allocatable
ultimate component,...”
My first thought was, "Holy guacamole. That seems like such
a severe limitation that the feature seems almost useless." Fortuitously,
however, it turns out that the code I sent a little while ago was missing
one important feature from my intended use case: associate. As shown
below, using associate eliminates the first error, but I'm still confused
by the remaining error message. Are locality specifiers actually supported
yet?
Damian
% cat locality.f90
program main
implicit none
integer pair
integer :: mini_batch_size=1
real, allocatable, dimension(:,:) :: a, dcdb
allocate(a(1,1))
allocate(dcdb(1,1))
associate(a_ => a, dcdb_ => dcdb)
do concurrent (pair = 1:mini_batch_size) local(a_) reduce(+: dcdb_)
a_ = 0.
dcdb_ = 0.
end do
end associate
end program
% gfortran locality.f90
*locality.f90:12:71:*
12 | do concurrent (pair = 1:mini_batch_size) local(a_) reduce(+:
dcdb_)
|
*1*
*Error:* Sorry, LOCAL and LOCAL_INIT are not yet supported for ‘*do
concurrent*’ constructs at *(1)*
% gfortran --version
GNU Fortran (GCC) 15.0.1 20250119 (experimental)
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.