SideExchangeFinish_MappedScalar2D Subroutine

public subroutine SideExchangeFinish_MappedScalar2D(this, mesh)

Complete the aggregated halo exchange started by SideExchangeStart: wait on the persistent requests and unpack the received traces into extBoundary, applying side flips. The host blocks in MPI_Waitall (which also drives MPI progress) while previously launched device kernels continue to execute. No-op if no exchange is in flight.

Arguments

TypeIntentOptionalAttributesName
class(MappedScalar2D), intent(inout) :: this
type(Mesh2D), intent(inout) :: mesh

Calls

proc~~sideexchangefinish_mappedscalar2d~~CallsGraph proc~sideexchangefinish_mappedscalar2d SideExchangeFinish_MappedScalar2D mpi_waitall mpi_waitall proc~sideexchangefinish_mappedscalar2d->mpi_waitall interface~halounpack_2d_gpu HaloUnpack_2D_gpu proc~sideexchangefinish_mappedscalar2d->interface~halounpack_2d_gpu

Contents


Source Code

  subroutine SideExchangeFinish_MappedScalar2D(this,mesh)
  !! Complete the aggregated halo exchange started by SideExchangeStart:
  !! wait on the persistent requests and unpack the received traces into
  !! extBoundary, applying side flips. The host blocks in MPI_Waitall (which
  !! also drives MPI progress) while previously launched device kernels
  !! continue to execute. No-op if no exchange is in flight.
    implicit none
    class(MappedScalar2D),intent(inout) :: this
    type(Mesh2D),intent(inout) :: mesh
    ! Local
    integer :: iError

    if(this%halo_inflight > 0) then

      call MPI_WAITALL(2*mesh%decomp%halo_nnbr,this%halo_reqs, &
                       MPI_STATUSES_IGNORE,iError)

      ! Unpack the received traces into extBoundary, applying side flips
      call HaloUnpack_2D_gpu(this%halo_recvbuf_gpu,this%extboundary_gpu, &
                             mesh%decomp%halo_sides_gpu,this%interp%N, &
                             this%halo_inflight,this%nelem,mesh%decomp%halo_nsides)

      if(this%halo_inflight == this%nvar) this%halo_static_done = .true.
      this%halo_inflight = 0

    endif

  endsubroutine SideExchangeFinish_MappedScalar2D