GenerateDecompositionFromOffsets_DomainDecomposition Subroutine

public subroutine GenerateDecompositionFromOffsets_DomainDecomposition(this, offsetElem, maxMsg)

Device-aware wrapper of GenerateDecompositionFromOffsets_DomainDecomposition_t: builds the host decomposition from the prescribed offsets, then mirrors elemToRank to the device, as SetElemToRank does for the balanced decomposition.

Arguments

TypeIntentOptionalAttributesName
class(DomainDecomposition), intent(inout) :: this
integer, intent(in) :: offsetElem(1:this%nRanks+1)
integer, intent(in) :: maxMsg

Calls

proc~~generatedecompositionfromoffsets_domaindecomposition~~CallsGraph proc~generatedecompositionfromoffsets_domaindecomposition GenerateDecompositionFromOffsets_DomainDecomposition interface~hipfree hipFree proc~generatedecompositionfromoffsets_domaindecomposition->interface~hipfree interface~hipmemcpy hipMemcpy proc~generatedecompositionfromoffsets_domaindecomposition->interface~hipmemcpy interface~hipmalloc hipMalloc proc~generatedecompositionfromoffsets_domaindecomposition->interface~hipmalloc proc~gpucheck gpuCheck proc~generatedecompositionfromoffsets_domaindecomposition->proc~gpucheck

Contents


Source Code

  subroutine GenerateDecompositionFromOffsets_DomainDecomposition(this,offsetElem,maxMsg)
  !! Device-aware wrapper of GenerateDecompositionFromOffsets_DomainDecomposition_t: builds
  !! the host decomposition from the prescribed offsets, then mirrors elemToRank to the
  !! device, as SetElemToRank does for the balanced decomposition.
    implicit none
    class(DomainDecomposition),intent(inout) :: this
    integer,intent(in) :: offsetElem(1:this%nRanks+1)
    integer,intent(in) :: maxMsg

    if(associated(this%elemToRank)) then
      call gpuCheck(hipFree(this%elemToRank_gpu))
    endif

    call this%DomainDecomposition_t%GenerateDecompositionFromOffsets(offsetElem,maxMsg)

    call gpuCheck(hipMalloc(this%elemToRank_gpu,sizeof(this%elemToRank)))
    call gpuCheck(hipMemcpy(this%elemToRank_gpu,c_loc(this%elemToRank),sizeof(this%elemToRank),hipMemcpyHostToDevice))

  endsubroutine GenerateDecompositionFromOffsets_DomainDecomposition