#2386: CCTK_LOOP3_INT and friends broken for Fortran OpenMP code
Reporter:Roland Haas
Status:open
Milestone:
Version:
Type:bug
Priority:minor
Component:

Comment (by Roland Haas):

I have implemented a version (1.5) which is halfway in between (1) and (2) ie requires that users declare i,j,k and ni,nj,nk themselves but list them in the OMP_PRIVATE etc macros. This means that one can use “nice” names for the user visible loop variables even when there are multiple loops, which is not possible when all variables are declared by the DECLARE_XXX macros and still has some safety checks in place ensuring that the variables are marked as private to OpenMP. Example code would be in CactusTest/TestLoop in the rhaas/loops branch:

subroutine TestLoopFortran_intbnd(CCTK_ARGUMENTS)
  implicit none
  DECLARE_CCTK_ARGUMENTS
  DECLARE_CCTK_FUNCTIONS
  DECLARE_CCTK_PARAMETERS

  CCTK_LOOP3_INTBND_DECLARE(intbnd3)
  integer   :: i,j,k
  integer   :: n_i,n_j,n_k
  CCTK_REAL :: fsum

  call CCTK_INFO("TestLoopFortran_intbnd")
  fsum = 0
  !$OMP PARALLEL &
  !$OMP default(none) shared(cctkgh, cctk_ash, cctk_lsh, cctk_tile_min, cctk

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2386/cctk_loop3_int-and-friends-broken-for