SELF_SetInterface_3D Module

GPU backend of the element-set interface exchange. When every set with interface faces supplies a device trace (SetTraceRef%trace_gpu), the face traces are gathered on the device and copied to the host in one transfer; the host exchange then runs as on the CPU, and the ghost traces are copied back to the device for FillSetInterfaceBoundary_gpu. Without device traces the host path runs unchanged.


Uses

  • module~~self_setinterface_3d~~UsesGraph module~self_setinterface_3d SELF_SetInterface_3D module~self_mesh_3d SELF_Mesh_3D module~self_setinterface_3d->module~self_mesh_3d module~self_setinterface_3d_t SELF_SetInterface_3D_t module~self_setinterface_3d->module~self_setinterface_3d_t module~self_constants SELF_Constants module~self_setinterface_3d->module~self_constants iso_c_binding iso_c_binding module~self_setinterface_3d->iso_c_binding module~self_gpu SELF_GPU module~self_setinterface_3d->module~self_gpu module~self_mesh_3d->iso_c_binding module~self_mesh_3d->module~self_gpu module~self_mesh_3d_t SELF_Mesh_3D_t module~self_mesh_3d->module~self_mesh_3d_t module~self_setinterface_3d_t->module~self_mesh_3d module~self_setinterface_3d_t->module~self_constants module~self_setinterface_3d_t->iso_c_binding mpi mpi module~self_setinterface_3d_t->mpi module~self_constants->iso_c_binding iso_fortran_env iso_fortran_env module~self_constants->iso_fortran_env module~self_gpu->iso_c_binding module~self_gpu_enums~2 SELF_GPU_enums module~self_gpu->module~self_gpu_enums~2 module~self_mesh_3d_t->module~self_constants module~self_mesh_3d_t->iso_c_binding module~self_supportroutines SELF_SupportRoutines module~self_mesh_3d_t->module~self_supportroutines module~self_mesh SELF_Mesh module~self_mesh_3d_t->module~self_mesh module~self_quadrature SELF_Quadrature module~self_mesh_3d_t->module~self_quadrature module~self_hdf5 SELF_HDF5 module~self_mesh_3d_t->module~self_hdf5 HDF5 HDF5 module~self_mesh_3d_t->HDF5 module~self_domaindecomposition SELF_DomainDecomposition module~self_mesh_3d_t->module~self_domaindecomposition module~self_mesh_2d_t SELF_Mesh_2D_t module~self_mesh_3d_t->module~self_mesh_2d_t module~self_lagrange~3 SELF_Lagrange module~self_mesh_3d_t->module~self_lagrange~3 module~self_gpu_enums~2->iso_c_binding module~self_supportroutines->module~self_constants module~self_supportroutines->iso_fortran_env module~self_mesh->module~self_constants module~self_mesh->iso_c_binding module~self_mesh->module~self_domaindecomposition module~self_quadrature->module~self_constants module~self_quadrature->iso_fortran_env module~self_hdf5->module~self_constants module~self_hdf5->mpi module~self_hdf5->iso_fortran_env module~self_hdf5->HDF5 module~self_domaindecomposition->iso_c_binding module~self_domaindecomposition->mpi module~self_domaindecomposition->iso_fortran_env module~self_domaindecomposition_t SELF_DomainDecomposition_t module~self_domaindecomposition->module~self_domaindecomposition_t module~self_mesh_2d_t->module~self_constants module~self_mesh_2d_t->iso_c_binding module~self_mesh_2d_t->module~self_supportroutines module~self_mesh_2d_t->module~self_mesh module~self_mesh_2d_t->module~self_quadrature module~self_mesh_2d_t->module~self_hdf5 module~self_mesh_2d_t->HDF5 module~self_mesh_2d_t->module~self_domaindecomposition module~self_mesh_2d_t->module~self_lagrange~3 module~self_lagrange~3->module~self_constants module~self_lagrange~3->iso_c_binding module~self_lagrange~3->module~self_gpu module~self_lagrange~3->iso_fortran_env module~self_lagrange_t SELF_Lagrange_t module~self_lagrange~3->module~self_lagrange_t module~self_domaindecomposition_t->module~self_constants module~self_domaindecomposition_t->iso_c_binding module~self_domaindecomposition_t->mpi module~self_domaindecomposition_t->module~self_supportroutines module~self_domaindecomposition_t->module~self_lagrange~3 module~self_lagrange_t->module~self_constants module~self_lagrange_t->iso_c_binding module~self_lagrange_t->iso_fortran_env module~self_lagrange_t->module~self_supportroutines module~self_lagrange_t->module~self_quadrature module~self_lagrange_t->module~self_hdf5 module~self_lagrange_t->HDF5

Used by

  • module~~self_setinterface_3d~~UsedByGraph module~self_setinterface_3d SELF_SetInterface_3D module~self_multisetmodel3d_t SELF_MultiSetModel3D_t module~self_multisetmodel3d_t->module~self_setinterface_3d module~self_multisetmodel3d SELF_MultiSetModel3D module~self_multisetmodel3d->module~self_setinterface_3d module~self_multisetmodel3d->module~self_multisetmodel3d_t module~self_multisetmodel3d~2 SELF_MultiSetModel3D module~self_multisetmodel3d~2->module~self_multisetmodel3d_t

Contents


Interfaces

