Zoltan2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | List of all members
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]

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 >
::offset_t 
offset_t
 
typedef InputTraits< User >::part_t part_t
 
typedef InputTraits< User >::node_t node_t
 
typedef User user_t
 
typedef std::map< gno_t, gno_tMapType
 
- Public Types inherited from Zoltan2::AdapterWithCoords< User >
using scalar_t = typename BaseAdapter< User >::scalar_t
 
using device_t = typename BaseAdapter< User >::node_t::device_type
 
using host_t = typename Kokkos::HostSpace::memory_space
 
using CoordsDeviceView = Kokkos::View< scalar_t **, Kokkos::LayoutLeft, device_t >
 
using CoordsHostView = typename CoordsDeviceView::HostMirror
 
- Public Types inherited from Zoltan2::BaseAdapter< User >
using lno_t = typename InputTraits< User >::lno_t
 
using gno_t = typename InputTraits< User >::gno_t
 
using scalar_t = typename InputTraits< User >::scalar_t
 
using node_t = typename InputTraits< User >::node_t
 
using part_t = typename InputTraits< User >::part_t
 
using offset_t = typename InputTraits< User >::offset_t
 
using host_t = typename Kokkos::HostSpace::memory_space
 
using device_t = typename node_t::device_type
 
using ConstIdsDeviceView = Kokkos::View< const gno_t *, device_t >
 
using ConstIdsHostView = typename ConstIdsDeviceView::HostMirror
 
using IdsDeviceView = Kokkos::View< gno_t *, device_t >
 
using IdsHostView = typename IdsDeviceView::HostMirror
 
using ConstOffsetsDeviceView = Kokkos::View< const offset_t *, device_t >
 
using ConstOffsetsHostView = typename ConstOffsetsDeviceView::HostMirror
 
using OffsetsDeviceView = Kokkos::View< offset_t *, device_t >
 
using OffsetsHostView = typename OffsetsDeviceView::HostMirror
 
using ConstScalarsDeviceView = Kokkos::View< const scalar_t *, device_t >
 
using ConstScalarsHostView = typename ConstScalarsDeviceView::HostMirror
 
using ScalarsDeviceView = Kokkos::View< scalar_t *, device_t >
 
using ScalarsHostView = typename ScalarsDeviceView::HostMirror
 
using ConstWeightsDeviceView1D = Kokkos::View< const scalar_t *, device_t >
 
using ConstWeightsHostView1D = typename ConstWeightsDeviceView1D::HostMirror
 
using WeightsDeviceView1D = Kokkos::View< scalar_t *, device_t >
 
using WeightsHostView1D = typename WeightsDeviceView1D::HostMirror
 
using ConstWeightsDeviceView = Kokkos::View< const scalar_t **, device_t >
 
using ConstWeightsHostView = typename ConstWeightsDeviceView::HostMirror
 
using WeightsDeviceView = Kokkos::View< scalar_t **, device_t >
 
using WeightsHostView = typename WeightsDeviceView::HostMirror
 

Public Member Functions

 PamgenMeshAdapter (const Comm< int > &comm, std::string typestr="region", int nEntWgts=0)
 Constructor for mesh with identifiers but no coordinates or edges. More...
 
void setWeightIsDegree (int idx)
 Specify an index for which the weight should be the degree of the entity idx Zoltan2 will use the entity's degree as the entity weight for index idx. More...
 
void print (int)
 
bool areEntityIDsUnique (MeshEntityType etype) const
 Provide a pointer to the entity topology types. More...
 
size_t getLocalNumOf (MeshEntityType etype) const
 Returns the global number of mesh entities of MeshEntityType. More...
 
void getIDsViewOf (MeshEntityType etype, const gno_t *&Ids) const
 
void getTopologyViewOf (MeshEntityType etype, enum EntityTopologyType const *&Types) const
 Provide a pointer to the entity topology types. More...
 
void getWeightsViewOf (MeshEntityType etype, const scalar_t *&weights, int &stride, int idx=0) const
 
int getDimension () const
 Return dimension of the entity coordinates, if any. More...
 
void getCoordinatesViewOf (MeshEntityType etype, const scalar_t *&coords, int &stride, int dim) const
 
bool availAdjs (MeshEntityType source, MeshEntityType target) const
 Returns whether a first adjacency combination is available. More...
 
size_t getLocalNumAdjs (MeshEntityType source, MeshEntityType target) const
 Returns the number of first adjacencies on this process. More...
 
void getAdjsView (MeshEntityType source, MeshEntityType target, const offset_t *&offsets, const gno_t *&adjacencyIds) const
 
bool avail2ndAdjs (MeshEntityType sourcetarget, MeshEntityType through) const
 Returns whether a second adjacency combination is available. If combination is not available in the MeshAdapter, Zoltan2 will compute them, using A^T A, where A is matrix of first adjacencies. More...
 
size_t getLocalNum2ndAdjs (MeshEntityType sourcetarget, MeshEntityType through) const
 if avail2ndAdjs(), returns the number of second adjacencies on this process. More...
 
void get2ndAdjsView (MeshEntityType sourcetarget, MeshEntityType through, const offset_t *&offsets, const gno_t *&adjacencyIds) const
 
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. More...
 
- Public Member Functions inherited from Zoltan2::MeshAdapter< User >
enum BaseAdapterType adapterType () const override
 Returns the type of adapter. More...
 
 MeshAdapter ()
 
virtual void getIDsViewOf (MeshEntityType etype, gno_t const *&Ids) const =0
 Provide a pointer to this process' identifiers. More...
 
virtual int getNumWeightsPerOf (MeshEntityType etype) const
 Return the number of weights per entity. More...
 
virtual 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. More...
 
virtual void getCoordinatesViewOf (MeshEntityType etype, const scalar_t *&coords, int &stride, int coordDim) const
 Provide a pointer to one dimension of entity coordinates. More...
 
virtual void getAdjsView (MeshEntityType source, MeshEntityType target, const offset_t *&offsets, const gno_t *&adjacencyIds) const
 Sets pointers to this process' mesh first adjacencies. More...
 
virtual void get2ndAdjsView (MeshEntityType sourcetarget, MeshEntityType through, const offset_t *&offsets, const gno_t *&adjacencyIds) const
 if avail2ndAdjs(), set pointers to this process' second adjacencies More...
 
virtual int getNumWeightsPer2ndAdj (MeshEntityType sourcetarget, MeshEntityType through) const
 Returns the number (0 or greater) of weights per second adjacency. Note: second-adjacency weights may be used only if avail2ndAdjs(). More...
 
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. Note: second-adjacency weights may be used only if avail2ndAdjs(). More...
 
enum MeshEntityType getPrimaryEntityType () const
 Returns the entity to be partitioned, ordered, colored, etc. More...
 
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. More...
 
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. More...
 
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. More...
 
size_t getLocalNumIDs () const override
 Returns the number of objects on this process. More...
 
void getIDsView (const gno_t *&Ids) const override
 Provide a pointer to this process' identifiers. More...
 
void getIDsKokkosView (Kokkos::View< const gno_t *, typename node_t::device_type > &ids) const override
 
int getNumWeightsPerID () const override
 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...
 
void getWeightsView (const scalar_t *&wgt, int &stride, int idx=0) const override
 Provide pointer to a weight array with stride. More...
 
void getCoordinatesView (const scalar_t *&coords, int &stride, int coordDim) const override
 
void getCoordinatesKokkosView (Kokkos::View< scalar_t **, Kokkos::LayoutLeft, typename node_t::device_type > &elements) const override
 
bool useDegreeAsWeight (int idx) const
 
- Public Member Functions inherited from Zoltan2::AdapterWithCoords< User >
virtual void getCoordinatesKokkosView (CoordsDeviceView &elements) const =0
 
virtual void getCoordinatesHostView (CoordsHostView &) const
 
virtual void getCoordinatesDeviceView (CoordsDeviceView &elements) const
 
- Public Member Functions inherited from Zoltan2::BaseAdapter< User >
virtual void getIDsKokkosView (ConstIdsDeviceView &ids) const
 Provide a Kokkos view to this process' identifiers. More...
 
virtual void getIDsHostView (ConstIdsHostView &hostIds) const
 Provide a Kokkos view (Host side) to this process' identifiers. More...
 
virtual void getIDsDeviceView (ConstIdsDeviceView &deviceIds) const
 Provide a Kokkos view (Device side) to this process' identifiers. More...
 
virtual void getWeightsKokkosView (Kokkos::View< scalar_t **, device_t > &wgt) const
 Provide kokkos view of weights. More...
 
virtual void getWeightsHostView (WeightsHostView1D &hostWgts, int idx=0) const
 Provide a Kokkos view (Host side) of the weights. More...
 
virtual void getWeightsHostView (WeightsHostView &hostWgts) const
 Provide a Kokkos view (Host side) of the weights. More...
 
virtual void getWeightsDeviceView (WeightsDeviceView1D &deviceWgts, int idx=0) const
 Provide a Kokkos view (Device side) of the weights. More...
 
virtual void getWeightsDeviceView (WeightsDeviceView &deviceWgts) const
 Provide a Kokkos view (Device side) of the weights. More...
 
