Zoltan2 Version of the Day
Public Member Functions | Static Public Member Functions
Zoltan2::GraphInput< User > Class Template Reference

GraphInput defines the interface for graph input adapters. More...

#include <Zoltan2_GraphInput.hpp>

Inheritance diagram for Zoltan2::GraphInput< User >:
Inheritance graph
[legend]
Collaboration diagram for Zoltan2::GraphInput< User >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

enum InputAdapterType inputAdapterType () const
 Returns the type of adapter.
virtual ~GraphInput ()
 Destructor.
virtual size_t getLocalNumberOfVertices () const =0
 Returns the number vertices on this process.
virtual size_t getLocalNumberOfEdges () const =0
 Returns the number edges on this process.
virtual int getVertexWeightDimension () const =0
 Returns the dimension (0 or greater) of vertex weights.
virtual int getEdgeWeightDimension () const =0
 Returns the dimension (0 or greater) of edge weights.
virtual int getCoordinateDimension () const =0
 Returns the dimension of the geometry, if any.
virtual size_t getVertexListView (const gid_t *&vertexIds, const lno_t *&offsets, const gid_t *&edgeIds) const =0
 Sets pointers to this process' graph entries.
virtual size_t getVertexWeights (int weightDim, const scalar_t *&weights, int &stride) const =0
 Provide a pointer to the vertex weights, if any.
virtual size_t getEdgeWeights (int weightDim, const scalar_t *&weights, int &stride) const =0
 Provide a pointer to the edge weights, if any.
virtual size_t getVertexCoordinates (int coordDim, const scalar_t *&coords, int &stride) const =0
 Provide a pointer to one dimension of vertex coordinates.
template<typename Adapter >
size_t applyPartitioningSolution (const User &in, User *&out, const PartitioningSolution< Adapter > &solution) const
 Apply a partitioning problem solution to an input.
virtual string inputAdapterName () const =0
 Returns a descriptive name that identifies the concrete adapter.
virtual size_t getLocalNumberOfObjects () const =0
 Returns the number of objects in the input.
virtual int getNumberOfWeightsPerObject () const =0
 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.
virtual size_t getObjectWeights (int dim, const scalar_t *&wgt, int &stride) const =0
 Provide pointer to a weight array with stride.

Static Public Member Functions

static string inputAdapterTypeName (InputAdapterType iaType)
 Returns the name of the input adapter.

Detailed Description

template<typename User>
class Zoltan2::GraphInput< User >

GraphInput defines the interface for graph input adapters.

InputAdapter objects provide access for Zoltan2 to the user's data. Many built-in adapters are already defined for common data structures, such as Tpetra and Epetra objects and C-language pointers to arrays.

Data types:

See IdentifierTraits to understand why the user's global ID type (gid_t) may differ from that used by Zoltan2 (gno_t).

The Kokkos node type can be safely ignored.

The template parameter User is a user-defined data type which, through a traits mechanism, provides the actual data types with which the Zoltan2 library will be compiled. User may be the actual class or structure used by application to represent a vector, or it may be the helper class BasicUserTypes. See InputTraits for more information.

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.

Todo:
Create BasicCrsGraphInput subclass.

Definition at line 97 of file Zoltan2_GraphInput.hpp.


Constructor & Destructor Documentation

template<typename User >
virtual Zoltan2::GraphInput< User >::~GraphInput ( ) [inline, virtual]

Destructor.

Definition at line 115 of file Zoltan2_GraphInput.hpp.


Member Function Documentation

template<typename User >
enum InputAdapterType Zoltan2::GraphInput< User >::inputAdapterType ( ) const [inline, virtual]

Returns the type of adapter.

Implements Zoltan2::InputAdapter< User >.

Definition at line 111 of file Zoltan2_GraphInput.hpp.

template<typename User >
virtual size_t Zoltan2::GraphInput< User >::getLocalNumberOfVertices ( ) const [pure virtual]

Returns the number vertices on this process.

Implemented in Zoltan2::XpetraCrsGraphInput< User >.

template<typename User >
virtual size_t Zoltan2::GraphInput< User >::getLocalNumberOfEdges ( ) const [pure virtual]

Returns the number edges on this process.

Implemented in Zoltan2::XpetraCrsGraphInput< User >.

template<typename User >
virtual int Zoltan2::GraphInput< User >::getVertexWeightDimension ( ) const [pure virtual]

Returns the dimension (0 or greater) of vertex weights.

Implemented in Zoltan2::XpetraCrsGraphInput< User >.

template<typename User >
virtual int Zoltan2::GraphInput< User >::getEdgeWeightDimension ( ) const [pure virtual]

Returns the dimension (0 or greater) of edge weights.

Implemented in Zoltan2::XpetraCrsGraphInput< User >.

template<typename User >
virtual int Zoltan2::GraphInput< User >::getCoordinateDimension ( ) const [pure virtual]

Returns the dimension of the geometry, if any.

Some algorithms can use geometric vertex coordinate information if it is present.

Implemented in Zoltan2::XpetraCrsGraphInput< User >.

template<typename User >
virtual size_t Zoltan2::GraphInput< User >::getVertexListView ( const gid_t *&  vertexIds,
const lno_t *&  offsets,
const gid_t *&  edgeIds 
) const [pure virtual]

Sets pointers to this process' graph entries.

Parameters:
vertexIdswill on return a pointer to vertex global Ids
offsetsis 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.
edgeIdson return will point to the global edge Ids for for each vertex.
Returns:
The number of ids in the vertexIds list.

