Public Member Functions
| ||PartitioningSolution (RCP< const Environment > &env, RCP< const Comm< int > > &comm, RCP< const IdentifierMap< user_t > > &idMap, int nUserWeights)|
| ||Constructor when part sizes are not supplied. |
| ||PartitioningSolution (RCP< const Environment > &env, RCP< const Comm< int > > &comm, RCP< const IdentifierMap< user_t > > &idMap, int nUserWeights, ArrayView< ArrayRCP< part_t > > reqPartIds, ArrayView< ArrayRCP< scalar_t > > reqPartSizes)|
| ||Constructor when part sizes are supplied. |
|size_t ||getTargetGlobalNumberOfParts () const |
| ||Returns the global number of parts desired in the solution. |
|size_t ||getActualGlobalNumberOfParts () const |
| ||Returns the actual global number of parts provided in setParts(). |
|size_t ||getLocalNumberOfParts () const |
| ||Returns the number of parts to be assigned to this process. |
|scalar_t ||getLocalFractionOfPart () const |
| ||If parts are divided across processes, return the fraction of a part on this process. |
|bool ||oneToOnePartDistribution () const |
| ||Is the part-to-process distribution is one-to-one. |
|const int * ||getPartDistribution () const |
| ||Return a distribution by part. |
|const part_t * ||getProcDistribution () const |
| ||Return a distribution by process. |
|int ||getNumberOfCriteria () const |
| ||Get the number of criteria (object weights) |
|bool ||criteriaHasUniformPartSizes (int idx) const |
| ||Determine if balancing criteria has uniform part sizes. (User can specify differing part sizes.) |
|scalar_t ||getCriteriaPartSize (int idx, part_t part) const |
| ||Get the size for a given weight index and a given part. |
|bool ||criteriaHaveSamePartSizes (int c1, int c2) const |
| ||Return true if the two weight indices have the same part size information. |
|void ||setParts (ArrayRCP< const gno_t > &gnoList, ArrayRCP< part_t > &partList, bool dataDidNotMove)|
| ||The algorithm uses setParts to set the solution. |
|void ||RemapParts ()|
| ||Remap a new partition for maximum overlap with an input partition. |
|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. |
|size_t ||getLocalNumberOfIds () const |
| ||Returns the local number of Ids. |
|const gid_t * ||getIdList () const |
| ||Returns the user's global ID list. |
|const part_t * ||getPartList () const |
| ||Returns the part list corresponding to the global ID list. |
|const int * ||getProcList () const |
| ||Returns the process list corresponding to the global ID list. |
|void ||setPartBoxes (RCP< std::vector< Zoltan2::coordinateModelPartBox< scalar_t, part_t > > > outPartBoxes)|
| ||set the Part Box boundaries as a result of geometric partitioning algorithm. |
< scalar_t, part_t > > >
| ||returns the part box boundary list. |
|void ||getCommunicationGraph (const Teuchos::Comm< int > *comm, ArrayRCP< part_t > &comXAdj, ArrayRCP< part_t > &comAdj)|
| ||returns the communication graph as a result of geometric partitioning algorithm. |
< scalar_t, part_t > > >
|getGlobalBoxBoundaries (const Teuchos::Comm< int > *comm)|
|template<typename Extra > |
|size_t ||convertSolutionToImportList (int numExtra, ArrayRCP< Extra > &xtraInfo, ArrayRCP< typename Adapter::gid_t > &imports, ArrayRCP< Extra > &newXtraInfo) const |
| ||Create an import list from the export list. |
|void ||getPartsForProc (int procId, double &numParts, part_t &partMin, part_t &partMax) const |
| ||Get the parts belonging to a process. |
|void ||getProcsForPart (part_t partId, part_t &procMin, part_t &procMax) const |
| ||Get the processes containing a part. |
class Zoltan2::PartitioningSolution< Adapter >
A PartitioningSolution is a solution to a partitioning problem.
It is initialized by a PartitioningProblem, written to by an algorithm, and may be read by the user or by a data migration routine in an input adapter.
Problem computes metrics using the Solution. Should Solution have a pointer to the metrics, since it may persist after the Problem is gone?
save an RCB tree, so it can be used in repartitioning, and supplied to the caller.
doxyfy the comments in this file.
Definition at line 123 of file Zoltan2_PartitioningSolution.hpp.
template<typename Adapter >
Constructor when part sizes are supplied.
The Solution constructor may require global communication. The rest of the Solution methods do not.
|env||the environment for the application |
|comm||the communicator for the problem associated with this solution |
|idMap||the IdentifierMap corresponding to the solution |
|nUserWeights||the number of weights supplied by the application |
|reqPartIds||reqPartIds[i] is a list of of part numbers for weight index i. |
|reqPartSizes||reqPartSizes[i] is the list of part sizes for weight i corresponding to parts in reqPartIds[i]|
reqPartSizes[i].size() are zero for all processes, it is assumed that part sizes for weight dimension "i" are uniform.
If across the application there are some part numbers that are not included in the reqPartIds lists, then those part sizes are assumed to be 1.0.
- handle errors that may arise - like duplicate part numbers
Definition at line 784 of file Zoltan2_PartitioningSolution.hpp.
template<typename Adapter >
template<typename Extra >
Create an import list from the export list.
|numExtra||The amount of related information of type |
Extra that you would like to associate with the data.
|xtraInfo||The extra information related to your global Ids. The information for the |
k-th global ID would begin at
xtraInfo[k*numExtra] and end before
|imports||on return is the list of global Ids assigned to this process under the Solution. |
|newXtraInfo||on return is the extra information associated with the global Ids in the import list.|
The list returned in getPartList() is an export list, detailing to which part each object should be moved. This method provides a new list, listing the global IDs of the objects to be imported to my part or parts.
Because this method does global communication, it can also send useful data related to the global IDs. For example, if the global IDs represent matrix rows, the extra data could be the number of non zeros in the row.
- A version which takes the export part numbers and returns the import part numbers in addition to the global IDs. Although this can be done with the extra data, it might be better to do it explicitly.
Definition at line 1636 of file Zoltan2_PartitioningSolution.hpp.
Get the parts belonging to a process.
|procId||a process rank |
|numParts||on return will be set the number of parts belonging to the process. |
|partMin||on return will be set to minimum part number |
|partMax||on return will be set to maximum part number|
numParts is at least one. But if there are more processes than parts, one of two things can happen. Either there are processes with no parts, and so
numParts will be zero, or a part may be split across more than one process, in which
numParts will be non-zero but less than 1.
In the latter case,
numParts is 1.0 divided by the number of processes that share the part.
Definition at line 595 of file Zoltan2_PartitioningSolution.hpp.