[Users] CCTK_LOOP3_INT macro with Fortran and OpenMP

Roland Haas rhaas at illinois.edu
Tue Feb 25 14:41:38 CST 2020


Hello Miguel,

> is this the correct procedure? it seems to help, 
Should be. You likely now know about as much as I do about using
LoopControl in Fortran.

> but there is still
> something not quite right... i now have the following warning:
> 
>   Warning: While tracing module dependencies: Source file for module
> "loopcontrol" not found Searched in thorn directory only.
Those you can ignore. Cactus tries to guess what F90 files produce
modules (the *.mod files in configs/sim/scratch/) and is looking for a
file loopcontrol.F90 in your thorn's source directory (which does not
exist since the LoopControl thorn provides it). If you correctly added
"REQUIRES: LoopControl" to your configuration.ccl then Cactus will
however make sure that LoopControl is build before your thorn which
ensures that the module exists.

> as well as a lot of
> 
>   Warning: Possible change of value in conversion from INTEGER(8) to
> INTEGER(4) at (1) [-Wconversion]
> 
> should i worry about these? 
Maybe. What is the line that it complain about (it shows it) about the
"1" which is uses as a pointer.

> i don't seem to have them if i remove the
> OMP statements. in any case i'm still unable to compile, with the
> error:
> 
>   Error: copyprivate variable ‘int33_bndsize’ is not threadprivate or
> private in outer context
That is likely an issue with LoopControl and Fortran. LoopControl needs
a couple of helper variables. I C/C++ it opens a new curly brace region
and locally declares the variables in it. In Fortran it cannot do so
and thus you likely get this error. 

> "int33" i assume comes from the naming of my loop (int3), but i don't
> have any variable called "bndsize", so i guess this is one of the
> loopcontrol variables. is there anything else i could be missing?
Yes it looksi like int33_bndsize is one of the helper variables that
LoopControl uses.

Looking around a bit (find . -name \*.F90 -print0 | xargs --null grep
CCTK_LOOP) there actually si a LoopControl test for F90 in ./carpet/TestLoopControl/src/TestLoopFortran.F90 and one for the Cactus loops (no loopcontrol) in ./cactustest/TestLoop/src/TestLoopFortran.F90

What you need to add is (apparently):

CCTK_LOOP3_ALL_DECLARE(int33)

in your variable declaration section.

If you were to propose text to add to LoopControl's documentation.tex
or the UsersGuide at:

https://www.einsteintoolkit.org/usersguide/UsersGuidech9.html#x13-102000C1.7.1

then that would be gladly accepted. Right now those sections do not
mention Fortran or OpenMP at all.

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/e474417f/attachment.bin 


More information about the Users mailing list