Zoltan2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | List of all members
Zoltan2::MappingSolution< Adapter > Class Template Reference

PartitionMapping maps a solution or an input distribution to ranks. More...

#include <Zoltan2_MappingSolution.hpp>

Inheritance diagram for Zoltan2::MappingSolution< Adapter >:
Inheritance graph
[legend]
Collaboration diagram for Zoltan2::MappingSolution< Adapter >:
Collaboration graph
[legend]

Public Types

typedef std::unordered_map
< lno_t, int > 
rankmap_t
 

Public Member Functions

 MappingSolution (const RCP< const Environment > &env, const RCP< const Comm< int > > &comm, const RCP< Algorithm< Adapter > > &algorithm=Teuchos::null)
 Constructor. More...
 
virtual ~MappingSolution ()
 
void getMyPartsView (part_t &numParts, part_t *&parts)
 Get the parts belonging to this rank. More...
 
int getRankForPart (part_t part)
 Get the rank containing a part. Simplifying assumption: a part is wholy assigned to a rank; it is not spread across ranks. More...
 
void setMap_PartsForRank (ArrayRCP< int > &idx, ArrayRCP< part_t > &parts)
 
void setMap_RankForLocalElements (ArrayRCP< int > &ranks)
 This is a mapping from local elements to ranks. More...
 
void setMap_RankForPart (ArrayRCP< part_t > &parts, ArrayRCP< int > &ranks)
 
void setMap_RankForPart (RCP< rankmap_t > &rankmap)
 
- Public Member Functions inherited from Zoltan2::PartitioningSolution< Adapter >
 PartitioningSolution (const RCP< const Environment > &env, const RCP< const Comm< int > > &comm, int nUserWeights, const RCP< Algorithm< Adapter > > &algorithm=Teuchos::null)
 Constructor when part sizes are not supplied. More...
 
 PartitioningSolution (const RCP< const Environment > &env, const RCP< const Comm< int > > &comm, int nUserWeights, ArrayView< ArrayRCP< part_t > > reqPartIds, ArrayView< ArrayRCP< scalar_t > > reqPartSizes, const RCP< Algorithm< Adapter > > &algorithm=Teuchos::null)
 Constructor when part sizes are supplied. More...
 
size_t getTargetGlobalNumberOfParts () const
 Returns the global number of parts desired in the solution. More...
 
size_t getActualGlobalNumberOfParts () const
 Returns the actual global number of parts provided in setParts(). More...
 
size_t getLocalNumberOfParts () const
 Returns the number of parts to be assigned to this process. More...
 
scalar_t getLocalFractionOfPart () const
 If parts are divided across processes, return the fraction of a part on this process. More...
 
bool oneToOnePartDistribution () const
 Is the part-to-process distribution is one-to-one. More...
 
const int * getPartDistribution () const
 Return a distribution by part. More...
 
const part_tgetProcDistribution () const
 Return a distribution by process. More...
 
int getNumberOfCriteria () const
 Get the number of criteria (object weights) More...
 
bool criteriaHasUniformPartSizes (int idx) const
 Determine if balancing criteria has uniform part sizes. (User can specify differing part sizes.) More...
 
scalar_t getCriteriaPartSize (int idx, part_t part) const
 Get the size for a given weight index and a given part. More...
 
bool criteriaHaveSamePartSizes (int c1, int c2) const
 Return true if the two weight indices have the same part size information. More...
 
void setParts (ArrayRCP< part_t > &partList)
 The algorithm uses setParts to set the solution. More...
 
void RemapParts ()
 Remap a new partition for maximum overlap with an input partition. More...
 
long measure_stays (part_t *remap, int *idx, part_t *adj, long *wgt, part_t nrhs, part_t nlhs)
 
const RCP< const Comm< int > > & getCommunicator () const
 Return the communicator associated with the solution. More...
 
const RCP< const Environment > & getEnvironment () const
 Return the environment associated with the solution. More...
 
const part_tgetPartListView () const
 Returns the part list corresponding to the global ID list. More...
 
const int * getProcListView () const
 Returns the process list corresponding to the global ID list. More...
 
virtual bool isPartitioningTreeBinary () const
 calculate if partition tree is binary. More...
 
