BuildMap_SetInterface3D Subroutine

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

Calls

proc~~buildmap_setinterface3d~~CallsGraph proc~buildmap_setinterface3d BuildMap_SetInterface3D proc~buildmap_setinterface3d_t BuildMap_SetInterface3D_t proc~buildmap_setinterface3d->proc~buildmap_setinterface3d_t interface~hipmalloc hipMalloc proc~buildmap_setinterface3d->interface~hipmalloc proc~gpucheck gpuCheck proc~buildmap_setinterface3d->proc~gpucheck interface~hipmemcpy hipMemcpy proc~buildmap_setinterface3d->interface~hipmemcpy mpi_comm_dup mpi_comm_dup proc~buildmap_setinterface3d_t->mpi_comm_dup mpi_recv_init mpi_recv_init proc~buildmap_setinterface3d_t->mpi_recv_init proc~heapsortbykey HeapSortByKey proc~buildmap_setinterface3d_t->proc~heapsortbykey mpi_send_init mpi_send_init proc~buildmap_setinterface3d_t->mpi_send_init

Contents


Source Code

  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.
    implicit none
    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
    ! Local
    integer(c_int),allocatable,target :: buf(:)

    call BuildMap_SetInterface3D_t(this,globalMesh,setOfElem,setGlobalId, &
                                   setOffsetThisRank,nvarOfSet,N)
    if(this%nFaces == 0) return

    allocate(buf(1:this%nFaces))
    buf = this%faceElem
    call gpuCheck(hipMalloc(this%faceElem_gpu,sizeof(buf)))
    call gpuCheck(hipMemcpy(this%faceElem_gpu,c_loc(buf),sizeof(buf),hipMemcpyHostToDevice))
    buf = this%faceSide
    call gpuCheck(hipMalloc(this%faceSide_gpu,sizeof(buf)))
    call gpuCheck(hipMemcpy(this%faceSide_gpu,c_loc(buf),sizeof(buf),hipMemcpyHostToDevice))
    deallocate(buf)

    call gpuCheck(hipMalloc(this%outbox_gpu,sizeof(this%outbox)))
    call gpuCheck(hipMalloc(this%ghost_gpu,sizeof(this%ghost)))

  endsubroutine BuildMap_SetInterface3D