SideExchange_MappedVector2D Subroutine

public subroutine SideExchange_MappedVector2D(this, mesh)

Arguments

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

Calls

proc~~sideexchange_mappedvector2d~~CallsGraph proc~sideexchange_mappedvector2d SideExchange_MappedVector2D interface~sideexchange_2d_gpu SideExchange_2D_gpu proc~sideexchange_mappedvector2d->interface~sideexchange_2d_gpu interface~halounpack_2d_gpu HaloUnpack_2D_gpu proc~sideexchange_mappedvector2d->interface~halounpack_2d_gpu

Contents


Source Code

  subroutine SideExchange_MappedVector2D(this,mesh)
    implicit none
    class(MappedVector2D),intent(inout) :: this
    type(Mesh2D),intent(inout) :: mesh
    ! Local
    integer :: offset

    offset = mesh%decomp%offsetElem(mesh%decomp%rankid+1)

    if(mesh%decomp%mpiEnabled) then
      if(.not. mesh%decomp%halo_built) then
        call mesh%decomp%BuildHaloExchange(mesh%sideInfo,mesh%nElem,4)
      endif
      if(mesh%decomp%halo_nsides > 0) then
        call this%MPIExchangeAsync(mesh)
      endif
    endif

    ! The local (same-rank) side exchange runs on the device while the
    ! aggregated MPI messages are in flight.
    call SideExchange_2D_gpu(this%extboundary_gpu, &
                             this%boundary_gpu,mesh%sideinfo_gpu,mesh%decomp%elemToRank_gpu, &
                             mesh%decomp%rankid,offset,this%interp%N,2*this%nvar,this%nelem)

    if(mesh%decomp%mpiEnabled) then
      if(mesh%decomp%halo_nsides > 0) then
        call mesh%decomp%FinalizeMPIExchangeAsync()
        ! 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,2*this%nvar, &
                               this%nelem,mesh%decomp%halo_nsides)
      endif
    endif

  endsubroutine SideExchange_MappedVector2D