virtual 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...
 
virtual void getPartsHostView (Kokkos::View< part_t *, host_t > &inputPart) const
 
virtual void getPartsDeviceView (Kokkos::View< part_t *, device_t > &inputPart) const
 
template<typename Adapter >
void applyPartitioningSolution (const User &in, User *&out, const PartitioningSolution< Adapter > &solution) const
 Apply a PartitioningSolution to an input. More...
 
- Public Member Functions inherited from Zoltan2::BaseAdapterRoot
virtual ~BaseAdapterRoot ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from Zoltan2::BaseAdapter< User >
void generateWeightFileOnly (const char *fileprefix, const Teuchos::Comm< int > &comm) const
 

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 91 of file Zoltan2_PamgenMeshAdapter.hpp.

Member Typedef Documentation

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

Definition at line 95 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 96 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 97 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 98 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 99 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 100 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 101 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
typedef std::map<gno_t, gno_t> Zoltan2::PamgenMeshAdapter< User >::MapType

Definition at line 102 of file Zoltan2_PamgenMeshAdapter.hpp.

Constructor & Destructor Documentation

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

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 352 of file Zoltan2_PamgenMeshAdapter.hpp.

Member Function Documentation

template<typename User >
void Zoltan2::PamgenMeshAdapter< User >::setWeightIsDegree ( int  idx)

Specify an index for which the weight should be the degree of the entity idx Zoltan2 will use the entity's degree as the entity weight for index idx.

Definition at line 897 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 907 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
bool Zoltan2::PamgenMeshAdapter< User >::areEntityIDsUnique ( MeshEntityType  etype) const
inlinevirtual

Provide a pointer to the entity topology types.

Parameters
Typeswill on return point to the list of entity topology types for this process.

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 129 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
size_t Zoltan2::PamgenMeshAdapter< User >::getLocalNumOf ( MeshEntityType  etype) const
inlinevirtual

Returns the global number of mesh entities of MeshEntityType.

Returns the number of mesh entities on this process.

Implements Zoltan2::MeshAdapter< User >.

Definition at line 133 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 147 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
void Zoltan2::PamgenMeshAdapter< User >::getTopologyViewOf ( MeshEntityType  etype,
enum EntityTopologyType const *&  Types 
) const
inlinevirtual

Provide a pointer to the entity topology types.

Parameters
Typeswill on return point to the list of entity topology types for this process.

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 161 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

Definition at line 175 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
int Zoltan2::PamgenMeshAdapter< User >::getDimension ( ) const
inlinevirtual

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 182 of file Zoltan2_PamgenMeshAdapter.hpp.

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

Definition at line 184 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
bool Zoltan2::PamgenMeshAdapter< User >::availAdjs ( MeshEntityType  source,
MeshEntityType  target 
) const
inlinevirtual

Returns whether a first adjacency combination is available.

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 215 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
size_t Zoltan2::PamgenMeshAdapter< User >::getLocalNumAdjs ( MeshEntityType  source,
MeshEntityType  target 
) const
inlinevirtual

Returns the number of first adjacencies on this process.

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 226 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
void Zoltan2::PamgenMeshAdapter< User >::getAdjsView ( MeshEntityType  source,
MeshEntityType  target,
const offset_t *&  offsets,
const gno_t *&  adjacencyIds 
) const
inline

Definition at line 241 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
bool Zoltan2::PamgenMeshAdapter< User >::avail2ndAdjs ( MeshEntityType  sourcetarget,
MeshEntityType  through 
) const
inlinevirtual

Returns whether a second adjacency combination is available. If combination is not available in the MeshAdapter, Zoltan2 will compute them, using A^T A, where A is matrix of first adjacencies.

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 264 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
size_t Zoltan2::PamgenMeshAdapter< User >::getLocalNum2ndAdjs ( MeshEntityType  sourcetarget,
MeshEntityType  through 
) const
inlinevirtual

if avail2ndAdjs(), returns the number of second adjacencies on this process.

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 277 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
void Zoltan2::PamgenMeshAdapter< User >::get2ndAdjsView ( MeshEntityType  sourcetarget,
MeshEntityType  through,
const offset_t *&  offsets,
const gno_t *&  adjacencyIds 
) const
inline

Definition at line 295 of file Zoltan2_PamgenMeshAdapter.hpp.

template<typename User >
bool Zoltan2::PamgenMeshAdapter< User >::useDegreeAsWeightOf ( MeshEntityType  etype,
int  idx 
) const
inlinevirtual

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.

Reimplemented from Zoltan2::MeshAdapter< User >.

Definition at line 316 of file Zoltan2_PamgenMeshAdapter.hpp.


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