Problem Distribution Layer

Problem Distribution Layer

The Problem Distribution Layer managers how the problem is distributed across processes. The main type is BlockMap which represents a problem distribution.

BlockMap

A type for partitioning block element vectors and matrices

source
JuliaPetra.lidFunction.
lid(map::BlockMap{GID, PID, LID}, gid::Integer)::LID

Return local ID of global ID, or 0 if not found on this processor

source
JuliaPetra.gidFunction.
gid(map::BlockMap{GID, PID, LID}, lid::Integer)::GID

Return global ID of local ID, or 0 if not found on this processor

source
JuliaPetra.myLIDFunction.
myLID(map::BlockMap, lidVal::Integer)

Return true if the LID passed in belongs to the calling processor in this map, otherwise returns false.

source
JuliaPetra.myGIDFunction.
myGID(map::BlockMap, gidVal::Integer)

Return true if the GID passed in belongs to the calling processor in this map, otherwise returns false.

source
remoteIDList(map::BlockMap{GID, PID, LID}, gidList::AbstractArray{<: Integer}::Tuple{AbstractArray{PID}, AbstractArray{LID}}

Return the processor ID and local index value for a given list of global indices. The returned value is a tuple containing

  1. an Array of processors owning the global ID's in question
  2. an Array of local IDs of the global on the owning processor
source
JuliaPetra.minAllGIDFunction.
minAllGID(map::BlockMap{GID, PID, LID})::GID

Return the minimum global ID across the entire map

source
JuliaPetra.maxAllGIDFunction.
maxAllGID(map::BlockMap{GID, PID, LID})::GID

Return the maximum global ID across the entire map

source
JuliaPetra.minMyGIDFunction.
minMyGID(map::BlockMap{GID, PID, LID})::GID

Return the minimum global ID owned by this processor

source
JuliaPetra.maxMyGIDFunction.
maxMyGID(map::BlockMap{GID, PID, LID})::GID

Return the maximum global ID owned by this processor

source
JuliaPetra.minLIDFunction.
minLID(map::BlockMap{GID, PID, LID})::LID

Return the mimimum local index value on the calling processor

source
JuliaPetra.maxLIDFunction.
maxLID(map::BlockMap{GID, PID, LID})::LID

Return the maximum local index value on the calling processor

source
numGlobalElements(map::BlockMap{GID, PID, LID})::GID

Return the number of elements across all processors

source
numMyElements(map::BlockMap{GID, PID, LID})::LID

Return the number of elements across the calling processor

source
myGlobalElements(map::BlockMap{GID, PID, LID})::AbstractArray{GID}

Return a list of global elements on this processor

source
myGlobalElementsIDs map::BlockMap{GID, PID, LID})::AbstractArray{GID}

Return list of global IDs assigned to the calling processor

source
JuliaPetra.uniqueGIDsFunction.
uniqueGIDs(map::BlockMap)::Bool

Return true if each map GID exists on at most 1 processor

source
sameBlockMapDataAs(this::BlockMap, other::BlockMap)::Bool

Return true if the maps have the same data

source
JuliaPetra.sameAsFunction.
sameAs(this::BlockMap, other::BlockMap)::Bool

Return true if this and other are identical maps

source
globalIndicesType(map::BlockMap{GID, PID, LID})::Type{GID}

Return the type used for global indices in the map

source
JuliaPetra.linearMapFunction.
linearMap(map::BlockMap)::Bool

Return true if the global ID space is contiguously divided (but not necessarily uniformly) across all processors

source
distributedGlobal(map::BlockMap)

Return true if map is defined across more than one processor

source

Returns true if this object is a distributed global

source

Directory

A base type as an interface to allow BlockMap objects to reference non-local elements.

All subtypes must have the following methods, with DirectoryImpl standing in for the subtype:

getDirectoryEntries(directory::DirectoryImpl, map::BlockMap, globalEntries::AbstractArray{GID}, highranksharing_procs::Bool)::Tuple{AbstractArray{PID}, AbstractArray{LID}} where GID <: Integer where PID <: Integer where LID <:Integer - Returns processor and local id infor for non-local map entries. Returns a tuple containing 1 - an Array of processors owning the global ID's in question 2 - an Array of local IDs of the global on the owning processor

