|
Zoltan2
|
Provides access for Zoltan2 to Xpetra::RowMatrix data. More...
#include <Zoltan2_XpetraRowMatrixAdapter.hpp>


Public Types | |
| typedef InputTraits< User >::zgid_t | zgid_t |
| typedef InputTraits< User > ::scalar_t | scalar_t |
| typedef InputTraits< User >::part_t | part_t |
Public Member Functions | |
| ~XpetraRowMatrixAdapter () | |
| Destructor. | |
| XpetraRowMatrixAdapter (const RCP< const User > &inmatrix, int numWeightsPerRow=0) | |
| Constructor. | |
| void | setWeights (const scalar_t *weightVal, int stride, int idx=0) |
| Specify a weight for each entity of the primaryEntityType. | |
| void | setRowWeights (const scalar_t *weightVal, int stride, int idx=0) |
| Specify a weight for each row. | |
| void | setWeightIsDegree (int idx) |
| Specify an index for which the weight should be the degree of the entity. | |
| void | setRowWeightIsNumberOfNonZeros (int idx) |
| Specify an index for which the row weight should be the global number of nonzeros in the row. | |
| size_t | getLocalNumRows () const |
| Returns the number of rows on this process. | |
| size_t | getLocalNumColumns () const |
| Returns the number of columns on this process. | |
| size_t | getLocalNumEntries () const |
| Returns the number of nonzeros on this process. | |
| bool | CRSViewAvailable () const |
| Indicates whether the MatrixAdapter implements a view of the matrix in compressed sparse row (CRS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required. | |
| void | getRowIDsView (const zgid_t *&rowIds) const |
| Sets pointer to this process' rows' global IDs. | |
| void | getCRSView (const lno_t *&offsets, const zgid_t *&colIds) const |
| Sets pointers to this process' matrix entries using compressed sparse row (CRS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required. | |
| void | getCRSView (const lno_t *&offsets, const zgid_t *&colIds, const scalar_t *&values) const |
| Sets pointers to this process' matrix entries and their values using compressed sparse row (CRS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required. | |
| int | getNumWeightsPerRow () const |
| Returns the number of weights per row (0 or greater). Row weights may be used when partitioning matrix rows. | |
| void | getRowWeightsView (const scalar_t *&weights, int &stride, int idx=0) const |
| Provide a pointer to the row weights, if any. | |
| bool | useNumNonzerosAsRowWeight (int idx) const |
| Indicate whether row weight with index idx should be the global number of nonzeros in the row. | |
| template<typename Adapter > | |
| void | applyPartitioningSolution (const User &in, User *&out, const PartitioningSolution< Adapter > &solution) const |
| Apply a PartitioningSolution to an input. | |
| enum BaseAdapterType | adapterType () const |
| Returns the type of adapter. | |
| virtual bool | CCSViewAvailable () const |
| Indicates whether the MatrixAdapter implements a view of the matrix in compressed sparse column (CCS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required. | |
| virtual void | getColumnIDsView (const zgid_t *&colIds) const |
| Sets pointer to this process' columns' global IDs. | |
| virtual void | getCCSView (const lno_t *&offsets, const zgid_t *&rowIds) const |
| Sets pointers to this process' matrix entries using compressed sparse column (CCS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required. | |
| virtual void | getCCSView (const lno_t *&offsets, const zgid_t *&rowIds, const scalar_t *&values) const |
| Sets pointers to this process' matrix entries and their values using compressed sparse column (CCS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required. | |
| virtual int | getNumWeightsPerColumn () const |
| Returns the number of weights per column (0 or greater). Column weights may be used when partitioning matrix columns. | |
| virtual void | getColumnWeightsView (const scalar_t *&weights, int &stride, int idx=0) const |
| Provide a pointer to the column weights, if any. | |
| virtual bool | useNumNonzerosAsColumnWeight (int idx) const |
| Indicate whether column weight with index idx should be the global number of nonzeros in the column. | |
| void | setCoordinateInput (VectorAdapter< UserCoord > *coordData) |
| Allow user to provide additional data that contains coordinate info associated with the MatrixAdapter's primaryEntityType. Associated data must have the same parallel distribution and ordering of entries as the primaryEntityType. | |
| bool | coordinatesAvailable () const |
| Indicate whether coordinate information has been set for this MatrixAdapter. | |
| VectorAdapter< UserCoord > * | getCoordinateInput () const |
| Obtain the coordinate data registered by the user. | |
| enum MatrixEntityType | getPrimaryEntityType () const |
| Returns the entity to be partitioned, ordered, colored, etc. Valid values are MATRIX_ROW, MATRIX_COLUMN, MATRIX_NONZERO. | |
| void | setPrimaryEntityType (std::string typestr) |
| Sets the primary entity type. Called by algorithm based on parameter value in parameter list from application. Also sets to adjacencyEntityType to something reasonable: opposite of primaryEntityType. | |
| size_t | getLocalNumIDs () const |
| Returns the number of objects on this process. | |
| void | getIDsView (const zgid_t *&Ids) const |
| Provide a pointer to this process' identifiers. | |
| int | getNumWeightsPerID () const |
| Returns the number of weights per object. Number of weights per object should be zero or greater. If zero, then it is assumed that all objects are equally weighted. | |
| void | getWeightsView (const scalar_t *&wgt, int &stride, int idx=0) const |
| Provide pointer to a weight array with stride. | |
| bool | useDegreeAsWeight (int idx) const |
| void | getPartsView (const part_t *&inputPart) const |
| Provide pointer to an array containing the input part assignment for each ID. The input part information may be used for re-partitioning to reduce data movement, or for mapping parts to processes. Adapters may return NULL for this pointer (the default behavior); if NULL is returned, algorithms will assume the rank. | |
Provides access for Zoltan2 to Xpetra::RowMatrix data.
we assume FillComplete has been called. We should support objects that are not FillCompleted.
add RowMatrix
The scalar_t type, representing use data such as matrix values, is used by Zoltan2 for weights, coordinates, part sizes and quality metrics. Some User types (like Tpetra::RowMatrix) have an inherent scalar type, and some (like Tpetra::RowGraph) do not. For such objects, the scalar type is set by Zoltan2 to float. If you wish to change it to double, set the second template parameter to double.
Definition at line 80 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
typedef InputTraits<User>::zgid_t Zoltan2::BaseAdapter< User >::zgid_t [inherited] |
Reimplemented in Zoltan2::PamgenMeshAdapter< User >, and Zoltan2::BasicIdentifierAdapter< User >.
Definition at line 97 of file Zoltan2_Adapter.hpp.
typedef InputTraits<User>::scalar_t Zoltan2::BaseAdapter< User >::scalar_t [inherited] |
Reimplemented in Zoltan2::PamgenMeshAdapter< User >, and Zoltan2::BasicIdentifierAdapter< User >.
Definition at line 98 of file Zoltan2_Adapter.hpp.
typedef InputTraits<User>::part_t Zoltan2::BaseAdapter< User >::part_t [inherited] |
Reimplemented in Zoltan2::PamgenMeshAdapter< User >, and Zoltan2::BasicIdentifierAdapter< User >.
Definition at line 100 of file Zoltan2_Adapter.hpp.
| Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::~XpetraRowMatrixAdapter | ( | ) | [inline] |
Destructor.
Definition at line 98 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::XpetraRowMatrixAdapter | ( | const RCP< const User > & | inmatrix, |
| int | numWeightsPerRow = 0 |
||
| ) |
Constructor.
| inmatrix | The users Epetra, Tpetra, or Xpetra RowMatrix object |
| numWeightsPerRow | If row weights will be provided in setRowWeights(), the set numWeightsPerRow to the number of weights per row. |
Definition at line 235 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| void Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::setWeights | ( | const scalar_t * | weightVal, |
| int | stride, | ||
| int | idx = 0 |
||
| ) |
Specify a weight for each entity of the primaryEntityType.
| weightVal | A pointer to the weights for this index. A stride to be used in reading the values. The index idx weight for entity should be found at weightVal[k*stride]. |
| idx | A value between zero and one less that the numWeightsPerRow argument to the constructor. |
The order of weights should correspond to the order of the primary entity type; see, e.g., setRowWeights below.
Definition at line 282 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| void Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::setRowWeights | ( | const scalar_t * | weightVal, |
| int | stride, | ||
| int | idx = 0 |
||
| ) |
Specify a weight for each row.
| weightVal | A pointer to the weights for this index. A stride to be used in reading the values. The index idx weight for row should be found at weightVal[k*stride]. |
| idx | A value between zero and one less that the numWeightsPerRow argument to the constructor. |
The order of weights should correspond to the order of rows returned by
theMatrix->getRowMap()->getNodeElementList();
Definition at line 300 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| void Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::setWeightIsDegree | ( | int | idx | ) |
Specify an index for which the weight should be the degree of the entity.
| idx | Zoltan2 will use the entity's degree as the entity weight for index idx. |
Definition at line 314 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| void Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::setRowWeightIsNumberOfNonZeros | ( | int | idx | ) |
Specify an index for which the row weight should be the global number of nonzeros in the row.
| idx | Zoltan2 will use the global number of nonzeros in a row as the row weight for index idx. |
Definition at line 331 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| size_t Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::getLocalNumRows | ( | ) | const [inline, virtual] |
Returns the number of rows on this process.
Implements Zoltan2::MatrixAdapter< User, UserCoord >.
Definition at line 157 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| size_t Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::getLocalNumColumns | ( | ) | const [inline, virtual] |
Returns the number of columns on this process.
Implements Zoltan2::MatrixAdapter< User, UserCoord >.
Definition at line 161 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| size_t Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::getLocalNumEntries | ( | ) | const [inline, virtual] |
Returns the number of nonzeros on this process.
Implements Zoltan2::MatrixAdapter< User, UserCoord >.
Definition at line 165 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| bool Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::CRSViewAvailable | ( | ) | const [inline, virtual] |
Indicates whether the MatrixAdapter implements a view of the matrix in compressed sparse row (CRS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required.
Reimplemented from Zoltan2::MatrixAdapter< User, UserCoord >.
Definition at line 169 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| void Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::getRowIDsView | ( | const zgid_t *& | rowIds | ) | const [inline, virtual] |
Sets pointer to this process' rows' global IDs.
| rowIds | will on return a pointer to row global Ids |
Reimplemented from Zoltan2::MatrixAdapter< User, UserCoord >.
Definition at line 171 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| void Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::getCRSView | ( | const lno_t *& | offsets, |
| const zgid_t *& | colIds | ||
| ) | const [inline, virtual] |
Sets pointers to this process' matrix entries using compressed sparse row (CRS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required.
| offsets | is an array of size numRows + 1. The column Ids for rowIds[i] (returned by getRowIDsView) begin at colIds[offsets[i]]. The last element of offsets is the size of the colIds array. |
| colIds | on return will point to the global column Ids for the non-zeros for each row. |
Reimplemented from Zoltan2::MatrixAdapter< User, UserCoord >.
Definition at line 177 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| void Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::getCRSView | ( | const lno_t *& | offsets, |
| const zgid_t *& | colIds, | ||
| const scalar_t *& | values | ||
| ) | const [inline, virtual] |
Sets pointers to this process' matrix entries and their values using compressed sparse row (CRS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required.
| offsets | is an array of size numRows + 1. The column Ids for rowIds[i] (returned by getRowIDsView) begin at colIds[offsets[i]]. The last element of offsets is the size of the colIds array. |
| colIds | on return will point to the global column Ids for the non-zeros for each row. |
| values | on return will point to the values stored in the non-zeros for each row. |
Reimplemented from Zoltan2::MatrixAdapter< User, UserCoord >.
Definition at line 183 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| int Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::getNumWeightsPerRow | ( | ) | const [inline, virtual] |
Returns the number of weights per row (0 or greater). Row weights may be used when partitioning matrix rows.
Reimplemented from Zoltan2::MatrixAdapter< User, UserCoord >.
Definition at line 192 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| void Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::getRowWeightsView | ( | const scalar_t *& | weights, |
| int & | stride, | ||
| int | idx = 0 |
||
| ) | const [inline, virtual] |
Provide a pointer to the row weights, if any.
| weights | is the list of weights with a given index for the rows returned in getRowIDsView(). |
| stride | The k'th weight is located at weights[stride*k] |
| idx | ranges from zero to one less than getNumWeightsPerRow(). |
Reimplemented from Zoltan2::MatrixAdapter< User, UserCoord >.
Definition at line 194 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| bool Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::useNumNonzerosAsRowWeight | ( | int | idx | ) | const [inline, virtual] |
Indicate whether row weight with index idx should be the global number of nonzeros in the row.
Reimplemented from Zoltan2::MatrixAdapter< User, UserCoord >.
Definition at line 204 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| void Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >::applyPartitioningSolution | ( | const User & | in, |
| User *& | out, | ||
| const PartitioningSolution< Adapter > & | solution | ||
| ) | const |
Apply a PartitioningSolution to an input.
This is not a required part of the InputAdapter interface. However if the Caller calls a Problem method to redistribute data, it needs this method to perform the redistribution.
| in | An input object with a structure and assignment of of global Ids to processes that matches that of the input data that instantiated this Adapter. |
| out | On return this should point to a newly created object with the specified partitioning. |
| solution | The Solution object created by a Problem should be supplied as the third argument. It must have been templated on user data that has the same global ID distribution as this user data. |
Reimplemented from Zoltan2::BaseAdapter< User >.
Definition at line 344 of file Zoltan2_XpetraRowMatrixAdapter.hpp.
| enum BaseAdapterType Zoltan2::MatrixAdapter< User, UserCoord >::adapterType | ( | ) | const [inline, virtual, inherited] |
Returns the type of adapter.
Implements Zoltan2::BaseAdapter< User >.
Definition at line 129 of file Zoltan2_MatrixAdapter.hpp.
| virtual bool Zoltan2::MatrixAdapter< User, UserCoord >::CCSViewAvailable | ( | ) | const [inline, virtual, inherited] |
Indicates whether the MatrixAdapter implements a view of the matrix in compressed sparse column (CCS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required.
Definition at line 248 of file Zoltan2_MatrixAdapter.hpp.
| virtual void Zoltan2::MatrixAdapter< User, UserCoord >::getColumnIDsView | ( | const zgid_t *& | colIds | ) | const [inline, virtual, inherited] |
Sets pointer to this process' columns' global IDs.
| colIds | will on return a pointer to column global Ids |
Definition at line 253 of file Zoltan2_MatrixAdapter.hpp.
| virtual void Zoltan2::MatrixAdapter< User, UserCoord >::getCCSView | ( | const lno_t *& | offsets, |
| const zgid_t *& | rowIds | ||
| ) | const [inline, virtual, inherited] |
Sets pointers to this process' matrix entries using compressed sparse column (CCS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required.
| offsets | is an array of size numCols + 1. The row Ids for colIds[i] (returned by getColumnIDsView) begin at rowIds[offsets[i]]. The last element of offsets is the size of the rowIds array. |
| rowIds | on return will point to the global row Ids for the non-zeros for each column. |
Definition at line 270 of file Zoltan2_MatrixAdapter.hpp.
| virtual void Zoltan2::MatrixAdapter< User, UserCoord >::getCCSView | ( | const lno_t *& | offsets, |
| const zgid_t *& | rowIds, | ||
| const scalar_t *& | values | ||
| ) | const [inline, virtual, inherited] |
Sets pointers to this process' matrix entries and their values using compressed sparse column (CCS) format. All matrix adapters must implement either getCRSView or getCCSView, but implementation of both is not required.
| offsets | is an array of size numCols + 1. The row Ids for colIds[i] (returned by getColumnIDsView) begin at rowIds[offsets[i]]. The last element of offsets is the size of the rowIds array. |
| rowIds | on return will point to the global row Ids for the non-zeros for each column. |
| values | on return will point to the values stored in the non-zeros for each column. |
Definition at line 293 of file Zoltan2_MatrixAdapter.hpp.
| virtual int Zoltan2::MatrixAdapter< User, UserCoord >::getNumWeightsPerColumn | ( | ) | const [inline, virtual, inherited] |
Returns the number of weights per column (0 or greater). Column weights may be used when partitioning matrix columns.
Definition at line 307 of file Zoltan2_MatrixAdapter.hpp.
| virtual void Zoltan2::MatrixAdapter< User, UserCoord >::getColumnWeightsView | ( | const scalar_t *& | weights, |
| int & | stride, | ||
| int | idx = 0 |
||
| ) | const [inline, virtual, inherited] |
Provide a pointer to the column weights, if any.
| weights | is the list of weights with a given index for the columns returned in getColumnIDsView(). |
| stride | The k'th weight is located at weights[stride*k] |
| idx | ranges from zero to one less than getNumWeightsPerColumn(). |
Definition at line 315 of file Zoltan2_MatrixAdapter.hpp.
| virtual bool Zoltan2::MatrixAdapter< User, UserCoord >::useNumNonzerosAsColumnWeight | ( | int | idx | ) | const [inline, virtual, inherited] |
Indicate whether column weight with index idx should be the global number of nonzeros in the column.
Definition at line 327 of file Zoltan2_MatrixAdapter.hpp.
| void Zoltan2::MatrixAdapter< User, UserCoord >::setCoordinateInput | ( | VectorAdapter< UserCoord > * | coordData | ) | [inline, inherited] |
Allow user to provide additional data that contains coordinate info associated with the MatrixAdapter's primaryEntityType. Associated data must have the same parallel distribution and ordering of entries as the primaryEntityType.
| coordData | is a pointer to a VectorAdapter with the user's coordinate data. |
Definition at line 345 of file Zoltan2_MatrixAdapter.hpp.
| bool Zoltan2::MatrixAdapter< User, UserCoord >::coordinatesAvailable | ( | ) | const [inline, inherited] |
Indicate whether coordinate information has been set for this MatrixAdapter.
Definition at line 354 of file Zoltan2_MatrixAdapter.hpp.
| VectorAdapter<UserCoord>* Zoltan2::MatrixAdapter< User, UserCoord >::getCoordinateInput | ( | ) | const [inline, inherited] |
Obtain the coordinate data registered by the user.
Definition at line 359 of file Zoltan2_MatrixAdapter.hpp.
| enum MatrixEntityType Zoltan2::MatrixAdapter< User, UserCoord >::getPrimaryEntityType | ( | ) | const [inline, inherited] |
Returns the entity to be partitioned, ordered, colored, etc. Valid values are MATRIX_ROW, MATRIX_COLUMN, MATRIX_NONZERO.
Definition at line 370 of file Zoltan2_MatrixAdapter.hpp.
| void Zoltan2::MatrixAdapter< User, UserCoord >::setPrimaryEntityType | ( | std::string | typestr | ) | [inline, inherited] |
Sets the primary entity type. Called by algorithm based on parameter value in parameter list from application. Also sets to adjacencyEntityType to something reasonable: opposite of primaryEntityType.
Definition at line 380 of file Zoltan2_MatrixAdapter.hpp.
| size_t Zoltan2::MatrixAdapter< User, UserCoord >::getLocalNumIDs | ( | ) | const [inline, virtual, inherited] |
Returns the number of objects on this process.
Objects may be coordinates, graph vertices, matrix rows, etc. They are the objects to be partitioned, ordered, or colored.
Implements Zoltan2::BaseAdapter< User >.
Definition at line 401 of file Zoltan2_MatrixAdapter.hpp.
| void Zoltan2::MatrixAdapter< User, UserCoord >::getIDsView | ( | const zgid_t *& | Ids | ) | const [inline, virtual, inherited] |
Provide a pointer to this process' identifiers.
| Ids | will on return point to the list of the global Ids for this process. |
Implements Zoltan2::BaseAdapter< User >.
Definition at line 415 of file Zoltan2_MatrixAdapter.hpp.
| int Zoltan2::MatrixAdapter< User, UserCoord >::getNumWeightsPerID | ( | ) | const [inline, virtual, inherited] |
Returns the number of weights per object. Number of weights per object should be zero or greater. If zero, then it is assumed that all objects are equally weighted.
Implements Zoltan2::BaseAdapter< User >.
Definition at line 439 of file Zoltan2_MatrixAdapter.hpp.
| void Zoltan2::MatrixAdapter< User, UserCoord >::getWeightsView | ( | const scalar_t *& | wgt, |
| int & | stride, | ||
| int | idx = 0 |
||
| ) | const [inline, virtual, inherited] |
Provide pointer to a weight array with stride.
| wgt | on return a pointer to the weights for this idx |
| stride | on return, the value such that the nth weight should be found at wgt[n*stride] . |
| idx | the weight index, zero or greater |
Implements Zoltan2::BaseAdapter< User >.
Definition at line 453 of file Zoltan2_MatrixAdapter.hpp.
| bool Zoltan2::MatrixAdapter< User, UserCoord >::useDegreeAsWeight | ( | int | idx | ) | const [inline, inherited] |
Definition at line 478 of file Zoltan2_MatrixAdapter.hpp.
| void Zoltan2::BaseAdapter< User >::getPartsView | ( | const part_t *& | inputPart | ) | const [inline, inherited] |
Provide pointer to an array containing the input part assignment for each ID. The input part information may be used for re-partitioning to reduce data movement, or for mapping parts to processes. Adapters may return NULL for this pointer (the default behavior); if NULL is returned, algorithms will assume the rank.
| inputPart | on return a pointer to input part numbers |
Definition at line 148 of file Zoltan2_Adapter.hpp.
1.7.6.1