Zoltan 2 Version 0.5
Public Types | Public Member Functions | Static Public Member Functions
Zoltan2::BasicIdentifierInput< User > Class Template Reference

This class represents a collection of global Identifiers and their associated weights, if any. More...

#include <Zoltan2_BasicIdentifierInput.hpp>

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

List of all members.

Public Types

typedef InputTraits< User >
::scalar_t 
scalar_t
typedef InputTraits< User >::lno_t lno_t
typedef InputTraits< User >::gno_t gno_t
typedef InputTraits< User >::gid_t gid_t
typedef InputTraits< User >::node_t node_t
typedef IdentifierInput< User > base_adapter_t
typedef User user_t

Public Member Functions

 BasicIdentifierInput (lno_t numIds, const gid_t *idPtr, vector< const scalar_t * > &weights, vector< int > &weightStrides)
 Constructor.
string inputAdapterName () const
 Returns a descriptive name that identifies the concrete adapter.
size_t getLocalNumberOfObjects () const
 Returns the number of objects in the input.
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.
size_t getObjectWeights (int dim, const scalar_t *&wgt, int &stride) const
 Provide pointer to a weight array with stride.
size_t getLocalNumberOfIdentifiers () const
 Return the number of identifiers on this process.
int getNumberOfWeights () const
 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.
size_t getIdentifierList (const gid_t *&Ids) const
size_t getIdentifierWeights (int dimension, const scalar_t *&weights, int &stride) const
 Provide a pointer to one of the dimensions of this process' optional weights.
enum InputAdapterType inputAdapterType () const
 Returns the type of adapter.
virtual size_t getIdentifierList (gid_t const *&Ids) const =0
 Provide a pointer to this process' identifiers.
template<typename Adapter >
size_t applyPartitioningSolution (User &in, User *&out, const PartitioningSolution< Adapter > &solution) const
 Apply a PartitioningSolution to an input.

Static Public Member Functions

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

Detailed Description

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

This class represents a collection of global Identifiers and their associated weights, if any.

The user supplies the identifiers and weights by way of pointers to arrays.

The template parameter (User) is a C++ class type which provides the actual data types with which the Zoltan2 library will be compiled, through a Traits mechanism. User may be the actual class used by application to represent coordinates, or it may be the empty helper class BasicUserTypes with which a Zoltan2 user can easily supply the data types for the library.

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.

Examples:

block.cpp.

Definition at line 83 of file Zoltan2_BasicIdentifierInput.hpp.


Member Typedef Documentation

template<typename User>
typedef InputTraits<User>::scalar_t Zoltan2::BasicIdentifierInput< User >::scalar_t

Reimplemented from Zoltan2::InputAdapter< User >.

Definition at line 87 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
typedef InputTraits<User>::lno_t Zoltan2::BasicIdentifierInput< User >::lno_t

Definition at line 88 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
typedef InputTraits<User>::gno_t Zoltan2::BasicIdentifierInput< User >::gno_t

Definition at line 89 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
typedef InputTraits<User>::gid_t Zoltan2::BasicIdentifierInput< User >::gid_t

Definition at line 90 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
typedef InputTraits<User>::node_t Zoltan2::BasicIdentifierInput< User >::node_t

Definition at line 91 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
typedef IdentifierInput<User> Zoltan2::BasicIdentifierInput< User >::base_adapter_t

Definition at line 92 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
typedef User Zoltan2::BasicIdentifierInput< User >::user_t

Definition at line 93 of file Zoltan2_BasicIdentifierInput.hpp.


Constructor & Destructor Documentation

template<typename User >
Zoltan2::BasicIdentifierInput< User >::BasicIdentifierInput ( lno_t  numIds,
const gid_t idPtr,
vector< const scalar_t * > &  weights,
vector< int > &  weightStrides 
)

Constructor.

Parameters:
numIdsis the number of identifiers in the list
idsshould point to a list of numIds identifiers.
weightsa list of pointers to arrays of weights. The number of weights per identifier is assumed to be weights.size().
weightStridesa list of strides for the weights. The weight for weight dimension n for ids[k] should be found at weights[n][weightStrides[n] * k]. If weightStrides.size() is zero, it is assumed all strides are one.

The values pointed to the arguments must remain valid for the lifetime of this InputAdapter.

Definition at line 167 of file Zoltan2_BasicIdentifierInput.hpp.


Member Function Documentation

template<typename User>
string Zoltan2::BasicIdentifierInput< User >::inputAdapterName ( ) const [inline, virtual]

Returns a descriptive name that identifies the concrete adapter.

Implements Zoltan2::InputAdapter< User >.

Definition at line 117 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
size_t Zoltan2::BasicIdentifierInput< User >::getLocalNumberOfObjects ( ) const [inline, virtual]

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 119 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
int Zoltan2::BasicIdentifierInput< User >::getNumberOfWeightsPerObject ( ) const [inline, virtual]

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 121 of file Zoltan2_BasicIdentifierInput.hpp.

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

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 .

Implements Zoltan2::InputAdapter< User >.

Definition at line 123 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
size_t Zoltan2::BasicIdentifierInput< User >::getLocalNumberOfIdentifiers ( ) const [inline, virtual]

Return the number of identifiers on this process.

Implements Zoltan2::IdentifierInput< User >.

Definition at line 133 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
int Zoltan2::BasicIdentifierInput< User >::getNumberOfWeights ( ) const [inline, 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.

Implements Zoltan2::IdentifierInput< User >.

Definition at line 135 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
size_t Zoltan2::BasicIdentifierInput< User >::getIdentifierList ( const gid_t *&  Ids) const [inline]

Definition at line 137 of file Zoltan2_BasicIdentifierInput.hpp.

template<typename User>
size_t Zoltan2::BasicIdentifierInput< User >::getIdentifierWeights ( int  dimension,
const scalar_t *&  weights,
int &  stride 
) const [inline, 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.

Implements Zoltan2::IdentifierInput< User >.

Definition at line 143 of file Zoltan2_BasicIdentifierInput.hpp.

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

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 >::getIdentifierList ( gid_t const *&  Ids) const [pure virtual, inherited]

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 >
template<typename Adapter >
size_t Zoltan2::IdentifierInput< User >::applyPartitioningSolution ( User &  in,
User *&  out,
const PartitioningSolution< Adapter > &  solution 
) const [inline, inherited]

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 >
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: