Zoltan2
Public Types | Public Member Functions
Zoltan2::PamgenMeshAdapter< User > Class Template Reference

This class represents a mesh. More...

#include <Zoltan2_PamgenMeshAdapter.hpp>

Inheritance diagram for Zoltan2::PamgenMeshAdapter< User >:
Inheritance graph
[legend]
Collaboration diagram for Zoltan2::PamgenMeshAdapter< 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 >::zgid_t zgid_t
typedef InputTraits< User >::part_t part_t
typedef InputTraits< User >::node_t node_t
typedef MeshAdapter< User > base_adapter_t
typedef User user_t

Public Member Functions

 PamgenMeshAdapter (const Comm< int > &comm, std::string typestr="region")
 Constructor for mesh with identifiers but no coordinates or edges.
void print (int)
size_t getLocalNumOf (MeshEntityType etype) const
 Returns the number of mesh entities on this process.
void getIDsViewOf (MeshEntityType etype, const zgid_t *&Ids) const
 Provide a pointer to this process' identifiers.
void getWeightsViewOf (MeshEntityType etype, const scalar_t *&weights, int &stride, int idx=0) const
 Provide a pointer to one of the number of this process' optional entity weights.
int getDimension () const
 Return dimension of the entity coordinates, if any.
void getCoordinatesViewOf (MeshEntityType etype, const scalar_t *&coords, int &stride, int dim) const
 Provide a pointer to one dimension of entity coordinates.
bool availAdjs (MeshEntityType source, MeshEntityType target) const
 Returns whether a first adjacency combination is available.
size_t getLocalNumAdjs (MeshEntityType source, MeshEntityType target) const
 Returns the number of first adjacencies on this process.
void getAdjsView (MeshEntityType source, MeshEntityType target, const lno_t *&offsets, const zgid_t *&adjacencyIds) const
bool avail2ndAdjs (MeshEntityType sourcetarget, MeshEntityType through) const
 Returns whether a second adjacency combination is available.
size_t getLocalNum2ndAdjs (MeshEntityType sourcetarget, MeshEntityType through) const
 Returns the number of second adjacencies on this process.
void get2ndAdjsView (MeshEntityType sourcetarget, MeshEntityType through, const lno_t *&offsets, const zgid_t *&adjacencyIds) const
enum BaseAdapterType adapterType () const
 Returns the type of adapter.
virtual int getNumWeightsPerOf (MeshEntityType etype) const
 Return the number of weights per entity.
virtual void getAdjsView (MeshEntityType source, MeshEntityType target, const lno_t *&offsets, const zgid_t *&adjacencyIds) const
 Sets pointers to this process' mesh first adjacencies.
virtual void get2ndAdjsView (MeshEntityType sourcetarget, MeshEntityType through, const lno_t *&offsets, const zgid_t *&adjacencyIds) const
 Sets pointers to this process' mesh second adjacencies.
virtual int getNumWeightsPer2ndAdj (MeshEntityType sourcetarget, MeshEntityType through) const
 Returns the number (0 or greater) of weights per second adjacency.
virtual void get2ndAdjWeightsView (MeshEntityType sourcetarget, MeshEntityType through, const scalar_t *&weights, int &stride, int idx) const
 Provide a pointer to the second adjacency weights, if any.
enum MeshEntityType getPrimaryEntityType () const
 Returns the entity to be partitioned, ordered, colored, etc.
enum MeshEntityType getAdjacencyEntityType () const
 Returns the entity that describes adjacencies between the entities to be partitioned, ordered, colored, etc. That is, a primaryEntityType that contains an adjacencyEntityType are adjacent. KDD: Is Adjacency a poorly chosen name here? Is it overloaded? VJL: Maybe.
enum MeshEntityType getSecondAdjacencyEntityType () const
 Returns the entity that describes second adjacencies between the entities to be partitioned, ordered, colored, etc. That is, two primaryEntityType that share a secondAdjacencyEntityType are adjacent.
