| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| 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) |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| 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 |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(SetInterface3D), | intent(inout) | :: | this | |||
| type(SetTraceRef), | intent(in) | :: | traces(1:) |
Send each remote face's outbox to the partner's rank, and fill
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(SetInterface3D_t), | intent(inout) | :: | this |
Free the device buffers, then the host map. Collective.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(SetInterface3D), | intent(inout) | :: | this |
outbox(:,:,v,f) = trace of set k on face f, v = 1..nvar(k), unflipped, for every local interface face f of every set k. Host traces.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(SetInterface3D_t), | intent(inout) | :: | this | |||
| type(SetTraceRef), | intent(in) | :: | traces(1:) |
type,extends(SetInterface3D_t) :: SetInterface3D
type(c_ptr) :: faceElem_gpu = c_null_ptr
type(c_ptr) :: faceSide_gpu = c_null_ptr
type(c_ptr) :: outbox_gpu = c_null_ptr
type(c_ptr) :: ghost_gpu = c_null_ptr
contains
procedure :: BuildMap => BuildMap_SetInterface3D
procedure :: Exchange => Exchange_SetInterface3D
procedure :: Free => Free_SetInterface3D
endtype SetInterface3D