OwnedRun Subroutine

public subroutine OwnedRun(offsetElem, r, first, last, a, b)

The run of elements that rank r-1 owns and that also lies in [first,last]: a..b, empty when b < a. offsetElem is a decomposition's contiguous ownership table, so rank r-1 owns offsetElem(r)+1 .. offsetElem(r+1).

Both halves of the migration schedule are this one intersection, evaluated from replicated tables: my receive run from peer r-1 is (my window) n (r-1's old range), and my send run to peer r-1 is (r-1's window) n (my old range). Factored out so that the sender and the receiver cannot drift apart, and so a serial test can exercise the arithmetic the exchange actually uses rather than a copy of it.

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: offsetElem(:)
integer, intent(in) :: r

1-based table index; the rank is r-1

integer, intent(in) :: first
integer, intent(in) :: last
integer, intent(out) :: a
integer, intent(out) :: b

Called by

proc~~ownedrun~~CalledByGraph proc~ownedrun OwnedRun proc~postoldwindowexchange PostOldWindowExchange proc~postoldwindowexchange->proc~ownedrun proc~exchangeoldwindowflat ExchangeOldWindowFlat proc~exchangeoldwindowflat->proc~ownedrun proc~exchangeoldwindowflat->proc~postoldwindowexchange proc~migrateoldwindow_dgmodel3d MigrateOldWindow_DGModel3D proc~migrateoldwindow_dgmodel3d->proc~ownedrun proc~migrateoldwindow_dgmodel3d->proc~postoldwindowexchange proc~migrateoldwindow_dgmodel2d MigrateOldWindow_DGModel2D proc~migrateoldwindow_dgmodel2d->proc~ownedrun proc~migrateoldwindow_dgmodel2d->proc~postoldwindowexchange proc~migrateoldwindow_dgmodel2d_t MigrateOldWindow_DGModel2D_t proc~migrateoldwindow_dgmodel2d_t->proc~exchangeoldwindowflat proc~migrateoldwindow_dgmodel3d_t MigrateOldWindow_DGModel3D_t proc~migrateoldwindow_dgmodel3d_t->proc~exchangeoldwindowflat proc~exchangeoldwindow ExchangeOldWindow proc~exchangeoldwindow->proc~exchangeoldwindowflat proc~exchangeoldwindow~2 ExchangeOldWindow proc~exchangeoldwindow~2->proc~exchangeoldwindowflat proc~adapt_amrcontroller2d Adapt_AMRController2D proc~adapt_amrcontroller2d->proc~migrateoldwindow_dgmodel2d_t proc~adapt_amrcontroller3d Adapt_AMRController3D proc~adapt_amrcontroller3d->proc~migrateoldwindow_dgmodel3d_t

Contents

Source Code


Source Code

  subroutine OwnedRun(offsetElem,r,first,last,a,b)
    !! The run of elements that rank r-1 owns and that also lies in [first,last]: a..b, empty when
    !! b < a. offsetElem is a decomposition's contiguous ownership table, so rank r-1 owns
    !! offsetElem(r)+1 .. offsetElem(r+1).
    !!
    !! Both halves of the migration schedule are this one intersection, evaluated from replicated
    !! tables: my receive run from peer r-1 is (my window) n (r-1's old range), and my send run to
    !! peer r-1 is (r-1's window) n (my old range). Factored out so that the sender and the
    !! receiver cannot drift apart, and so a serial test can exercise the arithmetic the exchange
    !! actually uses rather than a copy of it.
    implicit none
    integer,intent(in) :: offsetElem(:)
    integer,intent(in) :: r !! 1-based table index; the rank is r-1
    integer,intent(in) :: first
    integer,intent(in) :: last
    integer,intent(out) :: a
    integer,intent(out) :: b

    a = max(first,offsetElem(r)+1)
    b = min(last,offsetElem(r+1))

  endsubroutine OwnedRun