void setEntityTypes (std::string ptypestr, std::string atypestr, std::string satypestr)
 Sets the primary, adjacency, and second adjacency entity types. Called by algorithm based on parameter values in parameter list from application. Also sets primaryEntityType, adjacencyEntityType, and secondAdjacencyEntityType to something reasonable: primaryEntityType not adjacencyEntityType or secondAdjacencyEntityType. KDD: Is Adjacency a poorly chosen name here? Is it overloaded? VJL: Maybe.
virtual bool useDegreeAsWeightOf (MeshEntityType etype, int idx) const
 Optional method allowing the idx-th weight of entity type etype to be set as the number of neighbors (the degree) of the entity Default is false; user can change in his MeshAdapter implementation.
size_t getLocalNumIDs () const
 Returns the number of objects on this process.
void getIDsView (const zgid_t *&Ids) const
 Provide a pointer to this process' identifiers.
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.
void getWeightsView (const scalar_t *&wgt, int &stride, int idx=0) const
 Provide pointer to a weight array with stride.
void getCoordinatesView (const scalar_t *&coords, int &stride, int coordDim) const
bool useDegreeAsWeight (int idx) const
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.
template<typename Adapter >
void applyPartitioningSolution (const User &in, User *&out, const PartitioningSolution< Adapter > &solution) const
 Apply a PartitioningSolution to an input.

Detailed Description

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

This class represents a mesh.

A mesh can be 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.

Definition at line 89 of file Zoltan2_PamgenMeshAdapter.hpp.


Member Typedef Documentation

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

Reimplemented from Zoltan2::BaseAdapter< User >.

Definition at line 93 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 94 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 95 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
typedef InputTraits<User>::zgid_t Zoltan2::PamgenMeshAdapter< User >::zgid_t

Reimplemented from Zoltan2::BaseAdapter< User >.

Definition at line 96 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Reimplemented from Zoltan2::BaseAdapter< User >.

Definition at line 97 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 98 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
typedef MeshAdapter<User> Zoltan2::PamgenMeshAdapter< User >::base_adapter_t

Definition at line 99 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 100 of file Zoltan2_PamgenMeshAdapter.hpp.


Constructor & Destructor Documentation

template<typename User >
Zoltan2::PamgenMeshAdapter< User >::PamgenMeshAdapter ( const Comm< int > &  comm,
std::string  typestr = "region" 
)

Constructor for mesh with identifiers but no coordinates or edges.

Parameters:
etypeis the mesh entity type of the identifiers

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

Definition at line 278 of file Zoltan2_PamgenMeshAdapter.hpp.


Member Function Documentation

template<typename User >
void Zoltan2::PamgenMeshAdapter< User >::print ( int  me)

Definition at line 704 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
size_t Zoltan2::PamgenMeshAdapter< User >::getLocalNumOf ( MeshEntityType  etype) const [inline, virtual]

Returns the number of mesh entities on this process.

Implements Zoltan2::MeshAdapter< User >.

Definition at line 118 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
void Zoltan2::PamgenMeshAdapter< User >::getIDsViewOf ( MeshEntityType  etype,
const zgid_t *&  Ids 
) const [inline, virtual]

Provide a pointer to this process' identifiers.

Parameters:
Idswill on return point to the list of the global Ids for this process.

Implements Zoltan2::MeshAdapter< User >.

Definition at line 132 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
void Zoltan2::PamgenMeshAdapter< User >::getWeightsViewOf ( MeshEntityType  etype,
const scalar_t *&  weights,
int &  stride,
int  idx = 0 
) const [inline, virtual]

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

Parameters:
weightson return will contain a list of the weights for the number specified.
strideon return will indicate the stride of the weights list.

The k'th weight is located at weights[stride*k].

Parameters:
idxis a value ranging from zero to one less than getNumWeightsPerEntityID()

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 146 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Return dimension of the entity coordinates, if any.

Some algorithms can partition mesh entities using geometric coordinate information

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

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 153 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
void Zoltan2::PamgenMeshAdapter< User >::getCoordinatesViewOf ( MeshEntityType  etype,
const scalar_t *&  coords,
int &  stride,
int  coordDim 
) const [inline, virtual]

Provide a pointer to one dimension of entity coordinates.

