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

IdentifierInput defines the interface for identifiers. More...

#include <Zoltan2_IdentifierInput.hpp>

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

List of all members.

Public Member Functions

virtual ~IdentifierInput ()
 Destructor.
enum InputAdapterType inputAdapterType () const
 Returns the type of adapter.
virtual size_t getLocalNumberOfIdentifiers () const =0
 Return the number of identifiers on this process.
virtual int getNumberOfWeights () const =0
 Return the number of weights associated with each identifier. If the number of weights is zero, then we assume that the identifiers are equally weighted.
virtual size_t getIdentifierList (gid_t const *&Ids) const =0
 Provide a pointer to this process' identifiers.
virtual size_t getIdentifierWeights (int dimension, const scalar_t *&weights, int &stride) const =0
 Provide a pointer to one of the dimensions of this process' optional weights.
template<typename Adapter >
size_t applyPartitioningSolution (User &in, User *&out, const PartitioningSolution< Adapter > &solution) const
 Apply a PartitioningSolution 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::IdentifierInput< User >

IdentifierInput defines the interface for identifiers.

Zoltan2 can partition a simple list of weighted identifiers with no geometry or topology provided. IdentifierInput defines the interface for input adapters of this type.

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.

Definition at line 102 of file Zoltan2_IdentifierInput.hpp.


Constructor & Destructor Documentation

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

Destructor.

Definition at line 117 of file Zoltan2_IdentifierInput.hpp.


Member Function Documentation

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

Returns the type of adapter.

Implements Zoltan2::InputAdapter< User >.

Definition at line 123 of file Zoltan2_IdentifierInput.hpp.

template<typename User >
virtual size_t Zoltan2::IdentifierInput< User >::getLocalNumberOfIdentifiers ( ) const [pure virtual]

Return the number of identifiers on this process.

Implemented in Zoltan2::BasicIdentifierInput< User >.

template<typename User >
virtual int Zoltan2::IdentifierInput< User >::getNumberOfWeights ( ) const [pure virtual]

Return the number of weights associated with each identifier. If the number of weights is zero, then we assume that the identifiers are equally weighted.

Implemented in Zoltan2::BasicIdentifierInput< User >.

template<typename User >
virtual size_t Zoltan2::IdentifierInput< User >::getIdentifierList ( gid_t const *&  Ids) const [pure virtual]

Provide a pointer to this process' identifiers.

Parameters:
Idswill on return point to the list of the global Ids for this process.
Returns:
The number of ids in the Ids list.
template<typename User >
virtual size_t Zoltan2::IdentifierInput< User >::getIdentifierWeights ( int  dimension,
const scalar_t *&  weights,
int &  stride 
) const [pure virtual]

Provide a pointer to one of the dimensions of this process' optional weights.

Parameters:
dimensionis a value ranging from zero to one less than getNumberOfWeights()
weightson return will contain a list of the weights for the dimension specified. If weights for this dimension are to be uniform for all identifierse in the global problem, the weights should be a NULL pointer.
strideon return will indicate the stride of the weights list.

If stride is k then the weight corresponding to the identifier Ids[n] (returned in getIdentifierList) should be found at weights[k*n].

Returns:
The number of values in the weights list. This may be greater than the number of identifiers, because the stride may be greater than one.

Implemented in Zoltan2::BasicIdentifierInput< User >.

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

Apply a PartitioningSolution to an input.

This is not a required part of the IdentifierInput 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.

Definition at line 194 of file Zoltan2_IdentifierInput.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: