[Users] CCTK_LOOP3_INT macro with Fortran and OpenMP
Roland Haas
rhaas at illinois.edu
Tue Feb 25 10:13:23 CST 2020
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
--
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from http://pgp.mit.edu .
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
Url : http://lists.einsteintoolkit.org/pipermail/users/attachments/20200225/e7c826e7/attachment.bin
More information about the Users
mailing list