[Users] CCTK_LOOP3_INT macro with Fortran and OpenMP

Miguel Zilhão miguel.zilhao.nogueira at tecnico.ulisboa.pt
Tue Feb 25 09:57:53 CST 2020


hi all,

i'm trying to use the CCTK_LOOP3_INT macro in a Fortran 90 code. following the example in 
Carpet/TestLoopControl, i've done:

#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "cctk_Functions.h"

#include "loopcontrol.h"

subroutine myroutine( CCTK_ARGUMENTS )
   use loopcontrol
   implicit none
   DECLARE_CCTK_ARGUMENTS
   DECLARE_CCTK_PARAMETERS
   DECLARE_CCTK_FUNCTIONS

   CCTK_LOOP3_INT_DECLARE(int3)

   (...)

   CCTK_LOOP3_INT(int3, i, j, k)

      (...)

   CCTK_ENDLOOP3_INT(int3)
end subroutine myroutine

this seems to work fine. however, if i add the OpenMP statements to the loop in the "usual" way:

   !$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?

thanks,
Miguel


More information about the Users mailing list