Zoltan2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
Zoltan2::BaseAdapter< User > Class Template Referenceabstract

#include <Zoltan2_Adapter.hpp>

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

Public Types

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

virtual enum BaseAdapterType adapterType () const =0
 Returns the type of adapter. More...
 
virtual void getIDsView (const gno_t *&ids) const
 Provide a pointer to this process' identifiers. More...
 
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 getWeightsView (const scalar_t *&wgt, int &stride, int idx=0) const
 Provide pointer to a weight array with stride. 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
 
virtual size_t getLocalNumIDs () const =0
 Returns the number of objects on this process. 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...
 

Protected Member Functions

void generateWeightFileOnly (const char *fileprefix, const Teuchos::Comm< int > &comm) const
 

Detailed Description

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

Definition at line 70 of file Zoltan2_Adapter.hpp.

Member Typedef Documentation

template<typename User>
using Zoltan2::BaseAdapter< User >::lno_t = typename InputTraits<User>::lno_t

Definition at line 73 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::gno_t = typename InputTraits<User>::gno_t

Definition at line 74 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::scalar_t = typename InputTraits<User>::scalar_t

Definition at line 75 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::node_t = typename InputTraits<User>::node_t

Definition at line 76 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::part_t = typename InputTraits<User>::part_t

Definition at line 77 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::offset_t = typename InputTraits<User>::offset_t

Definition at line 78 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::host_t = typename Kokkos::HostSpace::memory_space

Definition at line 79 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::device_t = typename node_t::device_type

Definition at line 80 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ConstIdsDeviceView = Kokkos::View<const gno_t *, device_t>

Definition at line 82 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ConstIdsHostView = typename ConstIdsDeviceView::HostMirror

Definition at line 83 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::IdsDeviceView = Kokkos::View<gno_t *, device_t>

Definition at line 85 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::IdsHostView = typename IdsDeviceView::HostMirror

Definition at line 86 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ConstOffsetsDeviceView = Kokkos::View<const offset_t *, device_t>

Definition at line 88 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ConstOffsetsHostView = typename ConstOffsetsDeviceView::HostMirror

Definition at line 89 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::OffsetsDeviceView = Kokkos::View<offset_t *, device_t>

Definition at line 91 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::OffsetsHostView = typename OffsetsDeviceView::HostMirror

Definition at line 92 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ConstScalarsDeviceView = Kokkos::View<const scalar_t *, device_t>

Definition at line 94 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ConstScalarsHostView = typename ConstScalarsDeviceView::HostMirror

Definition at line 95 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ScalarsDeviceView = Kokkos::View<scalar_t *, device_t>

Definition at line 97 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ScalarsHostView = typename ScalarsDeviceView::HostMirror

Definition at line 98 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ConstWeightsDeviceView1D = Kokkos::View<const scalar_t *, device_t>

Definition at line 100 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ConstWeightsHostView1D = typename ConstWeightsDeviceView1D::HostMirror

Definition at line 101 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::WeightsDeviceView1D = Kokkos::View<scalar_t *, device_t>

Definition at line 103 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::WeightsHostView1D = typename WeightsDeviceView1D::HostMirror

Definition at line 104 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ConstWeightsDeviceView = Kokkos::View<const scalar_t **, device_t>

Definition at line 106 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::ConstWeightsHostView = typename ConstWeightsDeviceView::HostMirror

Definition at line 107 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::WeightsDeviceView = Kokkos::View<scalar_t **, device_t>

Definition at line 109 of file Zoltan2_Adapter.hpp.

template<typename User>
using Zoltan2::BaseAdapter< User >::WeightsHostView = typename WeightsDeviceView::HostMirror

Definition at line 110 of file Zoltan2_Adapter.hpp.

Member Function Documentation

template<typename User>
virtual enum BaseAdapterType Zoltan2::BaseAdapter< User >::adapterType ( ) const
pure virtual
template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getIDsView ( const gno_t *&  ids) const
inlinevirtual

