DO CONCURRENT question

In .f90 syntax, you can write
DO k=1,10; DO J=1,100; DO I=1,1000
D(I,J,K) = A(I,J,K) + B(J)*C(I)
END DO; END DO; END DO ! an ugly finish!!

However, the selected order of i,j,k is significant.

It is unclear how “DO CONCURRENT (I=1:1000, J=1:100, K=1:10)” would be optimally compiled.
Would the optimum i,j,k order be recognised ?
Would the appropriate use of “CONCURRENT” be recognised for parallel / multi-thread ?
Do modern compilers already adjust “DO I=1,1000; DO J=1,100; DO k=1,10” ?

I don’t use DO CONCURRENT, perhaps because I thought it related to co-arrays, but on reading “Modern Fortran Explained” I am more confused ! DO CONCURRENT “is provided to help improve performance by enabling parallel execution of the loop itterations”.

Why introduce DO CONCURRENT but remove FORALL ?
Just another attempt at concise multi-loop syntax ?
Why “help” but not recognise OpenMP ?
Is it actually associated with coarrays ?
It looks like a second attempt at the same failure ?
The concept of “help” really looks misplaced in comparison to other approaches of the Fortran standard.

I understand that ifort has a /Qparallel feature for classic DO that recognises the overhead of OpenMP initiation vs the benefit of multi-thread computation savings, but I always make these choices explicitly, especially for defining SHARE and PRIVATE.

As with FORALL, DO CONCURRENT does not appear to have sufficient support from other Fortran syntax.

What do others think ?

1 Like