14#ifndef _ZOLTAN2_TPETRACRSGRAPHADAPTER_HPP_
15#define _ZOLTAN2_TPETRACRSGRAPHADAPTER_HPP_
32template <
typename User,
typename UserCoord = User>
36#ifndef DOXYGEN_SHOULD_SKIP_THIS
44 using userCoord_t = UserCoord;
60 int nEdgeWeights = 0);
62 void init(
const RCP<const User> &graph);
68 template <
typename Adapter>
70 const User &in, User *&out,
73 template <
typename Adapter>
75 const User &in, RCP<User> &out,
83template <
typename User,
typename UserCoord>
84typename TpetraCrsGraphAdapter<User, UserCoord>::Base::IdsDeviceView
86 auto colIdsDevice = inmatrix->getLocalIndicesDevice();
88 auto colIdsGlobalDevice =
90 auto colMap = inmatrix->getColMap();
91 auto lclColMap = colMap->getLocalMap();
94 Kokkos::parallel_for(
"colIdsGlobalDevice",
95 Kokkos::RangePolicy<typename User::node_type::execution_space>(
96 0, colIdsGlobalDevice.extent(0)),
97 KOKKOS_LAMBDA(
const int i) {
98 colIdsGlobalDevice(i) =
99 lclColMap.getGlobalElement(colIdsDevice(i));
102 return colIdsGlobalDevice;
106template <
typename User,
typename UserCoord>
108 auto colIdsDevice = graph->getLocalIndicesDevice();
110 auto colIdsGlobalDevice =
112 auto colMap = graph->getColMap();
113 auto lclColMap = colMap->getLocalMap();
116 Kokkos::parallel_for(
"colIdsGlobalDevice",
117 Kokkos::RangePolicy<typename User::node_type::execution_space>(
118 0, colIdsGlobalDevice.extent(0)),
119 KOKKOS_LAMBDA(
const int i) {
120 colIdsGlobalDevice(i) =
121 lclColMap.getGlobalElement(colIdsDevice(i));
124 this->adjIdsDevice_ = colIdsGlobalDevice;
125 this->offsDevice_ = graph->getLocalRowPtrsDevice();
128template <
typename User,
typename UserCoord>
130 const RCP<const User> &graph,
int nVtxWgts,
int nEdgeWgts)
138 "vertexWeightsDevice_", graph->getLocalNumRows(),
139 this->nWeightsPerVertex_);
151 "nWeightsPerEdge_", graph->getLocalNumRows(), this->nWeightsPerEdge_);
156template <
typename User,
typename UserCoord>
157template <
typename Adapter>
159 const User &in, User *&out,
166template <
typename User,
typename UserCoord>
167template <
typename Adapter>
169 const User &in, RCP<User> &out,
Helper functions for Partitioning Problems.
This file defines the StridedData class.
Defines TpetraRowGraphAdapter class.
Traits of Xpetra classes, including migration method.
typename InputTraits< User >::node_t node_t
typename InputTraits< User >::lno_t lno_t
typename InputTraits< User >::scalar_t scalar_t
typename InputTraits< User >::gno_t gno_t
typename InputTraits< User >::offset_t offset_t
typename InputTraits< User >::part_t part_t
GraphAdapter defines the interface for graph-based user data.
A PartitioningSolution is a solution to a partitioning problem.
Provides access for Zoltan2 to Tpetra::CrsGraph data.
RCP< const User > getUserGraph() const
Access to user's graph.
TpetraCrsGraphAdapter(const RCP< const User > &graph, int nVtxWeights=0, int nEdgeWeights=0)
Constructor for graph with no weights or coordinates.
void applyPartitioningSolution(const User &in, User *&out, const PartitioningSolution< Adapter > &solution) const
void init(const RCP< const User > &graph)
Provides access for Zoltan2 to Tpetra::RowGraph data.
Base::WeightsDeviceView edgeWeightsDevice_
Base::WeightsDeviceView vertexWeightsDevice_
void applyPartitioningSolution(const User &in, User *&out, const PartitioningSolution< Adapter > &solution) const
Base::VtxDegreeHostView vertexDegreeWeightsHost_
Created by mbenlioglu on Aug 31, 2020.
TpetraCrsGraphAdapter< User, UserCoord >::Base::IdsDeviceView getColIds(const RCP< const User > &inmatrix)