Parameters:
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].
coordDimis a value from 0 to one less than getEntityCoordinateDimension() specifying which dimension is being provided in the coords list.

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 155 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
bool Zoltan2::PamgenMeshAdapter< User >::availAdjs ( MeshEntityType  source,
MeshEntityType  target 
) const [inline, virtual]

Returns whether a first adjacency combination is available.

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 186 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
size_t Zoltan2::PamgenMeshAdapter< User >::getLocalNumAdjs ( MeshEntityType  source,
MeshEntityType  target 
) const [inline, virtual]

Returns the number of first adjacencies on this process.

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 195 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
void Zoltan2::PamgenMeshAdapter< User >::getAdjsView ( MeshEntityType  source,
MeshEntityType  target,
const lno_t *&  offsets,
const zgid_t *&  adjacencyIds 
) const [inline]

Definition at line 204 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
bool Zoltan2::PamgenMeshAdapter< User >::avail2ndAdjs ( MeshEntityType  sourcetarget,
MeshEntityType  through 
) const [inline, virtual]

Returns whether a second adjacency combination is available.

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 221 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
size_t Zoltan2::PamgenMeshAdapter< User >::getLocalNum2ndAdjs ( MeshEntityType  sourcetarget,
MeshEntityType  through 
) const [inline, virtual]

Returns the number of second adjacencies on this process.

Parameters will specify algorithm options: balance_entity_type==MeshEntityType, adjacency_through==MeshEntityType

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 230 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
void Zoltan2::PamgenMeshAdapter< User >::get2ndAdjsView ( MeshEntityType  sourcetarget,
MeshEntityType  through,
const lno_t *&  offsets,
const zgid_t *&  adjacencyIds 
) const [inline]

Definition at line 240 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User>
enum BaseAdapterType Zoltan2::MeshAdapter< User >::adapterType ( ) const [inline, virtual, inherited]

Returns the type of adapter.

Implements Zoltan2::BaseAdapter< User >.

Definition at line 130 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
virtual int Zoltan2::MeshAdapter< User >::getNumWeightsPerOf ( MeshEntityType  etype) const [inline, virtual, inherited]

Return the number of weights per entity.

Returns:
the count of weights, zero or more per entity. If the number of weights is zero, then we assume that the entities are equally weighted.

Definition at line 163 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
virtual void Zoltan2::MeshAdapter< User >::getAdjsView ( MeshEntityType  source,
MeshEntityType  target,
const lno_t *&  offsets,
const zgid_t *&  adjacencyIds 
) const [inline, virtual, inherited]

Sets pointers to this process' mesh first adjacencies.

Parameters:
source
offsetsis an array of size getLocalNumOf() + 1. The first adjacency Ids for Ids[i] (returned in getIDsViewOf()) begin at adjacencyIds[offsets[i]]. The last element of offsets is the size of the adjacencyIds array.
adjacencyIdson return will point to the global first adjacency Ids for each entity.

Definition at line 239 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
virtual void Zoltan2::MeshAdapter< User >::get2ndAdjsView ( MeshEntityType  sourcetarget,
MeshEntityType  through,
const lno_t *&  offsets,
const zgid_t *&  adjacencyIds 
) const [inline, virtual, inherited]

Sets pointers to this process' mesh second adjacencies.

Parameters:
sourcetarget
offsetsis an array of size getLocalNumOf() + 1. The second adjacency Ids for Ids[i] (returned in getIDsViewOf()) begin at adjacencyIds[offsets[i]]. The last element of offsets is the size of the adjacencyIds array.
adjacencyIdson return will point to the global second adjacency Ids for each entity.

Definition at line 274 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
virtual int Zoltan2::MeshAdapter< User >::getNumWeightsPer2ndAdj ( MeshEntityType  sourcetarget,
MeshEntityType  through 
) const [inline, virtual, inherited]

Returns the number (0 or greater) of weights per second adjacency.

Definition at line 287 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
virtual void Zoltan2::MeshAdapter< User >::get2ndAdjWeightsView ( MeshEntityType  sourcetarget,
MeshEntityType  through,
const scalar_t *&  weights,
int &  stride,
int  idx 
) const [inline, virtual, inherited]

Provide a pointer to the second adjacency weights, if any.