Provide a pointer to this process' identifiers.

Deprecated:
Use getIDsHostView instead.
Parameters
idswill on return point to the list of the global Ids for this process.

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

Definition at line 121 of file Zoltan2_Adapter.hpp.

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getIDsKokkosView ( ConstIdsDeviceView ids) const
inlinevirtual

Provide a Kokkos view to this process' identifiers.

Deprecated:
Use getIDsDeviceView instead.
Parameters
idswill on return point to the list of the global Ids for this process.

Definition at line 136 of file Zoltan2_Adapter.hpp.

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getIDsHostView ( ConstIdsHostView hostIds) const
inlinevirtual

Provide a Kokkos view (Host side) to this process' identifiers.

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

Definition at line 156 of file Zoltan2_Adapter.hpp.

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getIDsDeviceView ( ConstIdsDeviceView deviceIds) const
inlinevirtual

Provide a Kokkos view (Device side) to this process' identifiers.

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

Definition at line 164 of file Zoltan2_Adapter.hpp.

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 or getWeightsKokkosView must be implemented in derived adapter if getNumWeightsPerID > 0. This function should not be called if getNumWeightsPerID is zero.

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

Definition at line 177 of file Zoltan2_Adapter.hpp.

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getWeightsKokkosView ( Kokkos::View< scalar_t **, device_t > &  wgt) const
inlinevirtual

Provide kokkos view of weights.

Parameters
wgton return a Kokkos view of the weights for this idx This function or getWeightsView must be implemented in derived adapter if getNumWeightsPerID > 0. This function should not be called if getNumWeightsPerID is zero.

Reimplemented in Zoltan2::BasicKokkosIdentifierAdapter< User >.

Definition at line 195 of file Zoltan2_Adapter.hpp.

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getWeightsHostView ( WeightsHostView1D hostWgts,
int  idx = 0 
) const
inlinevirtual

Provide a Kokkos view (Host side) of the weights.

Parameters
hostWgtson return a Kokkos view of the weights for this idx
idxthe weight index, zero or greater

Definition at line 219 of file Zoltan2_Adapter.hpp.

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getWeightsHostView ( WeightsHostView hostWgts) const
inlinevirtual

Provide a Kokkos view (Host side) of the weights.

Parameters
hostWgtson return a Kokkos view of all the weights

Definition at line 226 of file Zoltan2_Adapter.hpp.

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getWeightsDeviceView ( WeightsDeviceView1D deviceWgts,
int  idx = 0 
) const
inlinevirtual

Provide a Kokkos view (Device side) of the weights.

Parameters
deviceWgtson return a Kokkos view of the weights for this idx
idxthe weight index, zero or greater

Definition at line 234 of file Zoltan2_Adapter.hpp.

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getWeightsDeviceView ( WeightsDeviceView deviceWgts) const
inlinevirtual

Provide a Kokkos view (Device side) of the weights.

Parameters
deviceWgtson return a Kokkos view of all the weights

Definition at line 241 of file Zoltan2_Adapter.hpp.

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

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

Reimplemented in VerySimpleVectorAdapter< User >.

Definition at line 254 of file Zoltan2_Adapter.hpp.

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getPartsHostView ( Kokkos::View< part_t *, host_t > &  inputPart) const
inlinevirtual

Definition at line 260 of file Zoltan2_Adapter.hpp.

template<typename User>
virtual void Zoltan2::BaseAdapter< User >::getPartsDeviceView ( Kokkos::View< part_t *, device_t > &  inputPart) const
inlinevirtual

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

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

template<typename User >
void Zoltan2::BaseAdapter< User >::generateWeightFileOnly ( const char *  fileprefix,
const Teuchos::Comm< int > &  comm 
) const
protected

Definition at line 341 of file Zoltan2_Adapter.hpp.


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