Posts the point-to-point messages required for mortar interfaces whose big and small elements reside on different ranks. The big-face rank sends its face trace to each remote small-face rank and receives each remote small-face trace; tags are built from the sub-face global side ids, following the conforming SideExchange tag convention.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MappedScalar3D_t), | intent(inout) | :: | this | |||
| type(Mesh3D), | intent(inout) | :: | mesh |
subroutine MPIMortarExchangeAsync_MappedScalar3D_t(this,mesh)
!! Posts the point-to-point messages required for mortar interfaces whose big and
!! small elements reside on different ranks. The big-face rank sends its face trace
!! to each remote small-face rank and receives each remote small-face trace; tags
!! are built from the sub-face global side ids, following the conforming
!! SideExchange tag convention.
implicit none
class(MappedScalar3D_t),intent(inout) :: this
type(Mesh3D),intent(inout) :: mesh
! Local
integer :: m,q,ivar
integer :: eB,sB,rB,eS,sS,rS
integer :: globalSideId,tag
integer :: offset
integer :: iError
integer :: msgCount
msgCount = 0
offset = mesh%decomp%offsetElem(mesh%decomp%rankId+1)
do ivar = 1,this%nvar
do m = 1,mesh%nMortars
eB = mesh%mortarInfo(1,m)
sB = mesh%mortarInfo(2,m)
rB = mesh%decomp%elemToRank(eB)
do q = 1,4
eS = mesh%mortarInfo(2*q+1,m)
sS = mesh%mortarInfo(2*q+2,m)/10
rS = mesh%decomp%elemToRank(eS)
globalSideId = mesh%mortarInfo(10+q,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%mortarBuff(:,:,4+q,m,ivar), &
(this%interp%N+1)*(this%interp%N+1), &
mesh%decomp%mpiPrec, &
rS,tag, &
mesh%decomp%mpiComm, &
mesh%decomp%requests(msgCount),iError)
msgCount = msgCount+1
call MPI_ISEND(this%boundary(:,:,sB,eB-offset,ivar), &
(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_IRECV(this%mortarBuff(:,:,q,m,ivar), &
(this%interp%N+1)*(this%interp%N+1), &
mesh%decomp%mpiPrec, &
rB,tag, &
mesh%decomp%mpiComm, &
mesh%decomp%requests(msgCount),iError)
msgCount = msgCount+1
call MPI_ISEND(this%boundary(:,:,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 MPIMortarExchangeAsync_MappedScalar3D_t