53 #ifndef MUELU_INTERFACEAGGREGATIONALGORITHM_DEF_HPP_
54 #define MUELU_INTERFACEAGGREGATIONALGORITHM_DEF_HPP_
56 #include <Teuchos_Comm.hpp>
57 #include <Teuchos_CommHelpers.hpp>
63 #include "MueLu_LWGraph.hpp"
64 #include "MueLu_Aggregates.hpp"
70 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
74 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 Monitor m(*
this,
"BuildAggregatesNonKokkos");
79 const int myRank = graph.
GetComm()->getRank();
89 for (
int iNode1 = 0; iNode1 < nRows; ++iNode1) {
92 int aggIndex = numLocalAggregates;
93 std::vector<int> aggList;
94 aggList.push_back(iNode1);
97 for (
int j = 0; j < neighOfINode.length; ++j) {
98 LO neigh = neighOfINode(j);
102 aggList.push_back(neigh);
107 for (
size_t k = 0; k < aggList.size(); k++) {
109 vertex2AggId[aggList[k]] = aggIndex;
110 procWinner[aggList[k]] = myRank;
112 ++numLocalAggregates;
113 numNonAggregatedNodes -= aggList.
size();
122 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
Kokkos::View< unsigned *, typename LWGraphHostType::device_type > AggStatHostType
MueLu::DefaultLocalOrdinal LocalOrdinal
Lightweight MueLu representation of a compressed row storage graph.
const RCP< LOVector > & GetProcWinner() const
Returns constant vector that maps local node IDs to owning processor IDs.
Container class for aggregation information.
KOKKOS_INLINE_FUNCTION LO GetNumAggregates() const
KOKKOS_INLINE_FUNCTION size_type GetNodeNumVertices() const
Return number of graph vertices.
void SetIsRoot(LO i, bool value=true)
Set root node information.
void BuildAggregates(const Teuchos::ParameterList ¶ms, const LWGraph_kokkos &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatType &aggStat, LO &numNonAggregatedNodes) const
KOKKOS_INLINE_FUNCTION bool isLocalNeighborVertex(LO i) const
Return true if vertex with local id 'v' is on current process.
const RCP< LOMultiVector > & GetVertex2AggId() const
Returns constant vector that maps local node IDs to local aggregates IDs.
KOKKOS_INLINE_FUNCTION neighbor_vertices_type getNeighborVertices(LO i) const
Return the list of vertices adjacent to the vertex 'v'.
Timer to be used in non-factories.
Lightweight MueLu representation of a compressed row storage graph.
InterfaceAggregationAlgorithm(RCP< const FactoryBase > const &graphFact=Teuchos::null)
Constructor.
#define TEUCHOS_ASSERT(assertion_test)
void BuildAggregatesNonKokkos(Teuchos::ParameterList const ¶ms, LWGraph const &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatHostType &aggStat, LO &numNonAggregatedNodes) const
Local aggregation.
const RCP< const Teuchos::Comm< int > > GetComm() const
Kokkos::View< unsigned *, typename LWGraphType::device_type > AggStatType
void SetNumAggregates(LO nAggregates)
Set number of local aggregates on current processor.