47 #ifndef MUELU_AGGREGATES_KOKKOS_DECL_HPP 48 #define MUELU_AGGREGATES_KOKKOS_DECL_HPP 52 #include <Kokkos_StaticCrsGraph.hpp> 53 #include <KokkosCompat_ClassicNodeAPI_Wrapper.hpp> 57 #include <Xpetra_Map_fwd.hpp> 58 #include <Xpetra_Vector_fwd.hpp> 59 #include <Xpetra_VectorFactory_fwd.hpp> 63 #include "MueLu_LWGraph_kokkos.hpp" 64 #include "MueLu_IndexManager_kokkos.hpp" 66 #define MUELU_UNAGGREGATED -1 69 #define MUELU_UNASSIGNED -1 102 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
105 template <
class LocalOrdinal,
class GlobalOrdinal,
class DeviceType>
115 using node_type = Kokkos::Compat::KokkosDeviceWrapperNode<DeviceType>;
117 using range_type = Kokkos::RangePolicy<local_ordinal_type, execution_space>;
118 using LO_view = Kokkos::View<local_ordinal_type*, device_type>;
125 #undef MUELU_AGGREGATES_KOKKOS_SHORT 132 using colors_view_type = Kokkos::View<
typename local_graph_type::entries_type::data_type,
133 typename local_graph_type::device_type::memory_space>;
203 return numAggregates_;
208 aggregatesIncludeGhosts_ = flag;
216 return aggregatesIncludeGhosts_;
243 KOKKOS_INLINE_FUNCTION
244 bool IsRoot(LO i)
const {
return isRoot_(i); }
250 KOKKOS_INLINE_FUNCTION
251 void SetIsRoot(LO i,
bool value =
true) { isRoot_(i) = value; }
253 const RCP<const Map> GetMap()
const;
264 typename aggregates_sizes_type::const_type ComputeAggregateSizes(
bool forceRecompute =
false)
const;
266 local_graph_type GetGraph()
const;
272 void ComputeNodesInAggregate(LO_view & aggPtr, LO_view & aggNodes, LO_view & unaggregated)
const;
276 GO GetNumGlobalAggregatesComputeIfNeeded();
282 std::string description()
const;
286 void print(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = verbLevel_default)
const;
335 #define MUELU_AGGREGATES_KOKKOS_SHORT 336 #endif // MUELU_AGGREGATES_KOKKOS_DECL_HPP
void SetGraphNumColors(const LO graphNumColors)
Set the number of colors needed by the distance 2 coloring.
MueLu::DefaultLocalOrdinal LocalOrdinal
Lightweight MueLu representation of a compressed row storage graph.
RCP< LOVector > & GetVertex2AggIdNonConst()
Returns a nonconstant vector that maps local node IDs to local aggregates IDs.
RCP< IndexManager_kokkos > & GetIndexManager()
Get the index manager used by structured aggregation algorithms. This has to be done by the aggregati...
typename DeviceType::execution_space execution_space
Kokkos::View< bool *, device_type > isRoot_
bool aggregatesIncludeGhosts_
Set to false iff aggregates do not include any DOFs belong to other processes.
Namespace for MueLu classes and methods.
Kokkos::RangePolicy< local_ordinal_type, execution_space > range_type
const RCP< LOVector > & GetVertex2AggId() const
Returns constant vector that maps local node IDs to local aggregates IDs.
Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > node_type
KOKKOS_INLINE_FUNCTION LO GetNumAggregates() const
const RCP< LOVector > & GetProcWinner() const
Returns constant vector that maps local node IDs to owning processor IDs.
Kokkos::View< LocalOrdinal *, device_type > aggregates_sizes_type
LO numAggregates_
Number of aggregates on this processor.
void SetGraphColors(colors_view_type graphColors)
Set a distance 2 coloring of the underlying graph. The coloring is computed and set during Phase1 of ...
LO GetGraphNumColors()
Get the number of colors needed by the distance 2 coloring.
typename LWGraph_kokkos::local_graph_type local_graph_type
MueLu::DefaultGlobalOrdinal GlobalOrdinal
virtual ~Aggregates_kokkos()
Destructor.
void SetIndexManager(RCP< IndexManager_kokkos > &geoData)
Set the index manager used by structured aggregation algorithms. This has to be done by the aggregati...
RCP< LOVector > vertex2AggId_
colors_view_type graphColors_
RCP< LOVector > & GetProcWinnerNonConst()
Returns nonconsant vector that maps local node IDs to owning processor IDs.
RCP< LOVector > procWinner_
RCP< IndexManager_kokkos > geoData_
KOKKOS_INLINE_FUNCTION void SetIsRoot(LO i, bool value=true)
Set root node information.
Kokkos::View< local_ordinal_type *, device_type > LO_view
Base class for MueLu classes.
aggregates_sizes_type aggregateSizes_
Array of sizes of each local aggregate.
void SetNumAggregates(LO nAggregates)
Set number of local aggregates on current processor.
KOKKOS_INLINE_FUNCTION void AggregatesCrossProcessors(const bool &flag)
Record whether aggregates include DOFs from other processes.
Kokkos::View< typename local_graph_type::entries_type::data_type, typename local_graph_type::device_type::memory_space > colors_view_type
GO numGlobalAggregates_
Number of global aggregates.
colors_view_type & GetGraphColors()
Get a distance 2 coloring of the underlying graph. The coloring is computed and set during Phase1 of ...
KOKKOS_INLINE_FUNCTION bool AggregatesCrossProcessors() const
Return false if and only if no aggregates include DOFs from other processes.
void SetNumGlobalAggregates(GO nGlobalAggregates)
Set number of global aggregates on current processor.
LocalOrdinal local_ordinal_type
local_graph_type graph_
Aggregates represented as Kokkos graph type.
GlobalOrdinal global_ordinal_type
KOKKOS_INLINE_FUNCTION bool IsRoot(LO i) const
Returns true if node with given local node id is marked to be a root node.