TABLE OF CONTENTS


rpn_mpi/transpose (simplified/restricted version of MPI transpose package) [ package ]

[ Top ] [ package ]

DESCRIPTION

 layout for GEM solver with FFTW (array shapes)


                         ===  with xz and xy transposes  ===

                         dimension(lnix,      lnjy,      gnk)
                         |                                  ^
                         |                                  |
                         v                                  |
                 FWD transpose X                     inverse transpose X
                         |                                  ^
                         |                                  |
                         v                                  |
                         dimension(lnix,  lnjy,  lnkx , npex)
                         |                                  ^
                         |                                  |
                         v                                  |
 forward FFT(x) <------> dimension(gni,      lnjy,      lnkx)  <------> inverse FFT(x)
 normalisation           |                                  ^
                         |                                  |
                         v                                  |
                         dimension(lniy,  lnjy,  lnkx,  npey)  [ all i indices on same PE ]
                         |                                  ^
                         |                                  |
                         v                                  |
                 FWD transpose Y                     inverse transpose Y
                         |                                  ^
                         |                                  |
                         v                                  |
                         dimension(lniy,  lnjy,  lnkx,  npey)  [ all j indices on same PE ]
                                            ^
                                            |
                                            v
                                 tridiagonal solver along j
                         

                 ===  with xz transpose and ripple solver along y ===

                         dimension(lnix,      lnjy,      gnk)
                         |                                  ^
                         |                                  |
                         v                                  |
                 FWD transpose X                     inverse transpose X
                         |                                  ^
                         |                                  |
                         v                                  |
                         dimension(lnix,  lnjy,  lnkx , npex)
                         |                                  ^
                         |                                  |
                         v                                  |
 forward FFT(x) <------> dimension(gni,      lnjy,      lnkx)  <------> inverse FFT(x)
                             [ SHARED MEMORY on NUMA node]
                                            ^
                                            |
                                            v
                     ripple distributed tridiagonal solver along j

 example of usage

   include 'RPN_MPI.inc'
 ! macro names are CASE SENSITIVE
 #define LoC(what) rpn_mpi_loc(loc(what))

   integer(kind=8), dimension(:,:,:), allocatable   :: z, z2
   integer(kind=8), dimension(:,:,:,:), allocatable :: zt, zy, zty
   integer :: row_comm, col_comm        
 ! eventually : type(RPN_MPI_Comm) :: row_comm, col_comm
 
   call RPN_MPI_transpose_setup(gnk, lnk, row_comm, col_comm, ier)

   call RPN_MPI_transpose_xz(LoC(z), LoC(zt), &
                           .true., lnimax*2, lnjmax, gnk, lnk, row_comm, ier)

   call RPN_MPI_ez_transpose_xz(LoC(z), LoC(zt), &
                           .true., lnimax*2, lnjmax, lnk, ier)

   call RPN_MPI_transpose_xy(LoC(zy), LoC(zty), &
                           .false., lnimaxy*2, lnjmax, lnk, col_comm, ier)

   call RPN_MPI_ez_transpose_xz(LoC(z2), LoC(zt), &
                           .false., lnimax*2, lnjmax, lnk, ier)

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_ez_transpose_xy ez version of xy transpose [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_ez_transpose_xy(z, zt, forward, lniy, lnjy, lnkx, ierr)

ARGUMENTS

  ! RPN_MPI_Loc is essentially the address of some array
  type(RPN_MPI_Loc), intent(IN), value :: z, zt
  logical, intent(IN) :: forward
  integer, intent(IN) :: lniy, lnjy, lnkx
  integer, intent(OUT) :: ierr

DESCRIPTION

  see RPN_MPI_transpose_xy for detailed description of arguments

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_ez_transpose_xz ez version of xz transpose [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_ez_transpose_xz(z, zt, forward, lnix, lnjy, lnkx, ierr)

ARGUMENTS

  ! RPN_MPI_Loc is essentially the address of some array
  type(RPN_MPI_Loc), intent(IN), value :: z, zt
  logical, intent(IN) :: forward
  integer, intent(IN) :: lnix, lnjy, lnkx
  integer, intent(OUT) :: ierr

DESCRIPTION

  see RPN_MPI_transpose_xz for detailed description of arguments

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_transpose_setup setup routine for EZ transposes [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_transpose_setup(gnk, lnkx, row_comm, col_comm, ierr)

ARGUMENTS

  integer, intent(IN) :: row_comm, col_comm
  integer, intent(IN) :: gnk, lnkx
  integer, intent(OUT) :: ierr

DESCRIPTION

 setup routine that needs to be called before subsequent calls to
 RPN_MPI_ez_transpose_xz and RPN_MPI_ez_transpose_xy

 gnk       : total number of levels
 lnkx      : local number of levels in transposed array zt (the SUM of lnkx MUST be equal to gnk)
 row_comm  : row communicator for transpose_xz
 col_comm  : column communicator for transpose_xy
 ierr      : error flag, same as MPI

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_transpose_xy xy transpose [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_transpose_xy(z, zt, forward, lniy, lnjy, lnkx, col_comm, ierr)

ARGUMENTS

  ! RPN_MPI_Loc is essentially the address of some array
  type(RPN_MPI_Loc), intent(IN), value :: z, zt
  logical, intent(IN) :: forward
  integer, intent(IN) :: lniy, lnjy, lnkx
  integer, intent(IN) :: col_comm
  integer, intent(OUT) :: ierr

DESCRIPTION

 transpose x along y, 
   the original and transposed arrays have the same dimensions
   the x dimension slices get distributed over the column, 
   the y dimension slices get gathered along the column

 in the original array a given PE has
   all slices along x (all i indices, gni values, npex slices)
   one slice along y (length lnjy)
   one slice along z (length lnkx)

 in the transposed array, a given PE has
   one slice along x (length lniy)
   all slices along y (all j indices, gnj values, npey slices)
   one slice along z (length lnkx)

 caveat:
   the output of RPN_MPI_transpose_xz is not a suitable input to RPN_MPI_transpose_xy
   unless npex == npey (not likely)
   a reshaping (lni_X,lnj_y,lnk_x,npe_X) -> (lni_Y,lnj_y,lnk_x,npe_Y) is needed

 forward transpose (forward == .true.)
 z         : original array, dimension(lniy,lnjy,lnkx,npey)
 zt        : transposed arrray, dimension(lniy,lnjy,lnkx,npey)
 lniy      : number of local points along x (assumed to be IDENTICAL on ALL PEs in column)
 lnjy      : number of local points along y (assumed to be IDENTICAL on ALL PEs in column)
 lnkx      : local number of levels in transposed array zt (the SUM of lnkx MUST be equal to gnk)
 col_comm  : communicator for this transpose
 ierr      : error flag, same as MPI

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_transpose_xz xz transpose [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_transpose_xz(z, zt, forward, lnix, lnjy, gnk, lnkx, row_comm, ierr)

ARGUMENTS

  ! RPN_MPI_Loc is essentially the address of some array
  type(RPN_MPI_Loc), intent(IN), value :: z, zt
  logical, intent(IN) :: forward
  integer, intent(IN) :: lnix, lnjy, gnk, lnkx
  integer, intent(IN) :: row_comm
  integer, intent(OUT) :: ierr

DESCRIPTION

 transpose z along x
   the z dimension gets distributed over the row, 
   the x dimension slices get gathered along the row

 in the original array a given PE has 
   all data( dimension(,,gnk) ) along z (all k indices, gnk values)
   one slice along y (length lnjy)
   one slice along x (length lnix)

 in the transposed array, a given PE has
   one slice along z (length lnkx)
   one slice along y (length lnjy)
   all slices along x (all i indices, gni values, npex slices)

 forward transpose (forward == .true.)
 z         : original array, dimension(lnix,lnjy,gnk)
 zt        : transposed arrray, dimension(lnix,lnjy,lnkx,npex)
 lnix      : number of local points along x (assumed to be IDENTICAL on ALL PEs in row)
 lnjy      : number of local points along y (assumed to be IDENTICAL on ALL PEs in row)
 gnk       : total number of levels
 lnkx      : local number of levels in transposed array zt (the SUM of lnkx MUST be equal to gnk)
 row_comm  : row communicator for transpose
 ierr      : error flag, same as MPI

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020