Parameters:
weightsis the list of weights of the given number for the second adjacencies returned in get2ndAdjsView().
strideThe k'th weight is located at weights[stride*k]
idxranges from zero to one less than getNumWeightsPer2ndAdj().

Definition at line 299 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
enum MeshEntityType Zoltan2::MeshAdapter< User >::getPrimaryEntityType ( ) const [inline, inherited]

Returns the entity to be partitioned, ordered, colored, etc.

Definition at line 319 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
enum MeshEntityType Zoltan2::MeshAdapter< User >::getAdjacencyEntityType ( ) const [inline, inherited]

Returns the entity that describes adjacencies between the entities to be partitioned, ordered, colored, etc. That is, a primaryEntityType that contains an adjacencyEntityType are adjacent. KDD: Is Adjacency a poorly chosen name here? Is it overloaded? VJL: Maybe.

Definition at line 330 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
enum MeshEntityType Zoltan2::MeshAdapter< User >::getSecondAdjacencyEntityType ( ) const [inline, inherited]

Returns the entity that describes second adjacencies between the entities to be partitioned, ordered, colored, etc. That is, two primaryEntityType that share a secondAdjacencyEntityType are adjacent.

Definition at line 339 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
void Zoltan2::MeshAdapter< User >::setEntityTypes ( std::string  ptypestr,
std::string  atypestr,
std::string  satypestr 
) [inline, inherited]

Sets the primary, adjacency, and second adjacency entity types. Called by algorithm based on parameter values in parameter list from application. Also sets primaryEntityType, adjacencyEntityType, and secondAdjacencyEntityType to something reasonable: primaryEntityType not adjacencyEntityType or secondAdjacencyEntityType. KDD: Is Adjacency a poorly chosen name here? Is it overloaded? VJL: Maybe.

Definition at line 351 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
virtual bool Zoltan2::MeshAdapter< User >::useDegreeAsWeightOf ( MeshEntityType  etype,
int  idx 
) const [inline, virtual, inherited]

Optional method allowing the idx-th weight of entity type etype to be set as the number of neighbors (the degree) of the entity Default is false; user can change in his MeshAdapter implementation.

Definition at line 417 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
size_t Zoltan2::MeshAdapter< User >::getLocalNumIDs ( ) const [inline, virtual, inherited]

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.

Implements Zoltan2::BaseAdapter< User >.

Definition at line 424 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
void Zoltan2::MeshAdapter< User >::getIDsView ( const zgid_t *&  Ids) const [inline, virtual, inherited]

Provide a pointer to this process' identifiers.

Parameters:
Idswill on return point to the list of the global Ids for this process.

Implements Zoltan2::BaseAdapter< User >.

Definition at line 428 of file Zoltan2_MeshAdapter.hpp.

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

Implements Zoltan2::BaseAdapter< User >.

Definition at line 432 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
void Zoltan2::MeshAdapter< User >::getWeightsView ( const scalar_t *&  wgt,
int &  stride,
int  idx = 0 
) const [inline, virtual, inherited]

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

Implements Zoltan2::BaseAdapter< User >.

Definition at line 436 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
void Zoltan2::MeshAdapter< User >::getCoordinatesView ( const scalar_t *&  coords,
int &  stride,
int  coordDim 
) const [inline, inherited]

Definition at line 440 of file Zoltan2_MeshAdapter.hpp.

template<typename User>
bool Zoltan2::MeshAdapter< User >::useDegreeAsWeight ( int  idx) const [inline, inherited]

Definition at line 446 of file Zoltan2_MeshAdapter.hpp.

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

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 148 of file Zoltan2_Adapter.hpp.

template<typename User>
template<typename Adapter >
void Zoltan2::BaseAdapter< User >::applyPartitioningSolution ( const 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 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.

Reimplemented in Zoltan2::XpetraCrsGraphAdapter< User, UserCoord >, Zoltan2::XpetraCrsMatrixAdapter< User, UserCoord >, Zoltan2::XpetraRowMatrixAdapter< User, UserCoord >, and Zoltan2::XpetraMultiVectorAdapter< User >.

Definition at line 174 of file Zoltan2_Adapter.hpp.


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