41 #ifndef TPETRA_CRSGRAPH_DECL_HPP
42 #define TPETRA_CRSGRAPH_DECL_HPP
50 #include "Tpetra_DistObject.hpp"
51 #include "Tpetra_Exceptions.hpp"
52 #include "Tpetra_RowGraph.hpp"
54 #include "Tpetra_Details_WrappedDualView.hpp"
56 #include "KokkosSparse_findRelOffset.hpp"
57 #include "Kokkos_DualView.hpp"
58 #include "Kokkos_StaticCrsGraph.hpp"
60 #include "Teuchos_CommHelpers.hpp"
61 #include "Teuchos_Describable.hpp"
62 #include "Teuchos_OrdinalTraits.hpp"
63 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
72 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
class crsGraph_Swap_Tester;
74 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76 template<
class LocalOrdinal,
83 template<
class ViewType>
84 struct UnmanagedView {
85 static_assert (Kokkos::is_view<ViewType>::value,
86 "ViewType must be a Kokkos::View specialization.");
90 typedef Kokkos::View<
typename ViewType::data_type,
91 typename ViewType::array_layout,
92 typename ViewType::device_type,
93 Kokkos::MemoryUnmanaged> type;
97 #endif // DOXYGEN_SHOULD_SKIP_THIS
216 template <
class LocalOrdinal,
220 public RowGraph<LocalOrdinal, GlobalOrdinal, Node>,
225 public Teuchos::ParameterListAcceptorDefaultBase
227 template <
class S,
class LO,
class GO,
class N>
229 template <
class LO2,
class GO2,
class N2>
231 template <
class LO,
class GO,
class N>
270 using local_inds_dualv_type =
271 Kokkos::DualView<local_ordinal_type*, device_type>;
276 using global_inds_dualv_type =
277 Kokkos::DualView<global_ordinal_type*, device_type>;
283 using row_ptrs_device_view_type =
284 typename row_graph_type::row_ptrs_device_view_type;
285 using row_ptrs_host_view_type =
286 typename row_graph_type::row_ptrs_host_view_type;
290 typename row_graph_type::local_inds_device_view_type;
291 using local_inds_host_view_type =
292 typename row_graph_type::local_inds_host_view_type;
293 using nonconst_local_inds_host_view_type =
294 typename row_graph_type::nonconst_local_inds_host_view_type;
298 typename row_graph_type::global_inds_device_view_type;
299 using global_inds_host_view_type =
300 typename row_graph_type::global_inds_host_view_type;
301 using nonconst_global_inds_host_view_type =
302 typename row_graph_type::nonconst_global_inds_host_view_type;
304 using offset_device_view_type =
305 typename row_ptrs_device_view_type::non_const_type;
322 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
323 const size_t maxNumEntriesPerRow,
324 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
338 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
339 const Kokkos::DualView<const size_t*, device_type>& numEntPerRow,
340 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
355 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
356 const Teuchos::ArrayView<const size_t>& numEntPerRow,
357 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
376 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
377 const Teuchos::RCP<const map_type>& colMap,
378 const size_t maxNumEntriesPerRow,
379 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
395 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
396 const Teuchos::RCP<const map_type>& colMap,
397 const Kokkos::DualView<const size_t*, device_type>& numEntPerRow,
398 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
415 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
416 const Teuchos::RCP<const map_type>& colMap,
417 const Teuchos::ArrayView<const size_t>& numEntPerRow,
418 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
433 const Teuchos::RCP<const map_type>& rowMap,
434 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
458 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
459 const Teuchos::RCP<const map_type>& colMap,
460 const typename local_graph_device_type::row_map_type& rowPointers,
461 const typename local_graph_device_type::entries_type::non_const_type& columnIndices,
462 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
486 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
487 const Teuchos::RCP<const map_type>& colMap,
488 const Teuchos::ArrayRCP<size_t>& rowPointers,
489 const Teuchos::ArrayRCP<local_ordinal_type>& columnIndices,
490 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
513 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
514 const Teuchos::RCP<const map_type>& colMap,
516 const Teuchos::RCP<Teuchos::ParameterList>& params);
545 const Teuchos::RCP<const map_type>& rowMap,
546 const Teuchos::RCP<const map_type>& colMap,
547 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
548 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
549 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
556 const Teuchos::RCP<const map_type>& rowMap,
557 const Teuchos::RCP<const map_type>& colMap,
558 const Teuchos::RCP<const map_type>& domainMap,
559 const Teuchos::RCP<const map_type>& rangeMap,
560 const Teuchos::RCP<const import_type>& importer,
561 const Teuchos::RCP<const export_type>& exporter,
562 const Teuchos::RCP<Teuchos::ParameterList>& params =
640 setParameterList (
const Teuchos::RCP<Teuchos::ParameterList>& params)
override;
643 Teuchos::RCP<const Teuchos::ParameterList>
673 const Teuchos::ArrayView<const global_ordinal_type>& indices);
703 const Teuchos::ArrayView<const local_ordinal_type>& indices);
760 resumeFill (
const Teuchos::RCP<Teuchos::ParameterList>& params =
801 fillComplete (
const Teuchos::RCP<const map_type>& domainMap,
802 const Teuchos::RCP<const map_type>& rangeMap,
803 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
833 fillComplete (
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
865 const Teuchos::RCP<const map_type>& rangeMap,
866 const Teuchos::RCP<const import_type>& importer =
868 const Teuchos::RCP<const export_type>& exporter =
870 const Teuchos::RCP<Teuchos::ParameterList>& params =
877 Teuchos::RCP<const Teuchos::Comm<int> >
getComm()
const override;
881 Teuchos::RCP<const map_type>
getRowMap ()
const override;
884 Teuchos::RCP<const map_type>
getColMap ()
const override;
887 Teuchos::RCP<const map_type>
getDomainMap ()
const override;
890 Teuchos::RCP<const map_type>
getRangeMap ()
const override;
893 Teuchos::RCP<const import_type>
getImporter ()
const override;
896 Teuchos::RCP<const export_type>
getExporter ()
const override;
1078 nonconst_global_inds_host_view_type &gblColInds,
1079 size_t& numColInds)
const override;
1090 nonconst_local_inds_host_view_type &gblColInds,
1091 size_t& numColInds)
const override;
1106 global_inds_host_view_type &gblColInds)
const override;
1126 const LocalOrdinal lclRow,
1127 local_inds_host_view_type &lclColInds)
const override;
1140 describe (Teuchos::FancyOStream& out,
1141 const Teuchos::EVerbosityLevel verbLevel =
1142 Teuchos::Describable::verbLevel_default)
const override;
1168 const size_t numSameIDs,
1180 const bool verbose);
1182 std::unique_ptr<padding_type>
1186 const size_t numSameIDs,
1191 const bool verbose)
const;
1194 std::unique_ptr<padding_type>
1195 computeCrsPaddingForImports(
1198 Kokkos::DualView<packet_type*, buffer_device_type> imports,
1199 Kokkos::DualView<size_t*, buffer_device_type> numPacketsPerLID,
1200 const bool verbose)
const;
1202 std::unique_ptr<padding_type>
1203 computePaddingForCrsMatrixUnpack(
1206 Kokkos::DualView<char*, buffer_device_type> imports,
1207 Kokkos::DualView<size_t*, buffer_device_type> numPacketsPerLID,
1208 const bool verbose)
const;
1211 computeCrsPaddingForSameIDs(
1218 computeCrsPaddingForPermutedIDs(
1230 const Kokkos::DualView<const local_ordinal_type*, buffer_device_type>& exportLIDs,
1231 Kokkos::DualView<packet_type*, buffer_device_type>& exports,
1232 Kokkos::DualView<size_t*, buffer_device_type> numPacketsPerLID,
1233 size_t& constantNumPackets)
override;
1243 pack (
const Teuchos::ArrayView<const local_ordinal_type>& exportLIDs,
1244 Teuchos::Array<global_ordinal_type>& exports,
1245 const Teuchos::ArrayView<size_t>& numPacketsPerLID,
1246 size_t& constantNumPackets)
const override;
1249 packFillActive (
const Teuchos::ArrayView<const local_ordinal_type>& exportLIDs,
1250 Teuchos::Array<global_ordinal_type>& exports,
1251 const Teuchos::ArrayView<size_t>& numPacketsPerLID,
1252 size_t& constantNumPackets)
const;
1259 Kokkos::DualView<
size_t*,
1261 size_t& constantNumPackets)
const;
1276 Kokkos::DualView<
size_t*,
1278 const size_t constantNumPackets,
1328 getLocalDiagOffsets (
const Kokkos::View<size_t*, device_type, Kokkos::MemoryUnmanaged>& offsets)
const;
1356 setAllIndices (
const typename local_graph_device_type::row_map_type& rowPointers,
1357 const typename local_graph_device_type::entries_type::non_const_type& columnIndices);
1369 setAllIndices (
const Teuchos::ArrayRCP<size_t> & rowPointers,
1370 const Teuchos::ArrayRCP<local_ordinal_type> & columnIndices);
1404 void replaceColMap (
const Teuchos::RCP<const map_type>& newColMap);
1427 const Teuchos::RCP<const import_type>& newImport = Teuchos::null,
1428 const bool sortIndicesInEachRow =
true);
1454 const Teuchos::RCP<const import_type>& newImporter);
1480 const Teuchos::RCP<const export_type>& newExporter);
1514 template<
class DestViewType,
class SrcViewType,
1515 class DestOffsetViewType,
class SrcOffsetViewType >
1516 struct pack_functor {
1520 SrcOffsetViewType src_offset;
1521 DestOffsetViewType dest_offset;
1522 typedef typename DestOffsetViewType::non_const_value_type ScalarIndx;
1524 pack_functor(DestViewType dest_,
1525 const SrcViewType src_,
1526 DestOffsetViewType dest_offset_,
1527 const SrcOffsetViewType src_offset_):
1528 src(src_),dest(dest_),
1529 src_offset(src_offset_),dest_offset(dest_offset_) {};
1531 KOKKOS_INLINE_FUNCTION
1532 void operator() (
size_t row)
const {
1533 ScalarIndx i = src_offset(row);
1534 ScalarIndx j = dest_offset(row);
1535 const ScalarIndx k = dest_offset(row+1);
1544 template<
class CrsGraphType>
1545 friend Teuchos::RCP<CrsGraphType>
1546 importAndFillCompleteCrsGraph (
const Teuchos::RCP<const CrsGraphType>& sourceGraph,
1547 const Import<
typename CrsGraphType::local_ordinal_type,
1548 typename CrsGraphType::global_ordinal_type,
1549 typename CrsGraphType::node_type>& importer,
1550 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1551 typename CrsGraphType::global_ordinal_type,
1552 typename CrsGraphType::node_type> >& domainMap,
1553 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1554 typename CrsGraphType::global_ordinal_type,
1555 typename CrsGraphType::node_type> >& rangeMap,
1556 const Teuchos::RCP<Teuchos::ParameterList>& params);
1559 template<
class CrsGraphType>
1560 friend Teuchos::RCP<CrsGraphType>
1561 importAndFillCompleteCrsGraph (
const Teuchos::RCP<const CrsGraphType>& sourceGraph,
1562 const Import<
typename CrsGraphType::local_ordinal_type,
1563 typename CrsGraphType::global_ordinal_type,
1564 typename CrsGraphType::node_type>& rowImporter,
1565 const Import<
typename CrsGraphType::local_ordinal_type,
1566 typename CrsGraphType::global_ordinal_type,
1567 typename CrsGraphType::node_type>& domainImporter,
1568 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1569 typename CrsGraphType::global_ordinal_type,
1570 typename CrsGraphType::node_type> >& domainMap,
1571 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1572 typename CrsGraphType::global_ordinal_type,
1573 typename CrsGraphType::node_type> >& rangeMap,
1574 const Teuchos::RCP<Teuchos::ParameterList>& params);
1578 template<
class CrsGraphType>
1579 friend Teuchos::RCP<CrsGraphType>
1580 exportAndFillCompleteCrsGraph (
const Teuchos::RCP<const CrsGraphType>& sourceGraph,
1581 const Export<
typename CrsGraphType::local_ordinal_type,
1582 typename CrsGraphType::global_ordinal_type,
1583 typename CrsGraphType::node_type>& exporter,
1584 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1585 typename CrsGraphType::global_ordinal_type,
1586 typename CrsGraphType::node_type> >& domainMap,
1587 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1588 typename CrsGraphType::global_ordinal_type,
1589 typename CrsGraphType::node_type> >& rangeMap,
1590 const Teuchos::RCP<Teuchos::ParameterList>& params);
1593 template<
class CrsGraphType>
1594 friend Teuchos::RCP<CrsGraphType>
1595 exportAndFillCompleteCrsGraph (
const Teuchos::RCP<const CrsGraphType>& sourceGraph,
1596 const Export<
typename CrsGraphType::local_ordinal_type,
1597 typename CrsGraphType::global_ordinal_type,
1598 typename CrsGraphType::node_type>& rowExporter,
1599 const Export<
typename CrsGraphType::local_ordinal_type,
1600 typename CrsGraphType::global_ordinal_type,
1601 typename CrsGraphType::node_type>& domainExporter,
1602 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1603 typename CrsGraphType::global_ordinal_type,
1604 typename CrsGraphType::node_type> >& domainMap,
1605 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1606 typename CrsGraphType::global_ordinal_type,
1607 typename CrsGraphType::node_type> >& rangeMap,
1608 const Teuchos::RCP<Teuchos::ParameterList>& params);
1627 importAndFillComplete (Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node> >& destGraph,
1629 const Teuchos::RCP<const map_type>& domainMap,
1630 const Teuchos::RCP<const map_type>& rangeMap,
1631 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
const;
1649 importAndFillComplete (Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node> >& destGraph,
1652 const Teuchos::RCP<const map_type>& domainMap,
1653 const Teuchos::RCP<const map_type>& rangeMap,
1654 const Teuchos::RCP<Teuchos::ParameterList>& params)
const;
1673 exportAndFillComplete (Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node> >& destGraph,
1675 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
1676 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
1677 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
const;
1695 exportAndFillComplete (Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node> >& destGraph,
1698 const Teuchos::RCP<const map_type>& domainMap,
1699 const Teuchos::RCP<const map_type>& rangeMap,
1700 const Teuchos::RCP<Teuchos::ParameterList>& params)
const;
1725 transferAndFillComplete (Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node> >& destGraph,
1726 const ::Tpetra::Details::Transfer<local_ordinal_type, global_ordinal_type, Node>& rowTransfer,
1727 const Teuchos::RCP<const ::Tpetra::Details::Transfer<local_ordinal_type, global_ordinal_type, Node> > & domainTransfer,
1728 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
1729 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
1730 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
const;
1735 struct SLocalGlobalViews {
1736 Teuchos::ArrayView<const global_ordinal_type> ginds;
1737 Teuchos::ArrayView<const local_ordinal_type> linds;
1739 struct SLocalGlobalNCViews {
1740 Teuchos::ArrayView<global_ordinal_type> ginds;
1741 Teuchos::ArrayView<local_ordinal_type> linds;
1744 bool indicesAreAllocated ()
const;
1747 allocateIndices(
const ELocalGlobal lg,
const bool verbose=
false);
1761 void makeColMap (Teuchos::Array<int>& remotePIDs);
1783 std::pair<size_t, std::string>
1796 const bool useRemotePIDs);
1838 const SLocalGlobalViews& newInds,
1839 const ELocalGlobal lg,
1840 const ELocalGlobal I);
1854 const size_t numInputInds);
1868 const size_t numInputInds,
1869 std::function<
void(
const size_t,
const size_t,
const size_t)> fun =
1870 std::function<
void(
const size_t,
const size_t,
const size_t)>());
1874 const Teuchos::ArrayView<const local_ordinal_type>& gblColInds,
1875 std::function<
void(
const size_t,
const size_t,
const size_t)> fun =
1876 std::function<
void(
const size_t,
const size_t,
const size_t)>());
1895 const Teuchos::ArrayView<const global_ordinal_type>& indices,
1896 std::function<
void(
const size_t,
const size_t,
const size_t)> fun)
const;
1935 #ifdef KOKKOS_ENABLE_SERIAL
1936 ! std::is_same<execution_space, Kokkos::Serial>::value;
1939 #endif // KOKKOS_ENABLE_SERIAL
1961 sortAndMergeAllIndices (
const bool sorted,
const bool merged);
1990 const Teuchos::RCP<const map_type>& rangeMap);
1992 void staticAssertions()
const;
1993 void clearGlobalConstants();
2018 bool haveLocalOffRankOffsets()
const {
return haveLocalOffRankOffsets_;}
2074 void fillLocalGraph (
const Teuchos::RCP<Teuchos::ParameterList>& params);
2082 void swap(CrsGraph<local_ordinal_type, global_ordinal_type, Node> & graph);
2117 Teuchos::OrdinalTraits<size_t>::invalid();
2123 Teuchos::OrdinalTraits<global_size_t>::invalid();
2130 Teuchos::OrdinalTraits<global_size_t>::invalid();
2144 row_ptrs_device_view_type rowPtrsUnpacked_dev_;
2145 mutable row_ptrs_host_view_type rowPtrsUnpacked_host_;
2150 row_ptrs_device_view_type rowPtrsPacked_dev_;
2151 mutable row_ptrs_host_view_type rowPtrsPacked_host_;
2154 bool packedUnpackedRowPtrsMatch_ =
false;
2157 void setRowPtrsUnpacked(
const row_ptrs_device_view_type &dview) {
2158 packedUnpackedRowPtrsMatch_ =
false;
2159 rowPtrsUnpacked_dev_ = dview;
2161 rowPtrsUnpacked_host_ = row_ptrs_host_view_type();
2167 return rowPtrsUnpacked_dev_;
2173 if(rowPtrsUnpacked_host_.extent(0) != rowPtrsUnpacked_dev_.extent(0))
2179 if constexpr(std::is_same_v<typename Node::memory_space, Kokkos::HostSpace>)
2181 rowPtrsUnpacked_host_ = rowPtrsUnpacked_dev_;
2186 typename row_ptrs_host_view_type::non_const_type rowPtrsTemp(
2187 Kokkos::view_alloc(Kokkos::WithoutInitializing,
"rowPtrsUnpacked_host_"), rowPtrsUnpacked_dev_.extent(0));
2189 rowPtrsUnpacked_host_= rowPtrsTemp;
2192 if(packedUnpackedRowPtrsMatch_)
2194 rowPtrsPacked_host_ = rowPtrsUnpacked_host_;
2197 return rowPtrsUnpacked_host_;
2200 void setRowPtrsPacked(
const row_ptrs_device_view_type &dview) {
2201 packedUnpackedRowPtrsMatch_ =
false;
2202 rowPtrsPacked_dev_ = dview;
2204 rowPtrsPacked_host_ = row_ptrs_host_view_type();
2210 return rowPtrsPacked_dev_;
2216 if(rowPtrsPacked_host_.extent(0) != rowPtrsPacked_dev_.extent(0))
2222 if constexpr(std::is_same_v<typename Node::memory_space, Kokkos::HostSpace>)
2224 rowPtrsPacked_host_ = rowPtrsPacked_dev_;
2229 typename row_ptrs_host_view_type::non_const_type rowPtrsTemp(
2230 Kokkos::view_alloc(Kokkos::WithoutInitializing,
"rowPtrsPacked_host_"), rowPtrsPacked_dev_.extent(0));
2232 rowPtrsPacked_host_= rowPtrsTemp;
2235 if(packedUnpackedRowPtrsMatch_)
2237 rowPtrsUnpacked_host_ = rowPtrsPacked_host_;
2240 return rowPtrsPacked_host_;
2247 void setRowPtrs(
const row_ptrs_device_view_type &dview) {
2248 packedUnpackedRowPtrsMatch_ =
true;
2249 rowPtrsUnpacked_dev_ = dview;
2250 rowPtrsPacked_dev_ = dview;
2252 rowPtrsUnpacked_host_ = row_ptrs_host_view_type();
2253 rowPtrsPacked_host_ = row_ptrs_host_view_type();
2306 typename local_inds_dualv_type::t_host::const_type
2312 typename local_inds_dualv_type::t_dev::const_type
2318 typename global_inds_dualv_type::t_host::const_type
2324 typename global_inds_dualv_type::t_dev::const_type
2330 typename local_inds_dualv_type::t_host
2362 typename Kokkos::View<const size_t*, device_type>::HostMirror
2447 Details::STORAGE_1D_UNPACKED;
2449 bool indicesAreAllocated_ =
false;
2450 bool indicesAreLocal_ =
false;
2451 bool indicesAreGlobal_ =
false;
2452 bool fillComplete_ =
false;
2464 mutable bool haveLocalOffRankOffsets_ =
false;
2466 typedef typename std::map<global_ordinal_type, std::vector<global_ordinal_type> > nonlocals_type;
2489 static bool getDebug();
2493 bool debug_ = getDebug();
2496 static bool getVerbose();
2501 bool verbose_ = getVerbose();
2505 mutable bool need_sync_host_uvm_access =
false;
2508 void set_need_sync_host_uvm_access() {
2509 need_sync_host_uvm_access =
true;
2513 void execute_sync_host_uvm_access()
const {
2514 if(need_sync_host_uvm_access) {
2515 Kokkos::fence(
"CrsGraph::execute_sync_host_uvm_access");
2516 need_sync_host_uvm_access =
false;
2528 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2529 Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
2533 size_t maxNumEntriesPerRow = 0,
2534 const Teuchos::RCP<Teuchos::ParameterList>& params =
2539 return rcp(
new graph_type(map, maxNumEntriesPerRow,
2592 template<
class CrsGraphType>
2593 Teuchos::RCP<CrsGraphType>
2595 const Import<
typename CrsGraphType::local_ordinal_type,
2596 typename CrsGraphType::global_ordinal_type,
2597 typename CrsGraphType::node_type>& importer,
2598 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2599 typename CrsGraphType::global_ordinal_type,
2600 typename CrsGraphType::node_type> >& domainMap = Teuchos::null,
2601 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2602 typename CrsGraphType::global_ordinal_type,
2603 typename CrsGraphType::node_type> >& rangeMap = Teuchos::null,
2604 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
2606 Teuchos::RCP<CrsGraphType> destGraph;
2607 sourceGraph->importAndFillComplete (destGraph,importer,domainMap, rangeMap, params);
2661 template<
class CrsGraphType>
2662 Teuchos::RCP<CrsGraphType>
2664 const Import<
typename CrsGraphType::local_ordinal_type,
2665 typename CrsGraphType::global_ordinal_type,
2666 typename CrsGraphType::node_type>& rowImporter,
2667 const Import<
typename CrsGraphType::local_ordinal_type,
2668 typename CrsGraphType::global_ordinal_type,
2669 typename CrsGraphType::node_type>& domainImporter,
2670 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2671 typename CrsGraphType::global_ordinal_type,
2672 typename CrsGraphType::node_type> >& domainMap,
2673 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2674 typename CrsGraphType::global_ordinal_type,
2675 typename CrsGraphType::node_type> >& rangeMap,
2676 const Teuchos::RCP<Teuchos::ParameterList>& params)
2678 Teuchos::RCP<CrsGraphType> destGraph;
2679 sourceGraph->importAndFillComplete (destGraph,rowImporter,domainImporter, domainMap, rangeMap, params);
2716 template<
class CrsGraphType>
2717 Teuchos::RCP<CrsGraphType>
2719 const Export<
typename CrsGraphType::local_ordinal_type,
2720 typename CrsGraphType::global_ordinal_type,
2721 typename CrsGraphType::node_type>& exporter,
2722 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2723 typename CrsGraphType::global_ordinal_type,
2724 typename CrsGraphType::node_type> >& domainMap = Teuchos::null,
2725 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2726 typename CrsGraphType::global_ordinal_type,
2727 typename CrsGraphType::node_type> >& rangeMap = Teuchos::null,
2728 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
2730 Teuchos::RCP<CrsGraphType> destGraph;
2731 sourceGraph->exportAndFillComplete (destGraph,exporter,domainMap, rangeMap, params);
2768 template<
class CrsGraphType>
2769 Teuchos::RCP<CrsGraphType>
2771 const Export<
typename CrsGraphType::local_ordinal_type,
2772 typename CrsGraphType::global_ordinal_type,
2773 typename CrsGraphType::node_type>& rowExporter,
2774 const Export<
typename CrsGraphType::local_ordinal_type,
2775 typename CrsGraphType::global_ordinal_type,
2776 typename CrsGraphType::node_type>& domainExporter,
2777 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2778 typename CrsGraphType::global_ordinal_type,
2779 typename CrsGraphType::node_type> >& domainMap,
2780 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2781 typename CrsGraphType::global_ordinal_type,
2782 typename CrsGraphType::node_type> >& rangeMap,
2783 const Teuchos::RCP<Teuchos::ParameterList>& params)
2785 Teuchos::RCP<CrsGraphType> destGraph;
2786 sourceGraph->exportAndFillComplete (destGraph,rowExporter,domainExporter,domainMap, rangeMap, params);
2793 #endif // TPETRA_CRSGRAPH_DECL_HPP
Communication plan for data redistribution from a uniquely-owned to a (possibly) multiply-owned distr...
void setDomainRangeMaps(const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap)
void setAllIndices(const typename local_graph_device_type::row_map_type &rowPointers, const typename local_graph_device_type::entries_type::non_const_type &columnIndices)
Set the graph's data directly, using 1-D storage.
Teuchos::RCP< const map_type > getRowMap() const override
Returns the Map that describes the row distribution in this graph.
offset_device_view_type k_offRankOffsets_
The offsets for off-rank entries.
size_t nodeMaxNumRowEntries_
Local maximum of the number of entries in each row.
bool indicesAreSorted_
Whether the graph's indices are sorted in each row, on this process.
A distributed graph accessed by rows (adjacency lists) and stored sparsely.
::Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node > export_type
The Export specialization used by this class.
Sparse matrix that presents a row-oriented interface that lets users read or modify entries...
Teuchos::RCP< const map_type > rangeMap_
The Map describing the range of the (matrix corresponding to the) graph.
Teuchos::RCP< const map_type > getColMap() const override
Returns the Map that describes the column distribution in this graph.
local_inds_host_view_type getLocalIndicesHost() const
Get a host view of the packed column indicies.
GO global_ordinal_type
The type of the graph's global indices.
local_inds_dualv_type::t_host::const_type getLocalIndsViewHost(const RowInfo &rowinfo) const
Get a const, locally indexed view of the locally owned row myRow, such that rowinfo = getRowInfo(myRo...
An abstract interface for graphs accessed by rows.
Kokkos::View< const size_t *, device_type >::HostMirror k_numAllocPerRow_
The maximum number of entries to allow in each locally owned row, per row.
void getLocalOffRankOffsets(offset_device_view_type &offsets) const
Get offsets of the off-rank entries in the graph.
void insertGlobalIndicesFiltered(const local_ordinal_type lclRow, const global_ordinal_type gblColInds[], const local_ordinal_type numGblColInds)
Like insertGlobalIndices(), but with column Map filtering.
local_inds_dualv_type::t_host getLocalIndsViewHostNonConst(const RowInfo &rowinfo)
Get a ReadWrite locally indexed view of the locally owned row myRow, such that rowinfo = getRowInfo(m...
bool sortGhostsAssociatedWithEachProcessor_
Whether to require makeColMap() (and therefore fillComplete()) to order column Map GIDs associated wi...
virtual void copyAndPermute(const SrcDistObject &source, const size_t numSameIDs, const Kokkos::DualView< const local_ordinal_type *, buffer_device_type > &permuteToLIDs, const Kokkos::DualView< const local_ordinal_type *, buffer_device_type > &permuteFromLIDs, const CombineMode CM)
Perform copies and permutations that are local to the calling (MPI) process.
size_t insertGlobalIndicesImpl(const local_ordinal_type lclRow, const global_ordinal_type inputGblColInds[], const size_t numInputInds)
Insert global indices, using an input local row index.
void resumeFill(const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Resume fill operations.
bool haveGlobalConstants_
Whether all processes have computed global constants.
size_t getLocalNumRows() const override
Returns the number of graph rows owned on the calling node.
void expertStaticFillComplete(const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap, const Teuchos::RCP< const import_type > &importer=Teuchos::null, const Teuchos::RCP< const export_type > &exporter=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Perform a fillComplete on a graph that already has data, via setAllIndices().
Teuchos::RCP< const import_type > getImporter() const override
Returns the importer associated with this graph.
void getLocalDiagOffsets(const Kokkos::View< size_t *, device_type, Kokkos::MemoryUnmanaged > &offsets) const
Get offsets of the diagonal entries in the graph.
void insertGlobalIndices(const global_ordinal_type globalRow, const Teuchos::ArrayView< const global_ordinal_type > &indices)
Insert global indices into the graph.
size_t getNumEntriesInLocalRow(local_ordinal_type localRow) const override
Get the number of entries in the given row (local index).
size_t getLocalAllocationSize() const
The local number of indices allocated for the graph, over all rows on the calling (MPI) process...
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Default parameter list suitable for validation.
void computeLocalConstants()
Compute local constants, if they have not yet been computed.
typename row_graph_type::local_inds_device_view_type local_inds_device_view_type
The Kokkos::View type for views of local ordinals on device and host.
bool isIdenticalTo(const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > &graph) const
Create a cloned CrsGraph for a different Node type.
bool isMerged() const
Whether duplicate column indices in each row have been merged.
Kokkos::StaticCrsGraph< local_ordinal_type, Kokkos::LayoutLeft, device_type, void, size_t > local_graph_device_type
The type of the part of the sparse graph on each MPI process.
virtual bool checkSizes(const SrcDistObject &source) override
Compare the source and target (this) objects for compatibility.
Forward declaration of Tpetra::BlockCrsMatrix.
Teuchos::RCP< const map_type > getDomainMap() const override
Returns the Map associated with the domain of this graph.
size_t getGlobalMaxNumRowEntries() const override
Maximum number of entries in any row of the graph, over all processes in the graph's communicator...
virtual ~CrsGraph()=default
Destructor (virtual for memory safety of derived classes).
bool noRedundancies_
Whether the graph's indices are non-redundant (merged) in each row, on this process.
global_inds_dualv_type::t_dev::const_type getGlobalIndsViewDevice(const RowInfo &rowinfo) const
Get a const, globally indexed view of the locally owned row myRow, such that rowinfo = getRowInfo(myR...
void replaceRangeMap(const Teuchos::RCP< const map_type > &newRangeMap)
Replace the current Range Map with the given objects.
row_ptrs_device_view_type getLocalRowPtrsDevice() const
Get a device view of the packed row offsets.
virtual void unpackAndCombine(const Kokkos::DualView< const local_ordinal_type *, buffer_device_type > &importLIDs, Kokkos::DualView< packet_type *, buffer_device_type > imports, Kokkos::DualView< size_t *, buffer_device_type > numPacketsPerLID, const size_t constantNumPackets, const CombineMode combineMode)
Perform any unpacking and combining after communication.
global_inds_dualv_type::t_host::const_type getGlobalIndsViewHost(const RowInfo &rowinfo) const
Get a const, globally indexed view of the locally owned row myRow, such that rowinfo = getRowInfo(myR...
const row_ptrs_host_view_type & getRowPtrsPackedHost() const
Get the packed row pointers on host. Lazily make a copy from device.
size_t getNumAllocatedEntriesInGlobalRow(global_ordinal_type globalRow) const
Current number of allocated entries in the given row on the calling (MPI) process, using a global row index.
Allocation information for a locally owned row in a CrsGraph or CrsMatrix.
local_inds_wdv_type lclIndsUnpacked_wdv
Local ordinals of column indices for all rows Valid when isLocallyIndexed is true If OptimizedStorage...
void replaceRangeMapAndExporter(const Teuchos::RCP< const map_type > &newRangeMap, const Teuchos::RCP< const export_type > &newExporter)
Replace the current Range Map and Export with the given parameters.
bool hasColMap() const override
Whether the graph has a column Map.
bool isGloballyIndexed() const override
Whether the graph's column indices are stored as global indices.
void exportAndFillComplete(Teuchos::RCP< CrsGraph< local_ordinal_type, global_ordinal_type, Node > > &destGraph, const export_type &exporter, const Teuchos::RCP< const map_type > &domainMap=Teuchos::null, const Teuchos::RCP< const map_type > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null) const
Export from this to the given destination graph, and make the result fill complete.
virtual void unpackAndCombine(const Kokkos::DualView< const local_ordinal_type *, buffer_device_type > &importLIDs, Kokkos::DualView< packet_type *, buffer_device_type > imports, Kokkos::DualView< size_t *, buffer_device_type > numPacketsPerLID, const size_t constantNumPackets, const CombineMode combineMode) override
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
bool isStorageOptimized() const
Returns true if storage has been optimized.
bool haveLocalConstants_
Whether this process has computed local constants.
size_t findGlobalIndices(const RowInfo &rowInfo, const Teuchos::ArrayView< const global_ordinal_type > &indices, std::function< void(const size_t, const size_t, const size_t)> fun) const
Finds indices in the given row.
std::string description() const override
Return a one-line human-readable description of this object.
void makeColMap(Teuchos::Array< int > &remotePIDs)
Make and set the graph's column Map.
Teuchos::RCP< const export_type > getExporter() const override
Returns the exporter associated with this graph.
std::pair< size_t, std::string > makeIndicesLocal(const bool verbose=false)
Convert column indices from global to local.
size_t global_size_t
Global size_t object.
virtual void removeEmptyProcessesInPlace(const Teuchos::RCP< const map_type > &newMap) override
Remove processes owning zero rows from the Maps and their communicator.
node_type node_type
This class' Kokkos Node type.
void reindexColumns(const Teuchos::RCP< const map_type > &newColMap, const Teuchos::RCP< const import_type > &newImport=Teuchos::null, const bool sortIndicesInEachRow=true)
Reindex the column indices in place, and replace the column Map. Optionally, replace the Import objec...
void deep_copy(MultiVector< DS, DL, DG, DN > &dst, const MultiVector< SS, SL, SG, SN > &src)
Copy the contents of the MultiVector src into dst.
Teuchos::RCP< CrsGraphType > importAndFillCompleteCrsGraph(const Teuchos::RCP< const CrsGraphType > &sourceGraph, const Import< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > &importer, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Nonmember CrsGraph constructor that fuses Import and fillComplete().
void makeImportExport(Teuchos::Array< int > &remotePIDs, const bool useRemotePIDs)
Make the Import and Export objects, if needed.
size_t sortAndMergeRowIndices(const RowInfo &rowInfo, const bool sorted, const bool merged)
Sort and merge duplicate column indices in the given row.
void insertLocalIndices(const local_ordinal_type localRow, const Teuchos::ArrayView< const local_ordinal_type > &indices)
Insert local indices into the graph.
bool isSorted() const
Whether graph indices in all rows are known to be sorted.
void getLocalRowCopy(local_ordinal_type gblRow, nonconst_local_inds_host_view_type &gblColInds, size_t &numColInds) const override
Get a copy of the given row, using local indices.
Teuchos::RCP< const map_type > rowMap_
The Map describing the distribution of rows of the graph.
Teuchos::RCP< const import_type > importer_
The Import from the domain Map to the column Map.
num_row_entries_type k_numRowEntries_
The number of local entries in each locally owned row.
local_inds_device_view_type getLocalIndicesDevice() const
Get a device view of the packed column indicies.
Teuchos::RCP< const map_type > domainMap_
The Map describing the domain of the (matrix corresponding to the) graph.
global_size_t getGlobalNumRows() const override
Returns the number of global rows in the graph.
Kokkos::View< size_t *, Kokkos::LayoutLeft, device_type >::HostMirror num_row_entries_type
Row offsets for "1-D" storage.
void setLocallyModified()
Report that we made a local modification to its structure.
Communication plan for data redistribution from a (possibly) multiply-owned to a uniquely-owned distr...
virtual void packAndPrepare(const SrcDistObject &source, const Kokkos::DualView< const local_ordinal_type *, buffer_device_type > &exportLIDs, Kokkos::DualView< packet_type *, buffer_device_type > &exports, Kokkos::DualView< size_t *, buffer_device_type > numPacketsPerLID, size_t &constantNumPackets)
Pack data and metadata for communication (sends).
void checkInternalState() const
Throw an exception if the internal state is not consistent.
Keep track of how much more space a CrsGraph or CrsMatrix needs, when the graph or matrix is the targ...
CombineMode
Rule for combining data in an Import or Export.
Teuchos::RCP< const export_type > exporter_
The Export from the row Map to the range Map.
void insertGlobalIndicesIntoNonownedRows(const global_ordinal_type gblRow, const global_ordinal_type gblColInds[], const local_ordinal_type numGblColInds)
Implementation of insertGlobalIndices for nonowned rows.
bool isFillComplete() const override
Whether fillComplete() has been called and the graph is in compute mode.
size_t getNumAllocatedEntriesInLocalRow(local_ordinal_type localRow) const
Current number of allocated entries in the given row on the calling (MPI) process, using a local row index.
void swap(CrsGraph< local_ordinal_type, global_ordinal_type, Node > &graph)
Swaps the data from *this with the data and maps from graph.
void globalAssemble()
Communicate nonlocal contributions to other processes.
typename device_type::execution_space execution_space
This class' Kokkos execution space.
RowInfo getRowInfoFromGlobalRowIndex(const global_ordinal_type gblRow) const
Get information about the locally owned row with global index gblRow.
Forward declaration of Tpetra::CrsMatrix.
size_t getLocalNumCols() const override
Returns the number of columns connected to the locally owned rows of this graph.
size_t getLocalNumEntries() const override
The local number of entries in the graph.
Abstract base class for objects that can be the source of an Import or Export operation.
void removeLocalIndices(local_ordinal_type localRow)
Remove all graph indices from the specified local row.
LO local_ordinal_type
The type of the graph's local indices.
global_size_t globalNumEntries_
Global number of entries in the graph.
global_inds_wdv_type gblInds_wdv
Global ordinals of column indices for all rows.
local_inds_dualv_type::t_dev::const_type getLocalIndsViewDevice(const RowInfo &rowinfo) const
Get a const, locally indexed view of the locally owned row myRow, such that rowinfo = getRowInfo(myRo...
Teuchos::RCP< const map_type > getRangeMap() const override
Returns the Map associated with the domain of this graph.
virtual void pack(const Teuchos::ArrayView< const local_ordinal_type > &exportLIDs, Teuchos::Array< global_ordinal_type > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t &constantNumPackets) const override
row_ptrs_host_view_type getLocalRowPtrsHost() const
Get a host view of the packed row offsets.
const row_ptrs_host_view_type & getRowPtrsUnpackedHost() const
Get the unpacked row pointers on host. Lazily make a copy from device.
void replaceColMap(const Teuchos::RCP< const map_type > &newColMap)
Replace the graph's current column Map with the given Map.
global_size_t getGlobalNumCols() const override
Returns the number of global columns in the graph.
size_t getLocalMaxNumRowEntries() const override
Maximum number of entries in any row of the graph, on this process.
RowInfo getRowInfo(const local_ordinal_type myRow) const
Get information about the locally owned row with local index myRow.
void replaceDomainMapAndImporter(const Teuchos::RCP< const map_type > &newDomainMap, const Teuchos::RCP< const import_type > &newImporter)
Replace the current domain Map and Import with the given parameters.
typename row_graph_type::global_inds_device_view_type global_inds_device_view_type
The Kokkos::View type for views of global ordinals on device and host.
bool supportsRowViews() const override
Whether this class implements getLocalRowView() and getGlobalRowView() (it does). ...
typename dist_object_type::buffer_device_type buffer_device_type
Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > createCrsGraph(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &map, size_t maxNumEntriesPerRow=0, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Nonmember function to create an empty CrsGraph given a row Map and the max number of entries allowed ...
local_inds_wdv_type lclIndsPacked_wdv
Local ordinals of column indices for all rows Valid when isLocallyIndexed is true Built during fillCo...
A distributed graph accessed by rows (adjacency lists) and stored sparsely.
Details::EStorageStatus storageStatus_
Status of the graph's storage, when not in a fill-complete state.
const row_ptrs_device_view_type & getRowPtrsPackedDevice() const
Get the packed row pointers on device.
const row_ptrs_device_view_type & getRowPtrsUnpackedDevice() const
Get the unpacked row pointers on device.
CrsGraph & operator=(const CrsGraph< local_ordinal_type, global_ordinal_type, node_type > &)=default
Assignment operator (default).
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > ¶ms) override
Set the given list of parameters (must be nonnull).
size_t getNumEntriesInGlobalRow(global_ordinal_type globalRow) const override
Returns the current number of entries on this node in the specified global row.
void fillComplete(const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Tell the graph that you are done changing its structure.
void getLocalRowView(const LocalOrdinal lclRow, local_inds_host_view_type &lclColInds) const override
Get a const view of the given local row's local column indices.
typename node_type::device_type device_type
This class' Kokkos device type.
bool isLocallyIndexed() const override
Whether the graph's column indices are stored as local indices.
::Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > import_type
The Import specialization used by this class.
Stand-alone utility functions and macros.
bool isFillActive() const
Whether resumeFill() has been called and the graph is in edit mode.
virtual void copyAndPermute(const SrcDistObject &source, const size_t numSameIDs, const Kokkos::DualView< const local_ordinal_type *, buffer_device_type > &permuteToLIDs, const Kokkos::DualView< const local_ordinal_type *, buffer_device_type > &permuteFromLIDs, const CombineMode CM) override
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const override
Returns the communicator.
void importAndFillComplete(Teuchos::RCP< CrsGraph< local_ordinal_type, global_ordinal_type, Node > > &destGraph, const import_type &importer, const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null) const
Import from this to the given destination graph, and make the result fill complete.
global_size_t globalMaxNumRowEntries_
Global maximum of the number of entries in each row.
static const bool useAtomicUpdatesByDefault
Whether transformLocalValues should use atomic updates by default.
size_t insertIndices(RowInfo &rowInfo, const SLocalGlobalViews &newInds, const ELocalGlobal lg, const ELocalGlobal I)
Insert indices into the given row.
global_size_t getGlobalNumEntries() const override
Returns the global number of entries in the graph.
Kokkos::Device< typename device_type::execution_space, buffer_memory_space > buffer_device_type
size_t numAllocForAllRows_
The maximum number of entries to allow in each locally owned row.
local_graph_device_type getLocalGraphDevice() const
Get the local graph.
Base class for distributed Tpetra objects that support data redistribution.
void getGlobalRowView(const global_ordinal_type gblRow, global_inds_host_view_type &gblColInds) const override
Get a const view of the given global row's global column indices.
global_ordinal_type packet_type
Type of each entry of the DistObject communication buffer.
Teuchos::RCP< const map_type > colMap_
The Map describing the distribution of columns of the graph.
global_ordinal_type getIndexBase() const override
Returns the index base for global indices for this graph.
typename local_graph_device_type::HostMirror local_graph_host_type
The type of the part of the sparse graph on each MPI process.
void replaceDomainMap(const Teuchos::RCP< const map_type > &newDomainMap)
Replace the current domain Map with the given objects.
EStorageStatus
Status of the graph's or matrix's storage, when not in a fill-complete state.
Forward declaration of Tpetra::CrsGraph.
Teuchos::RCP< CrsGraphType > exportAndFillCompleteCrsGraph(const Teuchos::RCP< const CrsGraphType > &sourceGraph, const Export< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > &exporter, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Nonmember CrsGraph constructor that fuses Export and fillComplete().
nonlocals_type nonlocals_
Nonlocal data given to insertGlobalIndices.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const override
Print this object to the given output stream with the given verbosity level.
void computeGlobalConstants()
Compute global constants, if they have not yet been computed.
void getGlobalRowCopy(global_ordinal_type gblRow, nonconst_global_inds_host_view_type &gblColInds, size_t &numColInds) const override
Get a copy of the given row, using global indices.