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
JuliaPetra.BlockMap
— Type.A type for partitioning block element vectors and matrices
JuliaPetra.lid
— Function.lid(map::BlockMap{GID, PID, LID}, gid::Integer)::LID
Return local ID of global ID, or 0 if not found on this processor
JuliaPetra.gid
— Function.gid(map::BlockMap{GID, PID, LID}, lid::Integer)::GID
Return global ID of local ID, or 0 if not found on this processor
JuliaPetra.myLID
— Function.myLID(map::BlockMap, lidVal::Integer)
Return true if the LID passed in belongs to the calling processor in this map, otherwise returns false.
JuliaPetra.myGID
— Function.myGID(map::BlockMap, gidVal::Integer)
Return true if the GID passed in belongs to the calling processor in this map, otherwise returns false.
JuliaPetra.remoteIDList
— Function.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
- an Array of processors owning the global ID's in question
- an Array of local IDs of the global on the owning processor
JuliaPetra.minAllGID
— Function.minAllGID(map::BlockMap{GID, PID, LID})::GID
Return the minimum global ID across the entire map
JuliaPetra.maxAllGID
— Function.maxAllGID(map::BlockMap{GID, PID, LID})::GID
Return the maximum global ID across the entire map
JuliaPetra.minMyGID
— Function.minMyGID(map::BlockMap{GID, PID, LID})::GID
Return the minimum global ID owned by this processor
JuliaPetra.maxMyGID
— Function.maxMyGID(map::BlockMap{GID, PID, LID})::GID
Return the maximum global ID owned by this processor
JuliaPetra.minLID
— Function.minLID(map::BlockMap{GID, PID, LID})::LID
Return the mimimum local index value on the calling processor
JuliaPetra.maxLID
— Function.maxLID(map::BlockMap{GID, PID, LID})::LID
Return the maximum local index value on the calling processor
JuliaPetra.numGlobalElements
— Function.numGlobalElements(map::BlockMap{GID, PID, LID})::GID
Return the number of elements across all processors
JuliaPetra.numMyElements
— Function.numMyElements(map::BlockMap{GID, PID, LID})::LID
Return the number of elements across the calling processor
JuliaPetra.myGlobalElements
— Function.myGlobalElements(map::BlockMap{GID, PID, LID})::AbstractArray{GID}
Return a list of global elements on this processor
JuliaPetra.myGlobalElementIDs
— Function.myGlobalElementsIDs map::BlockMap{GID, PID, LID})::AbstractArray{GID}
Return list of global IDs assigned to the calling processor
JuliaPetra.uniqueGIDs
— Function.uniqueGIDs(map::BlockMap)::Bool
Return true if each map GID exists on at most 1 processor
JuliaPetra.sameBlockMapDataAs
— Function.sameBlockMapDataAs(this::BlockMap, other::BlockMap)::Bool
Return true if the maps have the same data
JuliaPetra.sameAs
— Function.sameAs(this::BlockMap, other::BlockMap)::Bool
Return true if this and other are identical maps
JuliaPetra.globalIndicesType
— Function.globalIndicesType(map::BlockMap{GID, PID, LID})::Type{GID}
Return the type used for global indices in the map
JuliaPetra.linearMap
— Function.linearMap(map::BlockMap)::Bool
Return true if the global ID space is contiguously divided (but not necessarily uniformly) across all processors
JuliaPetra.distributedGlobal
— Function.distributedGlobal(map::BlockMap)
Return true if map is defined across more than one processor
Returns true if this object is a distributed global
Directory
JuliaPetra.Directory
— Type.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
JuliaPetra.BasicDirectory
— Type.BasicDirectory(map::BlockMap)
Creates a BasicDirectory, which implements the methods of Directory with basic implmentations
JuliaPetra.getDirectoryEntries
— Function.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
- an Array of processors owning the global ID's in question
- an Array of local IDs of the global on the owning processor
JuliaPetra.gidsAllUniquelyOwned
— Function.gidsAllUniquelyOwned(directory)
Returns true if all GIDs appear on just one processor
JuliaPetra.createDirectory
— Function.createDirectory(comm::Comm, map::BlockMap)
Create a directory object for the given Map
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.
JuliaPetra.DistObject
— Type.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
JuliaPetra.SrcDistObject
— Type.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
JuliaPetra.CombineMode
— Type.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
JuliaPetra.getMap
— Function.getMap(::SrcDistObject)
getMap(::DistObject)
Gets the map of the indices of the object
JuliaPetra.checkSizes
— Function.checkSizes(source, target)::Bool
Compare the source and target objects for compatiblity. By default, returns false. Override this to allow transfering to/from subtypes
JuliaPetra.copyAndPermute
— Function.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.
JuliaPetra.packAndPrepare
— Function.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
JuliaPetra.unpackAndCombine
— Function.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