DO CONCURRENT issues documented

We’re still trying to figure out what we’re going to do with DO CONCURRENT in f18 (flang). I wrote a short documentation file to describe its basic problem: a programmer writing parallel code with DO CONCURRENT may not enjoy parallel execution because the standard imposes weaker requirements on the body of DO CONCURRENT that suffice only to allow safe serial execution of iterations in arbitrary order, and a compiler can assume only that those weaker requirements have been respected and thus has no general way to know that concurrency is safe – even when the programmer knows that it is.

Please let me know where the note can be made more clear, correct or complete. I’m trying to summarize the problems in one place in the source base to which we can direct new users in the future when they need to know why DO CONCURRENT isn’t working as one might expect. If you have LLVM reviewing permissions, you can comment in place if you like. Thanks!


Thanks @pmk for writing it up. In the long run I think this needs to be addressed by the committee, to provide guidance how to approach this. If there is interest, I am happy to organize a video call so that we can discuss this more. Until then, I think your note is the best we can do.