Zoltan2 does not copy your data. The data pointed to by vertexIds, offsets and edgeIds must remain valid for the lifetime of this InputAdapter.

Implemented in Zoltan2::XpetraCrsGraphInput< User >.

template<typename User >
virtual size_t Zoltan2::GraphInput< User >::getVertexWeights ( int  weightDim,
const scalar_t *&  weights,
int &  stride 
) const [pure virtual]

Provide a pointer to the vertex weights, if any.

Parameters:
weightDimranges from zero to one less than getVertexWeightDimension().
weightsis 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.
strideThe k'th weight is located at weights[stride*k]
Returns:
The number of weights listed, which should be at least the local number of vertices times the stride for non-uniform weights, zero otherwise.

Zoltan2 does not copy your data. The data pointed to by weights must remain valid for the lifetime of this InputAdapter.

Implemented in Zoltan2::XpetraCrsGraphInput< User >.

template<typename User >
virtual size_t Zoltan2::GraphInput< User >::getEdgeWeights ( int  weightDim,
const scalar_t *&  weights,
int &  stride 
) const [pure virtual]

Provide a pointer to the edge weights, if any.

Parameters:
weightDimranges from zero to one less than getEdgeWeightDimension().
weightsis the list of weights of the given dimension for the edges returned in getVertexListView().
strideThe k'th weight is located at weights[stride*k]
Returns:
The number of weights listed, which should be the same as the number of edges in getVertexListView().

Zoltan2 does not copy your data. The data pointed to by weights must remain valid for the lifetime of this InputAdapter.

Implemented in Zoltan2::XpetraCrsGraphInput< User >.

template<typename User >
virtual size_t Zoltan2::GraphInput< User >::getVertexCoordinates ( int  coordDim,
const scalar_t *&  coords,
int &  stride 
) const [pure virtual]

Provide a pointer to one dimension of vertex coordinates.

Parameters:
coordDimis a value from 0 to one less than getCoordinateDimension() specifying which dimension is being provided in the coords list.
coordspoints to a list of coordinate values for the dimension.
stridedescribes 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].
Returns:
The length of the 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.

Implemented in Zoltan2::XpetraCrsGraphInput< User >.

template<typename User >
template<typename Adapter >
size_t Zoltan2::GraphInput< User >::applyPartitioningSolution ( const User &  in,
User *&  out,
const PartitioningSolution< Adapter > &  solution 
) const [inline]

Apply a partitioning problem solution to an input.

This is not a required part of the GraphInput interface. However if the Caller calls a Problem method to redistribute data, it needs this method to perform the redistribution.

Parameters:
inAn input object with a structure and assignment of of global Ids to processes that matches that of the input data that instantiated this InputAdapter.
outOn return this should point to a newly created object with the specified partitioning.
solutionThe 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.
Returns:
Returns the number of local Ids in the new partitioning.

Reimplemented in Zoltan2::XpetraCrsGraphInput< User >.

Definition at line 236 of file Zoltan2_GraphInput.hpp.

template<typename User >
virtual string Zoltan2::InputAdapter< User >::inputAdapterName ( ) const [pure virtual, inherited]
template<typename User >
virtual size_t Zoltan2::InputAdapter< User >::getLocalNumberOfObjects ( ) const [pure virtual, inherited]

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.

Implemented in Zoltan2::BasicCoordinateInput< User >, Zoltan2::BasicIdentifierInput< User >, Zoltan2::BasicVectorInput< User >, Zoltan2::XpetraCrsGraphInput< User >, Zoltan2::XpetraCrsMatrixInput< User >, Zoltan2::XpetraMultiVectorInput< User >, Zoltan2::XpetraRowMatrixInput< User >, and Zoltan2::XpetraVectorInput< User >.

template<typename User >
virtual int Zoltan2::InputAdapter< User >::getNumberOfWeightsPerObject ( ) const [pure 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.

Implemented in Zoltan2::BasicCoordinateInput< User >, Zoltan2::BasicIdentifierInput< User >, Zoltan2::BasicVectorInput< User >, Zoltan2::XpetraCrsGraphInput< User >, Zoltan2::XpetraCrsMatrixInput< User >, Zoltan2::XpetraMultiVectorInput< User >, Zoltan2::XpetraRowMatrixInput< User >, and Zoltan2::XpetraVectorInput< User >.

template<typename User >
virtual size_t Zoltan2::InputAdapter< User >::getObjectWeights ( int  dim,
const scalar_t *&  wgt,
int &  stride 
) const [pure virtual, inherited]

Provide pointer to a weight array with stride.

Parameters:
dimthe weight dimension, zero or greater
wgton return a pointer to the weights for this dimension
strideon return, the value such that the nth weight should be found at wgt[n*stride] .
Returns:
the length of the wgt array, which should be at least equal to getLocalNumberOfObjects() * stride .

Implemented in Zoltan2::BasicCoordinateInput< User >, Zoltan2::BasicIdentifierInput< User >, Zoltan2::BasicVectorInput< User >, Zoltan2::XpetraCrsGraphInput< User >, Zoltan2::XpetraCrsMatrixInput< User >, Zoltan2::XpetraMultiVectorInput< User >, Zoltan2::XpetraRowMatrixInput< User >, and Zoltan2::XpetraVectorInput< User >.

template<typename User >
string Zoltan2::InputAdapter< User >::inputAdapterTypeName ( InputAdapterType  iaType) [static, inherited]

Returns the name of the input adapter.

Definition at line 134 of file Zoltan2_InputAdapter.hpp.


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