MPIAnisoMortarFluxAsync_MappedVector3D_t Subroutine

public subroutine MPIAnisoMortarFluxAsync_MappedVector3D_t(this, mesh)

Posts the one-directional messages for AnisoMortarFluxCollect : each remote small face sends its boundaryNormal trace to the big face's rank.

Arguments

TypeIntentOptionalAttributesName
class(MappedVector3D_t), intent(inout) :: this
type(Mesh3D), intent(inout) :: mesh

Calls

proc~~mpianisomortarfluxasync_mappedvector3d_t~~CallsGraph proc~mpianisomortarfluxasync_mappedvector3d_t MPIAnisoMortarFluxAsync_MappedVector3D_t mpi_irecv mpi_irecv proc~mpianisomortarfluxasync_mappedvector3d_t->mpi_irecv mpi_isend mpi_isend proc~mpianisomortarfluxasync_mappedvector3d_t->mpi_isend

Contents


Source Code

  subroutine MPIAnisoMortarFluxAsync_MappedVector3D_t(this,mesh)
    !! Posts the one-directional messages for AnisoMortarFluxCollect : each remote
    !! small face sends its boundaryNormal trace to the big face's rank.
    implicit none
    class(MappedVector3D_t),intent(inout) :: this
    type(Mesh3D),intent(inout) :: mesh
    ! Local
    integer :: m,h,ivar
    integer :: eB,rB,eS,sS,rS
    integer :: globalSideId,tag
    integer :: offset
    integer :: iError
    integer :: msgCount

    ! One message per rank-crossing half, per variable.
    call mesh%decomp%ReserveMessages(this%nvar* &
                                     mesh%decomp%CountRemoteMortarSides(mesh%anisoMortarInfo,mesh%nAnisoMortars,2))

    msgCount = 0
    offset = mesh%decomp%offsetElem(mesh%decomp%rankId+1)

    do ivar = 1,this%nvar
      do m = 1,mesh%nAnisoMortars

        eB = mesh%anisoMortarInfo(1,m)
        rB = mesh%decomp%elemToRank(eB)

        do h = 1,2

          eS = mesh%anisoMortarInfo(2*h+1,m)
          sS = mesh%anisoMortarInfo(2*h+2,m)/10
          rS = mesh%decomp%elemToRank(eS)
          globalSideId = mesh%anisoMortarInfo(6+h,m)
          tag = globalSideId+mesh%nUniqueSides*(ivar-1)

          if(rB == mesh%decomp%rankId .and. rS /= mesh%decomp%rankId) then

            msgCount = msgCount+1
            call MPI_IRECV(this%anisoMortarBuff(:,:,2+h,m,ivar,1), &
                           (this%interp%N+1)*(this%interp%N+1), &
                           mesh%decomp%mpiPrec, &
                           rS,tag, &
                           mesh%decomp%mpiComm, &
                           mesh%decomp%requests(msgCount),iError)

          elseif(rS == mesh%decomp%rankId .and. rB /= mesh%decomp%rankId) then

            msgCount = msgCount+1
            call MPI_ISEND(this%boundaryNormal(:,:,sS,eS-offset,ivar), &
                           (this%interp%N+1)*(this%interp%N+1), &
                           mesh%decomp%mpiPrec, &
                           rB,tag, &
                           mesh%decomp%mpiComm, &
                           mesh%decomp%requests(msgCount),iError)

          endif

        enddo
      enddo
    enddo

    mesh%decomp%msgCount = msgCount

  endsubroutine MPIAnisoMortarFluxAsync_MappedVector3D_t