Hello Miguel,
this seems to work fine. however, if i add the OpenMP statements to the loop in the "usual" way:
You should leave out the "DO COLLAPSE(3)" and just use "!$OMP PARALLEL PRIVATE (...)". This will declare a parallel region but no looping construct (which loopcontrol will do internally).
!$OMP PARALLEL DO COLLAPSE(3) & !$OMP PRIVATE(i,j,k, (...)) CCTK_LOOP3_INT(int3, i, j, k)
(...)CCTK_ENDLOOP3_INT(int3) !$OMP END PARALLEL DO
the code fails to compile with a bunch of errors:
Error: Unexpected !$OMP SINGLE statement at (1)
Error: Unexpected assignment statement at (1)
Error: Unexpected !$OMP END SINGLE statement at (1)
(...)
i've searched around but could not find such an example in the ET thorns. is this possible to do? can someone point me in the right direction?
Examples on how to use LoopControl are sparse and indeed none for Fortan may exist.
Note that also in C the proper use is:
--8<-- #pragma omp parallel CCTK_LOOP3_INT(int3, i, j, k) { } CCTK_ENDLOOP3_INT(int3); --8<--
ie only an "omp parallel" and no "parallel for".
Yours, Roland