73 Kokkos::View<unsigned*, typename LWGraph_kokkos::device_type>& aggstat,
74 LO& numNonAggregatedNodes)
const {
75 Monitor m(*
this,
"BuildAggregates");
77 typename Kokkos::View<unsigned*, device_type>::HostMirror aggstatHost
78 = Kokkos::create_mirror(aggstat);
79 Kokkos::deep_copy(aggstatHost, aggstat);
80 std::vector<unsigned> aggStat;
81 aggStat.resize(aggstatHost.extent(0));
82 for(
size_t idx = 0; idx < aggstatHost.extent(0); ++idx) {
83 aggStat[idx] = aggstatHost(idx);
87 const int myRank = graph.GetComm()->getRank();
90 Teuchos::ArrayRCP<LocalOrdinal> vertex2AggId = aggregates.GetVertex2AggId()->getDataNonConst(0);
91 Teuchos::ArrayRCP<LocalOrdinal> procWinner = aggregates.GetProcWinner()->getDataNonConst(0);
94 LocalOrdinal nLocalAggregates = aggregates.GetNumAggregates();
98 while (iNode1 < nRows) {
100 if (aggStat[iNode1] ==
ONEPT) {
102 aggregates.SetIsRoot(iNode1);
103 std::vector<int> aggList;
104 aggList.push_back(iNode1);
105 int aggIndex = nLocalAggregates++;
108 for (
size_t k = 0; k < aggList.size(); k++) {
110 vertex2AggId[aggList[k]] = aggIndex;
111 procWinner[aggList[k]] = myRank;
113 numNonAggregatedNodes -= aggList.size();
119 for(
size_t idx = 0; idx < aggstatHost.extent(0); ++idx) {
120 aggstatHost(idx) = aggStat[idx];
122 Kokkos::deep_copy(aggstat, aggstatHost);
125 aggregates.SetNumAggregates(nLocalAggregates);