|
Zoltan2
Version of the Day
|
Provides access for Zoltan2 to Xpetra::CrsGraph data. More...
#include <Zoltan2_XpetraCrsGraphInput.hpp>


Public Member Functions | |
| ~XpetraCrsGraphInput () | |
| Destructor. More... | |
| XpetraCrsGraphInput (const RCP< const User > &ingraph) | |
| Constructor for graph with no weights or coordinates. More... | |
| XpetraCrsGraphInput (const RCP< const User > &ingraph, vector< const scalar_t * > &vWeights, vector< int > &vWeightStrides, vector< const scalar_t * > &eWeights, vector< int > &eWeightStrides) | |
| Constructor for graph with weights but no coordinates. More... | |
| XpetraCrsGraphInput (const RCP< const User > &ingraph, vector< const scalar_t * > &vWeights, vector< int > &vWeightStrides, vector< const scalar_t * > &eWeights, vector< int > &eWeightStrides, vector< const scalar_t * > &coords, vector< int > &coordStrides) | |
| Constructor for graph with weights and vertex coordinates. More... | |
| void | setVertexWeights (int dim, const scalar_t *val, int stride) |
| Provide a pointer to one dimension of the vertex weights. More... | |
| void | setEdgeWeights (int dim, const scalar_t *val, int stride) |
| Provide a pointer to one dimension of the edge weights. More... | |
| void | setVertexCoordinates (int dim, const scalar_t *val, int stride) |
| Provide a pointer to one dimension of the vertex coordinates. More... | |
| RCP< const xgraph_t > | getXpetraGraph () const |
| Access to Xpetra-wrapped user's graph. More... | |
| RCP< const User > | getUserGraph () const |
| Access to user's graph. More... | |
| string | inputAdapterName () const |
| Returns a descriptive name that identifies the concrete adapter. More... | |
| size_t | getLocalNumberOfObjects () const |
| Returns the number of objects in the input. More... | |
| int | getNumberOfWeightsPerObject () 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. More... | |
| size_t | getObjectWeights (int dim, const scalar_t *&wgt, int &stride) const |
| Provide pointer to a weight array with stride. More... | |
| size_t | getLocalNumberOfVertices () const |
| Returns the number vertices on this process. More... | |
| size_t | getLocalNumberOfEdges () const |
| Returns the number edges on this process. More... | |
| int | getVertexWeightDimension () const |
| Returns the dimension (0 or greater) of vertex weights. More... | |
| int | getEdgeWeightDimension () const |
| Returns the dimension (0 or greater) of edge weights. More... | |
| int | getCoordinateDimension () const |
| Returns the dimension of the geometry, if any. More... | |
| size_t | getVertexListView (const gid_t *&ids, const lno_t *&offsets, const gid_t *&edgeId) const |
| Sets pointers to this process' graph entries. More... | |
| size_t | getVertexWeights (int dim, const scalar_t *&weights, int &stride) const |
| Provide a pointer to the vertex weights, if any. More... | |
| size_t | getEdgeWeights (int dim, const scalar_t *&weights, int &stride) const |
| Provide a pointer to the edge weights, if any. More... | |
| size_t | getVertexCoordinates (int dim, const scalar_t *&coords, int &stride) const |
| Provide a pointer to one dimension of vertex coordinates. More... | |
| template<typename Adapter > | |
| size_t | applyPartitioningSolution (const User &in, User *&out, const PartitioningSolution< Adapter > &solution) const |
| Repartition a graph that has the same structure as the graph that instantiated this input adapter. More... | |
| enum InputAdapterType | inputAdapterType () const |
| Returns the type of adapter. More... | |
Static Public Member Functions | |
| static string | inputAdapterTypeName (InputAdapterType iaType) |
| Returns the name of the input adapter. More... | |
Provides access for Zoltan2 to Xpetra::CrsGraph data.
test for memory alloc failure when we resize a vector
we assume FillComplete has been called. Should we support objects that are not FillCompleted.
The template parameter is the user's input object:
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::CrsMatrix) have an inherent scalar type, and some (like Tpetra::CrsGraph) 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 84 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inline |
Destructor.
Definition at line 101 of file Zoltan2_XpetraCrsGraphInput.hpp.
| Zoltan2::XpetraCrsGraphInput< User >::XpetraCrsGraphInput | ( | const RCP< const User > & | ingraph | ) |
Constructor for graph with no weights or coordinates.
| ingraph | the Epetra_CrsGraph, Tpetra::CrsGraph or Xpetra::CrsGraph |
Most input adapters do not have RCPs in their interface. This one does because the user is obviously a Trilinos user.
Definition at line 409 of file Zoltan2_XpetraCrsGraphInput.hpp.
| Zoltan2::XpetraCrsGraphInput< User >::XpetraCrsGraphInput | ( | const RCP< const User > & | ingraph, |
| vector< const scalar_t * > & | vWeights, | ||
| vector< int > & | vWeightStrides, | ||
| vector< const scalar_t * > & | eWeights, | ||
| vector< int > & | eWeightStrides | ||
| ) |
Constructor for graph with weights but no coordinates.
| ingraph | the Epetra_CrsGraph, Tpetra::CrsGraph or Xpetra::CrsGraph |
| vWeights | a list of pointers to vertex weights. The number of weights per graph vertex is assumed to be vWeights.size(). |
| vWeightStrides | a list of strides for the vWeights. The weight for weight dimension n for vertex k should be found at vWeights[n][vWeightStrides[n] * k]. If vWeightStrides.size() is zero, it is assumed all strides are one. |
| eWeights | a list of pointers to edge weights. The number of weights per edge is assumed to be eWeights.size(). |
| eWeightStrides | a list of strides for the eWeights. The weight for weight dimension n for edge k should be found at eWeights[n][eWeightStrides[n] * k]. If eWeightStrides.size() is zero, it is assumed all strides are one. |
The order of the vertex weights should match the order that vertices appear in the input data structure.
The order of the edge weights should follow the order that the the vertices and edges appear in the input data structure.
By vertex:
Then by vertex neighbor:
Most input adapters do not have RCPs in their interface. This one does because the user is obviously a Trilinos user.
Definition at line 425 of file Zoltan2_XpetraCrsGraphInput.hpp.
| Zoltan2::XpetraCrsGraphInput< User >::XpetraCrsGraphInput | ( | const RCP< const User > & | ingraph, |
| vector< const scalar_t * > & | vWeights, | ||
| vector< int > & | vWeightStrides, | ||
| vector< const scalar_t * > & | eWeights, | ||
| vector< int > & | eWeightStrides, | ||
| vector< const scalar_t * > & | coords, | ||
| vector< int > & | coordStrides | ||
| ) |
Constructor for graph with weights and vertex coordinates.
| ingraph | the Epetra_CrsGraph, Tpetra::CrsGraph or Xpetra::CrsGraph |
| vWeights | a list of pointers to vertex weights. The number of weights per graph vertex is assumed to be vWeights.size(). |
| vWeightStrides | a list of strides for the vWeights. The weight for weight dimension n for vertex k should be found at vWeights[n][vWeightStrides[n] * k]. If vWeightStrides.size() is zero, it is assumed all strides are one. |
| eWeights | a list of pointers to edge weights. The number of weights per edge is assumed to be eWeights.size(). |
| eWeightStrides | a list of strides for the eWeights. The weight for weight dimension n for edge k should be found at eWeights[n][eWeightStrides[n] * k]. If eWeightStrides.size() is zero, it is assumed all strides are one. |
| coords | a list of pointers to vertex coordinates. The coordinate dimension is assumed to be coords.size(). |
| coordStrides | a list of strides for the coords. The coordinate for dimension n for vertex k should be found at coords[n][coordStrides[n] * k]. If coordStrides.size() is zero, it is assumed all strides are one. |
The order of the vertex weights and coordinates should coorespond to the order that vertices appear in the input data structure.
The order of the edge weights should follow the order that the the vertices and edges appear in the input data structure.
By vertex:
Then by vertex neighbor:
Most input adapters do not have RCPs in their interface. This one does because the user is obviously a Trilinos user.
Definition at line 443 of file Zoltan2_XpetraCrsGraphInput.hpp.
| void Zoltan2::XpetraCrsGraphInput< User >::setVertexWeights | ( | int | dim, |
| const scalar_t * | val, | ||
| int | stride | ||
| ) |
Provide a pointer to one dimension of the vertex weights.
| dim | A number from 0 to one less than vertex weight dimension specified in the constructor. |
| val | A pointer to the weights for dimension dim. |
| stride | A stride for the val array. If is k, then val[n * k] is the weight for the n th vertex for dimension . |
The order of the vertex weights should match the order that vertices appear in the input data structure.
| void Zoltan2::XpetraCrsGraphInput< User >::setEdgeWeights | ( | int | dim, |
| const scalar_t * | val, | ||
| int | stride | ||
| ) |
Provide a pointer to one dimension of the edge weights.
| dim | A number from 0 to one less than edge weight dimension specified in the constructor. |
| val | A pointer to the weights for dimension dim. |
| stride | A stride for the val array. If is k, then val[n * k] is the weight for the n th edge for dimension . |
The order of the edge weights should follow the order that the the vertices and edges appear in the input data structure.
By vertex:
Then by vertex neighbor:
| void Zoltan2::XpetraCrsGraphInput< User >::setVertexCoordinates | ( | int | dim, |
| const scalar_t * | val, | ||
| int | stride | ||
| ) |
Provide a pointer to one dimension of the vertex coordinates.
| dim | A number from 0 to one less than vertex coordinate dimension specified in the constructor. |
| val | A pointer to the coordinates for dimension dim. |
| stride | A stride for the val array. If is k, then val[n * k] is the coordinate for the n th vertex. |
The order of the vertex coordinates should coorespond to the order that vertices appear in the input data structure.
|
inline |
Access to Xpetra-wrapped user's graph.
Definition at line 267 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inline |
Access to user's graph.
Definition at line 274 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Returns a descriptive name that identifies the concrete adapter.
Implements Zoltan2::InputAdapter< User >.
Definition at line 283 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Returns the number of objects in the input.
Objects may be coordinates, graph vertices, matrix rows, etc. They are the objects to be partitioned, ordered, or colored.
Implements Zoltan2::InputAdapter< User >.
Definition at line 285 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
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::InputAdapter< User >.
Definition at line 287 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Provide pointer to a weight array with stride.
| dim | the weight dimension, zero or greater |
| wgt | on return a pointer to the weights for this dimension |
| stride | on return, the value such that the nth weight should be found at wgt[n*stride] . |
wgt array, which should be at least equal to getLocalNumberOfObjects() * stride . Implements Zoltan2::InputAdapter< User >.
Definition at line 289 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Returns the number vertices on this process.
Implements Zoltan2::GraphInput< User >.
Definition at line 298 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Returns the number edges on this process.
Implements Zoltan2::GraphInput< User >.
Definition at line 302 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Returns the dimension (0 or greater) of vertex weights.
Implements Zoltan2::GraphInput< User >.
Definition at line 306 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Returns the dimension (0 or greater) of edge weights.
Implements Zoltan2::GraphInput< User >.
Definition at line 310 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Returns the dimension of the geometry, if any.
Some algorithms can use geometric vertex coordinate information if it is present.
Implements Zoltan2::GraphInput< User >.
Definition at line 314 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Sets pointers to this process' graph entries.
| vertexIds | will on return a pointer to vertex global Ids |
| offsets | is an array of size numVertices + 1. The edge Ids for vertexId[i] begin at edgeIds[offsets[i]]. The last element of offsets is the size of the edgeIds array. |
| edgeIds | on return will point to the global edge Ids for for each vertex. |
Zoltan2 does not copy your data. The data pointed to by vertexIds, offsets and edgeIds must remain valid for the lifetime of this InputAdapter.
Implements Zoltan2::GraphInput< User >.
Definition at line 318 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Provide a pointer to the vertex weights, if any.
| weightDim | ranges from zero to one less than getVertexWeightDimension(). |
| weights | is the list of weights of the given dimension for the vertices returned in getVertexListView(). If weights for this dimension are to be uniform for all vertices in the global problem, the weights should be a NULL pointer. |
| stride | The k'th weight is located at weights[stride*k] |
Zoltan2 does not copy your data. The data pointed to by weights must remain valid for the lifetime of this InputAdapter.
Implements Zoltan2::GraphInput< User >.
Definition at line 334 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Provide a pointer to the edge weights, if any.
| weightDim | ranges from zero to one less than getEdgeWeightDimension(). |
| weights | is the list of weights of the given dimension for the edges returned in getVertexListView(). |
| stride | The k'th weight is located at weights[stride*k] |
Zoltan2 does not copy your data. The data pointed to by weights must remain valid for the lifetime of this InputAdapter.
Implements Zoltan2::GraphInput< User >.
Definition at line 345 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtual |
Provide a pointer to one dimension of vertex coordinates.
| coordDim | is a value from 0 to one less than getCoordinateDimension() specifying which dimension is being provided in the coords list. |
| coords | points to a list of coordinate values for the dimension. |
| stride | describes the layout of the coordinate values in the coords list. If stride is one, then the ith coordinate value is coords[i], but if stride is two, then the ith coordinate value is coords[2*i]. |
coords list. This may be more than getLocalNumberOfVertices() because the stride may be more than one.Zoltan2 does not copy your data. The data pointed to by coords must remain valid for the lifetime of this InputAdapter.
Implements Zoltan2::GraphInput< User >.
Definition at line 356 of file Zoltan2_XpetraCrsGraphInput.hpp.
| size_t Zoltan2::XpetraCrsGraphInput< User >::applyPartitioningSolution | ( | const User & | in, |
| User *& | out, | ||
| const PartitioningSolution< Adapter > & | solution | ||
| ) | const |
Repartition a graph that has the same structure as the graph that instantiated this input adapter.
Definition at line 540 of file Zoltan2_XpetraCrsGraphInput.hpp.
|
inlinevirtualinherited |
Returns the type of adapter.
Implements Zoltan2::InputAdapter< User >.
Definition at line 111 of file Zoltan2_GraphInput.hpp.
|
staticinherited |
Returns the name of the input adapter.
Definition at line 134 of file Zoltan2_InputAdapter.hpp.
1.8.11