interface

  • public subroutine FillSetInterfaceBoundary_gpu(extBoundary, ghost, elems, sides, f0, nFaces, nvar, nvarMax, N, nel) bind(c,name="0")

    Arguments

    TypeIntentOptionalAttributesName
    type(c_ptr), value:: extBoundary
    type(c_ptr), value:: ghost
    type(c_ptr), value:: elems
    type(c_ptr), value:: sides
    integer(kind=c_int), value:: f0
    integer(kind=c_int), value:: nFaces
    integer(kind=c_int), value:: nvar
    integer(kind=c_int), value:: nvarMax
    integer(kind=c_int), value:: N
    integer(kind=c_int), value:: nel

interface

  • public subroutine GatherSetInterfaceOutbox_gpu(outbox, trace, elems, sides, f0, nFaces, nvar, nvarMax, N, nel) bind(c,name="0")

    Arguments

    TypeIntentOptionalAttributesName
    type(c_ptr), value:: outbox
    type(c_ptr), value:: trace
    type(c_ptr), value:: elems
    type(c_ptr), value:: sides
    integer(kind=c_int), value:: f0
    integer(kind=c_int), value:: nFaces
    integer(kind=c_int), value:: nvar
    integer(kind=c_int), value:: nvarMax
    integer(kind=c_int), value:: N
    integer(kind=c_int), value:: nel

Derived Types

type, public, extends(SetInterface3D_t) :: SetInterface3D

Components

TypeVisibilityAttributesNameInitial
integer, public :: N =0
integer, public :: comm =MPI_COMM_NULL
integer, public, allocatable:: faceElem(:)

element in set k's sub-mesh

type(c_ptr), public :: faceElem_gpu =c_null_ptr
integer, public, allocatable:: faceFlip(:)

mod(sideInfo(4),10) of the receiving side

integer, public, allocatable:: facePartnerElem(:)

partner element in set p's sub-mesh; 0 if remote

integer, public, allocatable:: facePartnerFace(:)

local face index of the partner; 0 if remote Own and partner traces, (1:Np,1:Np,1:nvarMax,1:nFaces). Pointers so a GPU backend can copy them to and from device memory with c_loc.

integer, public, allocatable:: facePartnerRank(:)

rank owning the partner element

integer, public, allocatable:: facePartnerSet(:)

partner set p

integer, public, allocatable:: facePartnerSide(:)

partner local side 1..6

integer, public, allocatable:: faceSet(:)

receiving set k

integer, public, allocatable:: faceSide(:)

local side 1..6

integer, public, allocatable:: faceSideId(:)

|global side id|

type(c_ptr), public :: faceSide_gpu =c_null_ptr
real(kind=prec), public, pointer, contiguous:: ghost(:,:,:,:)=> null()

Neighbour ranks and their faces

type(c_ptr), public :: ghost_gpu =c_null_ptr
integer, public :: mpiPrec
integer, public :: nFaces =0
integer, public :: nNbr =0
integer, public :: nSets =0
integer, public, allocatable:: nbrFace(:)

local face index, ordered by neighbour then side id

integer, public, allocatable:: nbrFaceStart(:)

(1:nNbr+1)

integer, public, allocatable:: nbrRank(:)
integer, public :: nvarMax =0

Local interface faces, f = 1..nFaces

integer, public, allocatable:: nvarOfSet(:)
real(kind=prec), public, pointer, contiguous:: outbox(:,:,:,:)=> null()
type(c_ptr), public :: outbox_gpu =c_null_ptr
integer, public :: rankId =0
real(kind=prec), public, allocatable:: recvBuf(:)
integer, public, allocatable:: recvStart(:)

(1:nNbr+1), offsets into recvBuf

integer, public, allocatable:: requests(:)
real(kind=prec), public, allocatable:: sendBuf(:)
integer, public, allocatable:: sendStart(:)

(1:nNbr+1), offsets into sendBuf

integer, public, allocatable:: setFaceStart(:)

(1:nSets+1)

Type-Bound Procedures

procedure, public :: BuildMap => BuildMap_SetInterface3D
procedure, public :: Exchange => Exchange_SetInterface3D
procedure, public :: ExchangeOutbox => ExchangeOutbox_SetInterface3D_t
procedure, public :: Free => Free_SetInterface3D
procedure, public :: GatherOutbox => GatherOutbox_SetInterface3D_t

Subroutines

public subroutine BuildMap_SetInterface3D(this, globalMesh, setOfElem, setGlobalId, setOffsetThisRank, nvarOfSet, N)

Build the map on the host (BuildMap_SetInterface3D_t), then copy the face element and side lists to the device and allocate device outbox and ghost buffers.

Arguments

TypeIntentOptionalAttributesName
class(SetInterface3D), intent(inout) :: this
type(Mesh3D), intent(in) :: globalMesh
integer, intent(in) :: setOfElem(1:)
integer, intent(in) :: setGlobalId(1:)
integer, intent(in) :: setOffsetThisRank(1:)
integer, intent(in) :: nvarOfSet(1:)
integer, intent(in) :: N

public subroutine Exchange_SetInterface3D(this, traces)

As Exchange_SetInterface3D_t. If every set with local interface faces has a device trace, the outbox is gathered on the device; either way ghost is copied to the device afterwards, so FillSetInterfaceBoundary_gpu reads the current exchange.

Arguments

TypeIntentOptionalAttributesName
class(SetInterface3D), intent(inout) :: this
type(SetTraceRef), intent(in) :: traces(1:)

public subroutine Free_SetInterface3D(this)

Free the device buffers, then the host map. Collective.

Arguments

TypeIntentOptionalAttributesName
class(SetInterface3D), intent(inout) :: this