46 #ifndef MUELU_ONEPTAGGREGATIONALGORITHM_DEF_HPP
47 #define MUELU_ONEPTAGGREGATIONALGORITHM_DEF_HPP
49 #ifdef HAVE_MUELU_KOKKOS_REFACTOR
51 #include <Teuchos_Comm.hpp>
52 #include <Teuchos_CommHelpers.hpp>
56 #include "MueLu_OnePtAggregationAlgorithm_kokkos.hpp"
58 #include "MueLu_LWGraph_kokkos.hpp"
59 #include "MueLu_Aggregates_kokkos.hpp"
65 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
66 OnePtAggregationAlgorithm_kokkos<LocalOrdinal, GlobalOrdinal, Node>::OnePtAggregationAlgorithm_kokkos(RCP<const FactoryBase>
const &)
70 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
71 void OnePtAggregationAlgorithm_kokkos<LocalOrdinal, GlobalOrdinal, Node>::BuildAggregates(
Teuchos::ParameterList const & , LWGraph_kokkos
const & graph, Aggregates_kokkos & aggregates, std::vector<unsigned>& aggStat,
LO& numNonAggregatedNodes)
const {
72 Monitor m(*
this,
"BuildAggregates");
74 const LocalOrdinal nRows = graph.GetNodeNumVertices();
75 const int myRank = graph.GetComm()->getRank();
82 LocalOrdinal nLocalAggregates = aggregates.GetNumAggregates();
83 LocalOrdinal iNode1 = 0;
86 while (iNode1 < nRows) {
88 if (aggStat[iNode1] ==
ONEPT) {
90 aggregates.SetIsRoot(iNode1);
91 std::vector<int> aggList;
92 aggList.push_back(iNode1);
93 int aggIndex = nLocalAggregates++;
96 for (
size_t k = 0; k < aggList.size(); k++) {
98 vertex2AggId[aggList[k]] = aggIndex;
99 procWinner[aggList[k]] = myRank;
101 numNonAggregatedNodes -= aggList.
size();
108 aggregates.SetNumAggregates(nLocalAggregates);
113 #endif // HAVE_MUELU_KOKKOS_REFACTOR
114 #endif // MUELU_ONEPTAGGREGATIONALGORITHM_KOKKOS_DEF_HPP