50 #ifndef _ZOLTAN2_TPETRACRSGRAPHADAPTER_HPP_
51 #define _ZOLTAN2_TPETRACRSGRAPHADAPTER_HPP_
68 template <
typename User,
typename UserCoord = User>
72 #ifndef DOXYGEN_SHOULD_SKIP_THIS
80 using userCoord_t = UserCoord;
96 int nEdgeWeights = 0);
102 template <
typename Adapter>
104 const User &in, User *&out,
107 template <
typename Adapter>
109 const User &in, RCP<User> &out,
117 template <
typename User,
typename UserCoord>
119 const RCP<const User> &graph,
int nVtxWgts,
int nEdgeWgts)
121 auto adjIdsHost = graph->getLocalIndicesHost();
123 auto adjIdsGlobalHost =
124 typename Base::IdsHostView(
"adjIdsGlobalHost", adjIdsHost.extent(0));
125 auto colMap = graph->getColMap();
128 Kokkos::parallel_for(
"adjIdsGlobalHost",
129 Kokkos::RangePolicy<Kokkos::HostSpace::execution_space>(
130 0, adjIdsGlobalHost.extent(0)),
132 adjIdsGlobalHost(i) =
133 colMap->getGlobalElement(adjIdsHost(i));
136 auto adjIdsDevice = Kokkos::create_mirror_view_and_copy(
140 this->
offsDevice_ = graph->getLocalRowPtrsDevice();
145 "vertexWeightsDevice_", graph->getLocalNumRows(),
163 template <
typename User,
typename UserCoord>
164 template <
typename Adapter>
166 const User &in, User *&out,
173 template <
typename User,
typename UserCoord>
174 template <
typename Adapter>
176 const User &in, RCP<User> &out,
Helper functions for Partitioning Problems.
typename InputTraits< User >::scalar_t scalar_t
Base::WeightsDeviceView edgeWeightsDevice_
Base::ConstOffsetsDeviceView offsDevice_
GraphAdapter defines the interface for graph-based user data.
Defines TpetraRowGraphAdapter class.
Provides access for Zoltan2 to Tpetra::CrsGraph data.
Traits of Xpetra classes, including migration method.
typename InputTraits< User >::part_t part_t
void applyPartitioningSolution(const User &in, User *&out, const PartitioningSolution< Adapter > &solution) const
typename InputTraits< User >::node_t node_t
TpetraCrsGraphAdapter(const RCP< const User > &graph, int nVtxWeights=0, int nEdgeWeights=0)
Constructor for graph with no weights or coordinates.
A PartitioningSolution is a solution to a partitioning problem.
typename InputTraits< User >::gno_t gno_t
Base::ConstIdsDeviceView adjIdsDevice_
Base::VtxDegreeHostView vertexDegreeWeightsHost_
typename InputTraits< User >::offset_t offset_t
Base::WeightsDeviceView vertexWeightsDevice_
void applyPartitioningSolution(const User &in, User *&out, const PartitioningSolution< Adapter > &solution) const
RCP< const User > getUserGraph() const
Access to user's graph.
typename InputTraits< User >::lno_t lno_t
Provides access for Zoltan2 to Tpetra::RowGraph data.
This file defines the StridedData class.