17#ifndef MUELU_INTERFACEAGGREGATIONALGORITHM_DEF_HPP_
18#define MUELU_INTERFACEAGGREGATIONALGORITHM_DEF_HPP_
20#include <Teuchos_Comm.hpp>
21#include <Teuchos_CommHelpers.hpp>
23#include <Xpetra_Vector.hpp>
27#include "MueLu_LWGraph.hpp"
28#include "MueLu_Aggregates.hpp"
34template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
38template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
40 Monitor m(*
this,
"BuildAggregatesNonKokkos");
43 const int myRank = graph.
GetComm()->getRank();
46 Teuchos::ArrayRCP<LocalOrdinal> vertex2AggId = aggregates.
GetVertex2AggId()->getDataNonConst(0);
47 Teuchos::ArrayRCP<LocalOrdinal> procWinner = aggregates.
GetProcWinner()->getDataNonConst(0);
53 for (
int iNode1 = 0; iNode1 < nRows; ++iNode1) {
56 int aggIndex = numLocalAggregates;
57 std::vector<int> aggList;
58 aggList.push_back(iNode1);
61 for (
int j = 0; j < neighOfINode.length; ++j) {
62 LO neigh = neighOfINode(j);
66 aggList.push_back(neigh);
71 for (
size_t k = 0; k < aggList.size(); k++) {
73 vertex2AggId[aggList[k]] = aggIndex;
74 procWinner[aggList[k]] = myRank;
77 numNonAggregatedNodes -= aggList.size();
86template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
88 TEUCHOS_ASSERT(
false);
MueLu::DefaultLocalOrdinal LocalOrdinal
Container class for aggregation information.
KOKKOS_INLINE_FUNCTION LO GetNumAggregates() const
void SetIsRoot(LO i, bool value=true)
Set root node information.
const RCP< LOMultiVector > & GetVertex2AggId() const
Returns constant vector that maps local node IDs to local aggregates IDs.
const RCP< LOVector > & GetProcWinner() const
Returns constant vector that maps local node IDs to owning processor IDs.
void SetNumAggregates(LO nAggregates)
Set number of local aggregates on current processor.
Kokkos::View< unsigned *, typename LWGraphHostType::device_type > AggStatHostType
Kokkos::View< unsigned *, typename LWGraphType::device_type > AggStatType
void BuildAggregatesNonKokkos(Teuchos::ParameterList const ¶ms, LWGraph const &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatHostType &aggStat, LO &numNonAggregatedNodes) const
Local aggregation.
void BuildAggregates(const Teuchos::ParameterList ¶ms, const LWGraph_kokkos &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatType &aggStat, LO &numNonAggregatedNodes) const
InterfaceAggregationAlgorithm(RCP< const FactoryBase > const &graphFact=Teuchos::null)
Constructor.
KOKKOS_INLINE_FUNCTION size_type GetNodeNumVertices() const
Return number of graph vertices.
KOKKOS_INLINE_FUNCTION bool isLocalNeighborVertex(LO i) const
Return true if vertex with local id 'v' is on current process.
const RCP< const Teuchos::Comm< int > > GetComm() const
KOKKOS_INLINE_FUNCTION neighbor_vertices_type getNeighborVertices(LO i) const
Return the list of vertices adjacent to the vertex 'v'.
Lightweight MueLu representation of a compressed row storage graph.
Lightweight MueLu representation of a compressed row storage graph.
Timer to be used in non-factories.
Namespace for MueLu classes and methods.