46#ifndef MUELU_ISOLATEDNODEAGGREGATIONALGORITHM_KOKKOS_DEF_HPP
47#define MUELU_ISOLATEDNODEAGGREGATIONALGORITHM_KOKKOS_DEF_HPP
49#include <Teuchos_Comm.hpp>
50#include <Teuchos_CommHelpers.hpp>
52#include <Xpetra_Vector.hpp>
54#include "MueLu_IsolatedNodeAggregationAlgorithm_kokkos.hpp"
56#include "MueLu_LWGraph_kokkos.hpp"
57#include "MueLu_Aggregates_kokkos.hpp"
63 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
68 Kokkos::View<unsigned*, typename LWGraph_kokkos::device_type>& aggstat,
69 LO& numNonAggregatedNodes)
const {
70 Monitor m(*
this,
"BuildAggregates");
72 typename Kokkos::View<unsigned*, device_type>::HostMirror aggstatHost
73 = Kokkos::create_mirror(aggstat);
74 Kokkos::deep_copy(aggstatHost, aggstat);
75 std::vector<unsigned> aggStat;
76 aggStat.resize(aggstatHost.extent(0));
77 for(
size_t idx = 0; idx < aggstatHost.extent(0); ++idx) {
78 aggStat[idx] = aggstatHost(idx);
81 auto lclLWGraph = graph.getLocalLWGraph();
83 const LO numRows = graph.GetNodeNumVertices();
86 for (LO i = 0; i < numRows; i++)
87 if (aggStat[i] !=
AGGREGATED && aggStat[i] !=
IGNORED && lclLWGraph.getNeighborVertices(i).length == 1) {
89 numNonAggregatedNodes--;
92 for(
size_t idx = 0; idx < aggstatHost.extent(0); ++idx) {
93 aggstatHost(idx) = aggStat[idx];
95 Kokkos::deep_copy(aggstat, aggstatHost);
void BuildAggregates(const ParameterList ¶ms, const LWGraph_kokkos &graph, Aggregates_kokkos &aggregates, Kokkos::View< unsigned *, device_type > &aggStat, LO &numNonAggregatedNodes) const
Local aggregation.
Lightweight MueLu representation of a compressed row storage graph.
Timer to be used in non-factories.
Namespace for MueLu classes and methods.