void getPartitionTree (part_t &numTreeVerts, std::vector< part_t > &permPartNums, std::vector< part_t > &splitRangeBeg, std::vector< part_t > &splitRangeEnd, std::vector< part_t > &treeVertParents) const
 get the partition tree - fill the relevant arrays More...
 
std::vector
< Zoltan2::coordinateModelPartBox > & 
getPartBoxesView () const
 returns the part box boundary list. More...
 
part_t pointAssign (int dim, scalar_t *point) const
 Return the part overlapping a given point in space;. More...
 
void boxAssign (int dim, scalar_t *lower, scalar_t *upper, size_t &nPartsFound, part_t **partsFound) const
 Return an array of all parts overlapping a given box in space. More...
 
void getCommunicationGraph (ArrayRCP< part_t > &comXAdj, ArrayRCP< part_t > &comAdj) const
 returns communication graph resulting from geometric partitioning. More...
 
void getPartsForProc (int procId, double &numParts, part_t &partMin, part_t &partMax) const
 Get the parts belonging to a process. More...
 
void getProcsForPart (part_t partId, part_t &procMin, part_t &procMax) const
 Get the processes containing a part. More...
 
- Public Member Functions inherited from Zoltan2::Solution
virtual ~Solution ()
 

Detailed Description

template<typename Adapter>
class Zoltan2::MappingSolution< Adapter >

PartitionMapping maps a solution or an input distribution to ranks.

Definition at line 64 of file Zoltan2_MappingSolution.hpp.

Member Typedef Documentation

template<typename Adapter>
typedef std::unordered_map<lno_t, int> Zoltan2::MappingSolution< Adapter >::rankmap_t

Definition at line 88 of file Zoltan2_MappingSolution.hpp.

Constructor & Destructor Documentation

template<typename Adapter>
Zoltan2::MappingSolution< Adapter >::MappingSolution ( const RCP< const Environment > &  env,
const RCP< const Comm< int > > &  comm,
const RCP< Algorithm< Adapter > > &  algorithm = Teuchos::null 
)
inline

Constructor.

Definition at line 77 of file Zoltan2_MappingSolution.hpp.

template<typename Adapter>
virtual Zoltan2::MappingSolution< Adapter >::~MappingSolution ( )
inlinevirtual

Definition at line 86 of file Zoltan2_MappingSolution.hpp.

Member Function Documentation

template<typename Adapter>
void Zoltan2::MappingSolution< Adapter >::getMyPartsView ( part_t numParts,
part_t *&  parts 
)
inline

Get the parts belonging to this rank.

Parameters
numPartson return, set to the number of parts assigned to rank.
partson return, pointer (view) to the parts assigned to rank

Definition at line 94 of file Zoltan2_MappingSolution.hpp.

template<typename Adapter>
int Zoltan2::MappingSolution< Adapter >::getRankForPart ( part_t  part)
inline

Get the rank containing a part. Simplifying assumption: a part is wholy assigned to a rank; it is not spread across ranks.

Parameters
partId of the part whose rank is sought
Returns
rank to which part is assigned

Definition at line 152 of file Zoltan2_MappingSolution.hpp.

template<typename Adapter>
void Zoltan2::MappingSolution< Adapter >::setMap_PartsForRank ( ArrayRCP< int > &  idx,
ArrayRCP< part_t > &  parts 
)
inline

Definition at line 196 of file Zoltan2_MappingSolution.hpp.

template<typename Adapter>
void Zoltan2::MappingSolution< Adapter >::setMap_RankForLocalElements ( ArrayRCP< int > &  ranks)
inline

This is a mapping from local elements to ranks.

"parts" in the other functions should also mean the local elements, since we allow the direct mapping call with local elements as well. ranks[i] hold the mappend rank for local element i. Function will fail if part_t != int

Definition at line 223 of file Zoltan2_MappingSolution.hpp.

template<typename Adapter>
void Zoltan2::MappingSolution< Adapter >::setMap_RankForPart ( ArrayRCP< part_t > &  parts,
ArrayRCP< int > &  ranks 
)
inline

Definition at line 228 of file Zoltan2_MappingSolution.hpp.

template<typename Adapter>
void Zoltan2::MappingSolution< Adapter >::setMap_RankForPart ( RCP< rankmap_t > &  rankmap)
inline

Definition at line 243 of file Zoltan2_MappingSolution.hpp.


The documentation for this class was generated from the following file: