10 #ifndef MUELU_AGGREGATES_DECL_HPP
11 #define MUELU_AGGREGATES_DECL_HPP
15 #include <Kokkos_StaticCrsGraph.hpp>
26 #include "MueLu_LWGraph_kokkos.hpp"
28 #include "MueLu_LWGraph.hpp"
29 #include "MueLu_IndexManager.hpp"
30 #include "MueLu_IndexManager_kokkos.hpp"
32 #define MUELU_UNAGGREGATED -1
35 #define MUELU_UNASSIGNED -1
68 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 using range_type = Kokkos::RangePolicy<local_ordinal_type, execution_space>;
77 using LO_view = Kokkos::View<local_ordinal_type*, device_type>;
82 #undef MUELU_AGGREGATES_SHORT
88 using colors_view_type = Kokkos::View<
typename local_graph_type::entries_type::data_type,
89 typename local_graph_type::device_type::memory_space>;
330 #define MUELU_AGGREGATES_SHORT
331 #endif // MUELU_AGGREGATES_DECL_HPP
Kokkos::View< LocalOrdinal *, device_type > aggregates_sizes_type
virtual ~Aggregates()
Destructor.
MueLu::DefaultLocalOrdinal LocalOrdinal
void SetIndexManagerKokkos(RCP< IndexManager_kokkos > &geoDataKokkos)
Set the index manager used by structured aggregation algorithms. This has to be done by the aggregati...
typename Node::execution_space execution_space
typename Node::device_type device_type
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.
RCP< IndexManager > geoData_
void SetGraphNumColors(const LO graphNumColors)
Set the number of colors needed by the distance 2 coloring.
Container class for aggregation information.
RCP< IndexManager > & GetIndexManager()
Get the index manager used by various aggregation algorithms. This has to be done by the aggregation ...
bool aggregatesIncludeGhosts_
Set to false iff aggregates do not include any DOFs belong to other processes.
KOKKOS_INLINE_FUNCTION LO GetNumAggregates() const
typename std::conditional< OnHost, typename local_graph_device_type::HostMirror, local_graph_device_type >::type local_graph_type
RCP< LOVector > procWinner_
const RCP< const Map > GetMap() const
returns (overlapping) map of aggregate/node distribution
colors_view_type graphColors_
void SetIndexManager(RCP< IndexManager > &geoData)
Set the index manager used by various aggregation algorithms. This has to be done by the aggregation ...
void SetIsRoot(LO i, bool value=true)
Set root node information.
GlobalOrdinal global_ordinal_type
RCP< LOMultiVector > & GetVertex2AggIdNonConst()
Returns a nonconstant vector that maps local node IDs to local aggregates IDs.
LO GetGraphNumColors()
Get the number of colors needed by the distance 2 coloring.
MueLu::DefaultGlobalOrdinal GlobalOrdinal
LO numAggregates_
Number of aggregates on this processor.
colors_view_type & GetGraphColors()
Get a distance 2 coloring of the underlying graph. The coloring is computed and set during Phase1 of ...
aggregates_sizes_type::HostMirror aggregateSizesHost_
RCP< IndexManager_kokkos > geoDataKokkos_
typename LWGraph_kokkos::local_graph_type local_graph_type
RCP< LOVector > & GetProcWinnerNonConst()
Returns nonconstant vector that maps local node IDs to owning processor IDs.
void ComputeNodesInAggregate(LO_view &aggPtr, LO_view &aggNodes, LO_view &unaggregated) const
Generates a compressed list of nodes in each aggregate, where the entries in aggNodes[aggPtr[i]] up t...
void SetGraphColors(colors_view_type graphColors)
Set a distance 2 coloring of the underlying graph. The coloring is computed and set during Phase1 of ...
GO GetNumGlobalAggregatesComputeIfNeeded()
Get global number of aggregates.
Teuchos::ArrayRCP< LocalOrdinal > ComputeAggregateSizesArrayRCP(bool forceRecompute=false) const
Compute sizes of aggregates.
Teuchos::ArrayRCP< bool > isRoot_
An ArrayRCP of booleans specifying if a local entry is an aggregate root.
const RCP< LOMultiVector > & GetVertex2AggId() const
Returns constant vector that maps local node IDs to local aggregates IDs.
aggregates_sizes_type aggregateSizes_
Array of sizes of each local aggregate.
Kokkos::RangePolicy< local_ordinal_type, execution_space > range_type
LocalOrdinal local_ordinal_type
Kokkos::View< typename local_graph_type::entries_type::data_type, typename local_graph_type::device_type::memory_space > colors_view_type
void SetNumGlobalAggregates(GO nGlobalAggregates)
Set number of global aggregates on current processor.
static const EVerbosityLevel verbLevel_default
Base class for MueLu classes.
RCP< LOMultiVector > vertex2AggId_
Kokkos::View< local_ordinal_type *, device_type > LO_view
GO numGlobalAggregates_
Number of global aggregates.
Lightweight MueLu representation of a compressed row storage graph.
bool IsRoot(LO i) const
Returns true if node with given local node id is marked to be a root node.
Aggregates(const LWGraph &graph)
Standard constructor for Aggregates structure.
KOKKOS_INLINE_FUNCTION void AggregatesCrossProcessors(const bool &flag)
Record whether aggregates include DOFs from other processes.
void print(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
std::string description() const
Return a simple one-line description of this object.
local_graph_type GetGraph() const
KOKKOS_INLINE_FUNCTION bool AggregatesCrossProcessors() const
Return false if and only if no aggregates include DOFs from other processes.
aggregates_sizes_type::const_type ComputeAggregateSizes(bool forceRecompute=false) const
Compute sizes of aggregates.
local_graph_type graph_
Aggregates represented as Kokkos graph type.
void SetNumAggregates(LO nAggregates)
Set number of local aggregates on current processor.
RCP< IndexManager_kokkos > & GetIndexManagerKokkos()
Get the index manager used by structured aggregation algorithms. This has to be done by the aggregati...