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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(DomainDecomposition), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | offsetElem(1:this%nRanks+1) | |||
| integer, | intent(in) | :: | maxMsg |
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