Description
Should we use do concurrent
in stdlib as parallel concurrency?
There have been a lot of discussion about the do concurrent
construct in Fortran (j3-fortran, discourse), especially with respect to the question whether a concurrency should imply parallel execution, which some compilers (intel, nvidia) already support. I don't want to open a discussion about the do concurrent
construct here, instead I want to discuss how we can make best use of do concurrent
in stdlib.
From my experience concurrent but not parallel constructs inside do concurrent
can cause issues with compilers enabling aggressive parallelization for concurrencies. I therefore suggest to only use do concurrent
for parallel concurrencies, unless the locality specification is explicitly given (Fortran 2018 feature).
It is important that we test the parallel concurrencies in our continuous integration workflows, this means we actually have to compile a parallel version of stdlib and enable the compiler support for parallelization of do concurrent
in our build files, which we are currently not doing.