TABLE OF CONTENTS


rpn_mpi/halo halo exchange routines [ package ]

[ Top ] [ package ]

DESCRIPTION

 these routines are used to perform a halo exchange between members of a "grid"
 an internal timing package keeps timing statistics about the various phases of the exchnage

  +=======================================================================================+___maxy
  I       <halox>                                                           <halox>       I
  I +-----+-----------------------------------------------------------------------+-----+ I
  I :     :                                    |                                  :     : I
  I :  C  :                                  haloy                                :  C  : I
  I :     :                                    |                                  :     : I
  I +-----+=====+===========================================================+=====+-----: I___nj
  I :     I     :                              |                            :     I     : I
  I :     I     :                            haloy                          :     I     : I
  I :     I     :                              |                            :     I     : I
  I :-----+-----+-----------------------------------------------------------+-----+-----: I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :     I     :                                                           :     I     : I
  I :-----+-----+-----------------------------------------------------------+-----+-----: I
  I :     I     :                              |                            :     I     : I
  I :     I     :                            haloy                          :     I     : I
  I :     I     :                              |                            :     I     : I
  I +-----+=====+===========================================================+=====+-----: I___1
  I :     :                                    |                                  :     : I
  I :  C  :                                  haloy                                :  C  : I
  I :     :                                    |                                  :     : I
  I +-----+-----------------------------------------------------------------------+-----+ I
  I <halox>                                                                       <halox> I
  +=======================================================================================+___miny
  |       |                                                                       |       |
  |       |                                                                       |       |
  |       1                                                                       ni      |
  minx                                                                                 maxx

  the "useful" section of the array is array(i,j) where 1 <= i <= ni, 1 <= j < nj
  the "inner" halo is the halo part inside the "useful" section of the array (1:ni,1:nj)
  the "outer" halo is the halo part outside the "useful" section of the array (1:ni,1:nj)
  part of the array may be outside of the "outer" halo. that part will be left as is

  a East-West (x direction) exchange is performed first, for rows 1 thru nj
  a North-South (y direction) exchange will follow, for columns 1-halox thru ni+halox

  the corner parts (C) get implicitly exchanged with the corner neighbors during tne North-South phase
  (this achieves the 2D exchange with 8 neighbors using only 4 messages)

 example of usage

   include 'RPN_MPI.inc'
 ! macro names are CASE SENSITIVE
 #define LoC(what) rpn_mpi_loc(loc(what))
 real, dimension(:,:,:), allocatable :: z
 type(RPN_MPI_Comm) :: col_comm, row_comm
 integer :: halox, haloy, NI,NJ,NK

 allocate (z(1-halox:NI+halox,1-haloy:NJ+haloy,NK))

 call RPN_MPI_ez_halo_parms(row_comm, col_comm, 'BARRIER')
 call RPN_MPI_ez_halo(LoC(z),1-halox,NI+halox,1-haloy,NJ+haloy,NI,NJ,NK,halox,haloy)
 call RPN_MPI_halo(LoC(z),1-halox,NI+halox,1-haloy,NJ+haloy,NI,NJ,NK,halox,haloy,row_comm,col_comm)

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_ez_halo grid halo exchange for 4 byte items [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_ez_halo(g,minx,maxx,miny,maxy,lni,lnj,nk,halox,haloy) bind(C,name='RPN_MPI_ez_halo')

ARGUMENTS

  integer, intent(IN)    :: minx,maxx,miny,maxy,lni,lnj,nk,halox,haloy
  type(RPN_MPI_Loc), intent(IN), value :: g

DESCRIPTION

 same functionality as RPN_MPI_halo, communicators are implicit
 (a previous call to RPN_MPI_ez_halo_parms may be needed)

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_ez_halo_8 8 byte version of RPN_MPI_ez_halo [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_ez_halo8(g,minx,maxx,miny,maxy,lni,lnj,nk,halox,haloy) bind(C,name='RPN_MPI_ez_halo8')

ARGUMENTS

  integer, intent(IN)    :: minx,maxx,miny,maxy,lni,lnj,nk,halox,haloy
  type(RPN_MPI_Loc), intent(IN), value :: g

DESCRIPTION

 same functionality as RPN_MPI_halo8, communicators are implicit
 (a previous call to RPN_MPI_ez_halo_parms may be needed)

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_ez_halo_parms setup call for ez_halo routines [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_ez_halo_parms(row, col, mode) bind(C,name='RPN_MPI_ez_halo_parms')

ARGUMENTS

  type(RPN_MPI_Comm), intent(IN) :: row, col
  integer, intent(IN) :: row, col
  character(len=1), dimension(*), intent(IN) :: mode

DESCRIPTION

 row         : RPN_MPI communicator for the grid row this PE belongs to
 col         : RPN_MPI communicator for the grid column this PE belongs to
 mode == 'B' : add a MPI_Barrier call between the x and y phases of the exchange
               (used for timing purposes)

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_get_halo_timings get a copy of the current timing stats [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 function RPN_MPI_get_halo_timings(t,n) result(nt) BIND(C,name='RPN_MPI_get_halo_timings')

ARGUMENTS

  integer, intent(IN) :: n
  integer(kind=8), dimension(n), intent(OUT) :: t
  integer :: nt

DESCRIPTION

 t      : array of 64 bit integers to receive timing stats
 n      : dimension of array t
 function value : number of halo exchanges performed since last stats reset

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_halo halo exchange for 4 byte items [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_halo(g,minx,maxx,miny,maxy,lni,lnj,nk,halox,haloy,row,col) BIND(C,name='RPN_MPI_halo')

ARGUMENTS

  integer(C_INT), intent(IN)    :: minx,maxx,miny,maxy,lni,lnj,nk,halox,haloy
  type(RPN_MPI_Comm), intent(IN) :: row,col
  type(RPN_MPI_Loc), intent(IN), value :: g

DESCRIPTION

 this routine will perform a horizontal halo exchange with NO PERIODIC BOUNDARY conditions 
 for all "planes" of a "grid"

 row         : RPN_MPI communicator for the grid row this PE belongs to
 col         : RPN_MPI communicator for the grid column this PE belongs to
 minx, maxx, miny, maxy : horizontal(plane) dimensions of array pointed to by g
 nk          : vertical dimension of array pointed to by g
 lni, lnj    : "useful" horizontal dimensions of array pointed to byy g
 halox       : number of "halo" points along x
 haloy       : number of "halo" points along y
 g           : address (wrapped) of array

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_halo8 8 byte version of RPN_MPI_halo [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_halo8(g,minx,maxx,miny,maxy,lni,lnj,nk,halox,haloy,row,col) BIND(C,name='RPN_MPI_halo8')

ARGUMENTS

  integer(C_INT), intent(IN)    :: minx,maxx,miny,maxy,lni,lnj,nk,halox,haloy
  type(RPN_MPI_Comm), intent(IN) :: row,col
  type(RPN_MPI_Loc), intent(IN), value :: g

DESCRIPTION

 see RPN_MPI_halo. (array subject to halo exchange is made of 8 byte items)

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_print_halo_timings print accumulated timing stats [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_print_halo_timings() BIND(C,name='RPN_MPI_print_halo_timings')

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020

rpn_mpi/RPN_MPI_reset_halo_timings reset timing stats [ Functions ]

[ Top ] [ Functions ]

SYNOPSIS

 subroutine RPN_MPI_reset_halo_timings() BIND(C,name='RPN_MPI_reset_halo_timings')

AUTHOR

  M.Valin Recherche en Prevision Numerique 2020