Zoltan2
Public Types | Public Member Functions | List of all members
Zoltan2::BaseAdapter< User > Class Template Referenceabstract

BaseAdapter defines methods required by all Adapters. More...

#include <Zoltan2_Adapter.hpp>

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

Public Types

typedef InputTraits< User >::lno_t lno_t
 
typedef InputTraits< User >::gno_t gno_t
 
typedef InputTraits< User >::scalar_t scalar_t
 
typedef InputTraits< User >::part_t part_t
 

Public Member Functions

virtual enum BaseAdapterType adapterType () const =0
 Returns the type of adapter. More...
 
virtual ~BaseAdapter ()
 Destructor. More...
 
virtual size_t getLocalNumIDs () const =0
 Returns the number of objects on this process. More...
 
virtual void getIDsView (const gno_t *&Ids) const =0
 Provide a pointer to this process' identifiers. More...
 
virtual 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. Default is zero weights per ID. More...
 
virtual void getWeightsView (const scalar_t *&wgt, int &stride, int idx=0) const
 Provide pointer to a weight array with stride. More...
 
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. More...
 
template<typename Adapter >
void applyPartitioningSolution (const User &in, User *&out, const PartitioningSolution< Adapter > &solution) const
 Apply a PartitioningSolution to an input. More...
 

Detailed Description

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

BaseAdapter defines methods required by all Adapters.

Adapters provide access from Zoltan2 to the user's data. The methods in the interface must be defined by users. Many built-in adapters are already defined for common data structures, such as Tpetra and Epetra objects and C-language pointers to arrays.

Definition at line 82 of file Zoltan2_Adapter.hpp.

Member Typedef Documentation

◆ lno_t

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

Definition at line 85 of file Zoltan2_Adapter.hpp.

◆ gno_t

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

Definition at line 86 of file Zoltan2_Adapter.hpp.

◆ scalar_t

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

Definition at line 87 of file Zoltan2_Adapter.hpp.

◆ part_t

template<typename User>
typedef InputTraits<User>::part_t Zoltan2::BaseAdapter< User >::part_t

Definition at line 88 of file Zoltan2_Adapter.hpp.

Constructor & Destructor Documentation

◆ ~BaseAdapter()

template<typename User>
virtual Zoltan2::BaseAdapter< User >::~BaseAdapter ( )
inlinevirtual

Destructor.

Definition at line 96 of file Zoltan2_Adapter.hpp.

Member Function Documentation

◆ adapterType()

template<typename User>
virtual enum BaseAdapterType Zoltan2::BaseAdapter< User >::adapterType ( ) const
pure virtual

◆ getLocalNumIDs()

template<typename User>
virtual size_t Zoltan2::BaseAdapter< User >::getLocalNumIDs ( ) const
pure virtual

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.

Implemented in Zoltan2::MeshAdapter< User >, Zoltan2::MatrixAdapter< User, UserCoord >, Zoltan2::GraphAdapter< User, UserCoord >, Zoltan2::BasicVectorAdapter< User >, VerySimpleVectorAdapter< User >, Zoltan2::XpetraMultiVectorAdapter< User >, and Zoltan2::BasicIdentifierAdapter< User >.

◆ getIDsView()

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getIDsView ( const gno_t *&  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.

Implemented in Zoltan2::MeshAdapter< User >, Zoltan2::MatrixAdapter< User, UserCoord >, Zoltan2::GraphAdapter< User, UserCoord >, Zoltan2::BasicVectorAdapter< User >, Zoltan2::XpetraMultiVectorAdapter< User >, and Zoltan2::BasicIdentifierAdapter< User >.

◆ getNumWeightsPerID()

template<typename User>
virtual int Zoltan2::BaseAdapter< User >::getNumWeightsPerID ( ) const
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. Default is zero weights per ID.

Reimplemented in Zoltan2::MeshAdapter< User >, Zoltan2::MatrixAdapter< User, UserCoord >, Zoltan2::GraphAdapter< User, UserCoord >, Zoltan2::BasicVectorAdapter< User >, Zoltan2::XpetraMultiVectorAdapter< User >, and Zoltan2::BasicIdentifierAdapter< User >.

Definition at line 117 of file Zoltan2_Adapter.hpp.

◆ getWeightsView()

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getWeightsView ( const scalar_t *&  wgt,
int &  stride,
int  idx = 0 
) const
inlinevirtual

Provide pointer to a weight array with stride.

Parameters
wgton return a pointer to the weights for this idx
strideon return, the value such that the nth weight should be found at wgt[n*stride] .
idxthe weight index, zero or greater This function must be implemented in derived adapter if getNumWeightsPerID > 0. This function should not be called if getNumWeightsPerID is zero.

Reimplemented in Zoltan2::MeshAdapter< User >, Zoltan2::MatrixAdapter< User, UserCoord >, Zoltan2::GraphAdapter< User, UserCoord >, and Zoltan2::BasicIdentifierAdapter< User >.

Definition at line 128 of file Zoltan2_Adapter.hpp.

◆ getPartsView()

template<typename User>
void Zoltan2::BaseAdapter< User >::getPartsView ( const part_t *&  inputPart) const
inline

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.

Parameters
inputParton return a pointer to input part numbers

Definition at line 143 of file Zoltan2_Adapter.hpp.

◆ applyPartitioningSolution()

template<typename User>
template<typename Adapter >
void Zoltan2::BaseAdapter< User >::applyPartitioningSolution ( const User &  in,
User *&  out,
const PartitioningSolution< Adapter > &  solution 
) const
inline

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.

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 Adapter.
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 partition.

Definition at line 169 of file Zoltan2_Adapter.hpp.


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