|
Zoltan2
|
A PartitioningSolution is a solution to a partitioning problem. More...
#include <Zoltan2_MatrixPartitioningSolution.hpp>


Public Member Functions | |
| MatrixPartitioningSolution (const RCP< const Environment > &env, const RCP< const Comm< int > > &comm, const RCP< Algorithm< Adapter > > &algorithm=Teuchos::null) | |
| Constructor when part sizes are not supplied. More... | |
| void | setIDLists (ArrayRCP< part_t > &rowIDs, ArrayRCP< part_t > &colIDs, ArrayRCP< part_t > &domainIDs, ArrayRCP< part_t > &rangeIDs) |
| The algorithm uses setIDLists to set the solution. More... | |
| const RCP< const Comm< int > > & | getCommunicator () const |
| Remap a new partition for maximum overlap with an input partition. More... | |
| const RCP< const Environment > & | getEnvironment () const |
| Return the environment associated with the solution. More... | |
| const gno_t * | getRowIdsView () const |
| Returns list of global row IDs of the nonzeros owned by this process. More... | |
| const gno_t * | getColIdsView () const |
| Returns list of global column IDs of the nonzeros owned by this process. More... | |
Public Member Functions inherited from Zoltan2::Solution | |
| virtual | ~Solution () |
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.
Definition at line 86 of file Zoltan2_MatrixPartitioningSolution.hpp.
| Zoltan2::MatrixPartitioningSolution< Adapter >::MatrixPartitioningSolution | ( | const RCP< const Environment > & | env, |
| const RCP< const Comm< int > > & | comm, | ||
| const RCP< Algorithm< Adapter > > & | algorithm = Teuchos::null |
||
| ) |
Constructor when part sizes are not 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 |
| algorithm | Algorithm, if any, used to compute the solution. |
It is possible that part sizes were supplied on other processes, so this constructor does do a check to see if part sizes need to be globally calculated.
Definition at line 314 of file Zoltan2_MatrixPartitioningSolution.hpp.
| void Zoltan2::MatrixPartitioningSolution< Adapter >::setIDLists | ( | ArrayRCP< part_t > & | rowIDs, |
| ArrayRCP< part_t > & | colIDs, | ||
| ArrayRCP< part_t > & | domainIDs, | ||
| ArrayRCP< part_t > & | rangeIDs | ||
| ) |
The algorithm uses setIDLists to set the solution.
| rowIDs | List of row numbers that the nonzeros for this processor contain. |
| colIDs | List of column numbers that the nonzeros for this processor contain. |
| domainIDs | Domain vector Ids assigned to this process |
| rangeIDs | Range vector Ids assigned to this process |
Definition at line 326 of file Zoltan2_MatrixPartitioningSolution.hpp.
|
inline |
Remap a new partition for maximum overlap with an input partition.
Assumptions for this version: input part assignment == processor rank for every local object. assuming nGlobalParts <= num ranks TODO: Write a version that takes the input part number as input; this change requires input parts in adapters to be provided in the Adapter. TODO: For repartitioning, compare to old remapping results; see Zoltan1. /
void RemapParts();
//////////////////////////////////////////////////////////////////// /* Return the weight of objects staying with a given remap. If remap is NULL, compute weight of objects staying with given partition / long measure_stays(part_t *remap, int *idx, part_t *adj, long *wgt, part_t nrhs, part_t nlhs) { long staying = 0; for (part_t i = 0; i < nrhs; i++) { part_t k = (remap ? remap[i] : i); for (part_t j = idx[k]; j < idx[k+1]; j++) { if (i == (adj[j]-nlhs)) { staying += wgt[j]; break; } } } return staying; }
////////////////////////////////////////////////////////////////// Results that may be queried by the user, by migration methods, or by metric calculation methods. We return raw pointers so users don't have to learn about our pointer wrappers.
/*! Return the communicator associated with the solution.
Definition at line 186 of file Zoltan2_MatrixPartitioningSolution.hpp.
|
inline |
Return the environment associated with the solution.
Definition at line 190 of file Zoltan2_MatrixPartitioningSolution.hpp.
|
inline |
Returns list of global row IDs of the nonzeros owned by this process.
Definition at line 195 of file Zoltan2_MatrixPartitioningSolution.hpp.
|
inline |
Returns list of global column IDs of the nonzeros owned by this process.
Definition at line 206 of file Zoltan2_MatrixPartitioningSolution.hpp.