78 Monitor m(*
this,
"BuildAggregates");
81 const int myRank = graph.
GetComm()->getRank();
84 Teuchos::ArrayRCP<LocalOrdinal> vertex2AggId = aggregates.GetVertex2AggId()->getDataNonConst(0);
85 Teuchos::ArrayRCP<LocalOrdinal> procWinner = aggregates.GetProcWinner()->getDataNonConst(0);
88 LocalOrdinal numLocalAggregates = aggregates.GetNumAggregates();
91 for(
int iNode1 = 0; iNode1 < nRows; ++iNode1) {
95 aggregates.SetIsRoot(iNode1);
96 int aggIndex = numLocalAggregates;
97 std::vector<int> aggList;
98 aggList.push_back(iNode1);
101 for(
int j = 0; j < neighOfINode.size(); ++j) {
102 LO neigh = neighOfINode[j];
106 aggList.push_back(neigh);
111 for (
size_t k = 0; k < aggList.size(); k++) {
113 vertex2AggId[aggList[k]] = aggIndex;
114 procWinner[aggList[k]] = myRank;
116 ++numLocalAggregates;
117 numNonAggregatedNodes -= aggList.size();
123 aggregates.SetNumAggregates(numLocalAggregates);