gidsAllUniquelyOwned(directory::DirectoryImpl) - Returns true if all GIDs appear on just one processor

source
BasicDirectory(map::BlockMap)

Creates a BasicDirectory, which implements the methods of Directory with basic implmentations

source
getDirectoryEntries(directory, map::BlockMap{GID, PID, LID}, globalEntries::AbstractArray{GID}, high_rank_sharing_procs::Bool)::Tuple{AbstractArray{PID}, AbstractArray{LID}}

Returns processor and local id information for non-local map entries. Returns a tuple containing

  1. an Array of processors owning the global ID's in question
  2. an Array of local IDs of the global on the owning processor
source
gidsAllUniquelyOwned(directory)

Returns true if all GIDs appear on just one processor

source
createDirectory(comm::Comm, map::BlockMap)

Create a directory object for the given Map

source

Converting IDs Between Maps

Export
Import
sourceMap
targetMap
distributor
isLocallyComplete
permuteToLIDs
permuteFromLIDs
exportLIDs
remoteLIDs
remotePIDs
numSameIDs

Converting Data Structures Between Maps

Converting data structures between maps is built on the DistObject and SrcDistObject interfaces.

An interface for providing a target when constructing and using multi-vectors, and matrices in parallel.

To support transfers the following methods must be implemented for the combination of source type and the target type

getMap(::DistObject)

Gets the map of the indices of the object

checkSizes(source::<:SrcDistObject{GID, PID, LID}, target::<:DistObject{GID, PID, LID})::Bool

Whether the source and target are compatible for a transfer

copyAndPermute(source::<:SrcDistObject{GID, PID, LID}, target::<:DistObject{GID, PID, LID}, numSameIDs::LID, permuteToLIDs::AbstractArray{LID, 1}, permuteFromLIDs::AbstractArray{LID, 1})

Perform copies and permutations that are local to this process.

packAndPrepare(source::<:SrcDistObject{GID, PID, LID}, target::<:DistObjectGID, PID, LID}, exportLIDs::AbstractArray{LID, 1}, distor::Distributor{GID, PID, LID})::AbstractArray

Perform any packing or preparation required for communications. The method returns the array of objects to export

unpackAndCombine(target::<:DistObject{GID, PID, LID}, importLIDs::AbstractArray{LID, 1}, imports::AAbstractrray, distor::Distributor{GID, PID, LID}, cm::CombineMode)

Perform any unpacking and combining after communication

See SrcDistObject

source

An interface for providing a source when constructing and using multi-vectors and matrices in parallel.

getMap(::SrcDistObject)

Gets the map of the indices of the object

See DistObject

source

Tells JuliaPetra how to combine data received from other processes with existing data on the calling process for specific import or export options.

Here is the list of combine modes:

  • ADD: Sum new values into existing values
  • INSERT: Insert new values that don't currently exist
  • REPLACE: REplace existing values with new values
  • ABSMAX: If $x_{old}$ is the old value and $x_{new}$ the incoming new value, replace $x_{old}$ with $\max(x_{old}, x_{new})$
  • ZERO: Replace old values with zero
source
JuliaPetra.getMapFunction.
getMap(::SrcDistObject)
getMap(::DistObject)

Gets the map of the indices of the object

source
JuliaPetra.checkSizesFunction.
checkSizes(source, target)::Bool

Compare the source and target objects for compatiblity. By default, returns false. Override this to allow transfering to/from subtypes

source
copyAndPermute(source::<:SrcDistObject{GID, PID, LID}, target::<:DistObject{GID, PID, LID}, numSameIDs::LID, permuteToLIDs::AbstractArray{LID, 1}, permuteFromLIDs::AbstractArray{LID, 1})

Perform copies and permutations that are local to this process.

source
packAndPrepare(source::<:SrcDistObject{GID, PID, LID}, target::<:DistObjectGID, PID, LID}, exportLIDs::AbstractArray{LID, 1}, distor::Distributor{GID, PID, LID})::AbstractArray

Perform any packing or preparation required for communications. The method returns the array of objects to export

source
unpackAndCombine(target::<:DistObject{GID, PID, LID}, importLIDs::AbstractArray{LID, 1}, imports::AAbstractrray, distor::Distributor{GID, PID, LID}, cm::CombineMode)

Perform any unpacking and combining after communication

source