GPU implementation of the anisotropic mortar exchange (see the base class for the algorithm) : traces are staged, reoriented, restricted, and projected in device memory with the SELF_Mortar kernels.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MappedScalar3D), | intent(inout) | :: | this | |||
| type(Mesh3D), | intent(inout) | :: | mesh |
subroutine AnisoMortarExchange_MappedScalar3D(this,mesh)
!! GPU implementation of the anisotropic mortar exchange (see the base class for
!! the algorithm) : traces are staged, reoriented, restricted, and projected in
!! device memory with the SELF_Mortar kernels.
implicit none
class(MappedScalar3D),intent(inout) :: this
type(Mesh3D),intent(inout) :: mesh
! Local
integer :: offset
integer(c_size_t) :: buffSize
offset = mesh%decomp%offsetElem(mesh%decomp%rankId+1)
if(.not. c_associated(this%anisoMortarBuff_gpu)) then
! AnisoMortarFlip_3D stages one face through shared memory (MORTAR3D_MAXNP).
if(this%interp%N+1 > 16) then
print*,__FILE__,' : Error : 3D mortar kernels support N+1 <= 16.'
stop 1
endif
buffSize = int(this%interp%N+1,c_size_t)*(this%interp%N+1)*4* &
mesh%nAnisoMortars*this%nvar*prec
call gpuCheck(hipMalloc(this%anisoMortarBuff_gpu,buffSize))
endif
if(mesh%decomp%mpiEnabled) then
call this%MPIAnisoMortarExchangeAsync(mesh)
endif
call AnisoMortarGather_3D_gpu(this%anisoMortarBuff_gpu,this%boundary_gpu, &
mesh%anisoMortarInfo_gpu,mesh%decomp%elemToRank_gpu, &
mesh%decomp%rankId,offset,this%interp%N,this%nvar, &
mesh%nAnisoMortars,this%nelem)
if(mesh%decomp%mpiEnabled) then
call mesh%decomp%FinalizeMPIExchangeAsync()
call AnisoMortarFlip_3D_gpu(this%anisoMortarBuff_gpu,mesh%anisoMortarInfo_gpu, &
mesh%decomp%elemToRank_gpu,mesh%decomp%rankId, &
this%interp%N,this%nvar,mesh%nAnisoMortars)
endif
call AnisoMortarScatter_3D_gpu(this%extBoundary_gpu,this%anisoMortarBuff_gpu, &
this%interp%mortarR_gpu,this%interp%mortarP_gpu, &
mesh%anisoMortarInfo_gpu,mesh%decomp%elemToRank_gpu, &
mesh%decomp%rankId,offset,this%interp%N,this%nvar, &
mesh%nAnisoMortars,this%nelem)
endsubroutine AnisoMortarExchange_MappedScalar3D