46 #ifndef MUELU_ISOLATEDNODEAGGREGATIONALGORITHM_KOKKOS_DEF_HPP
47 #define MUELU_ISOLATEDNODEAGGREGATIONALGORITHM_KOKKOS_DEF_HPP
49 #include <Teuchos_Comm.hpp>
50 #include <Teuchos_CommHelpers.hpp>
56 #include "MueLu_LWGraph_kokkos.hpp"
57 #include "MueLu_Aggregates.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 = Kokkos::create_mirror(aggstat);
73 Kokkos::deep_copy(aggstatHost, aggstat);
74 std::vector<unsigned> aggStat;
75 aggStat.resize(aggstatHost.extent(0));
76 for (
size_t idx = 0; idx < aggstatHost.extent(0); ++idx) {
77 aggStat[idx] = aggstatHost(idx);
80 auto lclLWGraph = graph;
85 for (
LO i = 0; i < numRows; i++)
86 if (aggStat[i] !=
AGGREGATED && aggStat[i] !=
IGNORED && lclLWGraph.getNeighborVertices(i).length == 1) {
88 numNonAggregatedNodes--;
91 for (
size_t idx = 0; idx < aggstatHost.extent(0); ++idx) {
92 aggstatHost(idx) = aggStat[idx];
94 Kokkos::deep_copy(aggstat, aggstatHost);
99 #endif // MUELU_ISOLATEDNODEAGGREGATIONALGORITHM_KOKKOS_DEF_HPP
void BuildAggregates(const ParameterList ¶ms, const LWGraph_kokkos &graph, Aggregates &aggregates, Kokkos::View< unsigned *, device_type > &aggStat, LO &numNonAggregatedNodes) const
Local aggregation.
Lightweight MueLu representation of a compressed row storage graph.
Container class for aggregation information.
KOKKOS_INLINE_FUNCTION size_type GetNodeNumVertices() const
Return number of graph vertices.
Timer to be used in non-factories.