10#ifndef TPETRA_CRSGRAPH_DECL_HPP 
   11#define TPETRA_CRSGRAPH_DECL_HPP 
   19#include "Tpetra_DistObject.hpp" 
   20#include "Tpetra_Exceptions.hpp" 
   21#include "Tpetra_RowGraph.hpp" 
   23#include "Tpetra_Details_WrappedDualView.hpp" 
   25#include "KokkosSparse_findRelOffset.hpp" 
   26#include "Kokkos_DualView.hpp" 
   28#include "Teuchos_CommHelpers.hpp" 
   29#include "Teuchos_Describable.hpp" 
   30#include "Teuchos_OrdinalTraits.hpp" 
   31#include "Teuchos_ParameterListAcceptorDefaultBase.hpp" 
   33#include "KokkosSparse_StaticCrsGraph.hpp" 
   41template <
class LocalOrdinal, 
class GlobalOrdinal, 
class Node>
 
   42class crsGraph_Swap_Tester;
 
   44#ifndef DOXYGEN_SHOULD_SKIP_THIS 
   46template <
class LocalOrdinal,
 
   53template <
class ViewType>
 
   55  static_assert(Kokkos::is_view<ViewType>::value,
 
   56                "ViewType must be a Kokkos::View specialization.");
 
   60  typedef Kokkos::View<
typename ViewType::data_type,
 
   61                       typename ViewType::array_layout,
 
   62                       typename ViewType::device_type,
 
   63                       Kokkos::MemoryUnmanaged>
 
  187template <
class LocalOrdinal,
 
  195                 public Teuchos::ParameterListAcceptorDefaultBase {
 
  196  template <
class S, 
class LO, 
class GO, 
class N>
 
  198  template <
class LO2, 
class GO2, 
class N2>
 
  200  template <
class LO, 
class GO, 
class N>
 
  228#if KOKKOS_VERSION >= 40799 
  243  using local_inds_dualv_type =
 
  244      Kokkos::DualView<local_ordinal_type*, device_type>;
 
  249  using global_inds_dualv_type =
 
  250      Kokkos::DualView<global_ordinal_type*, device_type>;
 
  256  using row_ptrs_device_view_type =
 
  257      typename row_graph_type::row_ptrs_device_view_type;
 
  258  using row_ptrs_host_view_type =
 
  259      typename row_graph_type::row_ptrs_host_view_type;
 
  263      typename row_graph_type::local_inds_device_view_type;
 
  264  using local_inds_host_view_type =
 
  265      typename row_graph_type::local_inds_host_view_type;
 
  266  using nonconst_local_inds_host_view_type =
 
  267      typename row_graph_type::nonconst_local_inds_host_view_type;
 
  271      typename row_graph_type::global_inds_device_view_type;
 
  272  using global_inds_host_view_type =
 
  273      typename row_graph_type::global_inds_host_view_type;
 
  274  using nonconst_global_inds_host_view_type =
 
  275      typename row_graph_type::nonconst_global_inds_host_view_type;
 
  277  using offset_device_view_type =
 
  278      typename row_ptrs_device_view_type::non_const_type;
 
  295  CrsGraph(
const Teuchos::RCP<const map_type>& rowMap,
 
  297           const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  311  CrsGraph(
const Teuchos::RCP<const map_type>& rowMap,
 
  312           const Kokkos::DualView<const size_t*, device_type>& 
numEntPerRow,
 
  313           const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  328  CrsGraph(
const Teuchos::RCP<const map_type>& rowMap,
 
  330           const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  348  CrsGraph(
const Teuchos::RCP<const map_type>& rowMap,
 
  349           const Teuchos::RCP<const map_type>& colMap,
 
  351           const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  367  CrsGraph(
const Teuchos::RCP<const map_type>& rowMap,
 
  368           const Teuchos::RCP<const map_type>& colMap,
 
  369           const Kokkos::DualView<const size_t*, device_type>& 
numEntPerRow,
 
  370           const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  387  CrsGraph(
const Teuchos::RCP<const map_type>& rowMap,
 
  388           const Teuchos::RCP<const map_type>& colMap,
 
  390           const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  404           const Teuchos::RCP<const map_type>& rowMap,
 
  405           const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  429  CrsGraph(
const Teuchos::RCP<const map_type>& rowMap,
 
  430           const Teuchos::RCP<const map_type>& colMap,
 
  431           const typename local_graph_device_type::row_map_type& 
rowPointers,
 
  432           const typename local_graph_device_type::entries_type::non_const_type& 
columnIndices,
 
  433           const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  457  CrsGraph(
const Teuchos::RCP<const map_type>& rowMap,
 
  458           const Teuchos::RCP<const map_type>& colMap,
 
  461           const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  484  CrsGraph(
const Teuchos::RCP<const map_type>& rowMap,
 
  485           const Teuchos::RCP<const map_type>& colMap,
 
  487           const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  516           const Teuchos::RCP<const map_type>& rowMap,
 
  517           const Teuchos::RCP<const map_type>& colMap,
 
  518           const Teuchos::RCP<const map_type>& domainMap      = Teuchos::null,
 
  519           const Teuchos::RCP<const map_type>& 
rangeMap       = Teuchos::null,
 
  520           const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  527           const Teuchos::RCP<const map_type>& rowMap,
 
  528           const Teuchos::RCP<const map_type>& colMap,
 
  529           const Teuchos::RCP<const map_type>& domainMap,
 
  530           const Teuchos::RCP<const map_type>& 
rangeMap,
 
  531           const Teuchos::RCP<const import_type>& 
importer,
 
  532           const Teuchos::RCP<const export_type>& 
exporter,
 
  533           const Teuchos::RCP<Teuchos::ParameterList>& 
params =
 
  579           const Teuchos::RCP<const map_type>& rowMap,
 
  580           const Teuchos::RCP<const map_type>& colMap,
 
  581           const Teuchos::RCP<const map_type>& domainMap,
 
  582           const Teuchos::RCP<const map_type>& 
rangeMap,
 
  583           const Teuchos::RCP<const import_type>& 
importer,
 
  584           const Teuchos::RCP<const export_type>& 
exporter,
 
  585           const Teuchos::RCP<Teuchos::ParameterList>& 
params =
 
  666  Teuchos::RCP<const Teuchos::ParameterList>
 
  696                      const Teuchos::ArrayView<const global_ordinal_type>& indices);
 
  726                     const Teuchos::ArrayView<const local_ordinal_type>& indices);
 
  824  fillComplete(
const Teuchos::RCP<const map_type>& domainMap,
 
  825               const Teuchos::RCP<const map_type>& 
rangeMap,
 
  826               const Teuchos::RCP<Teuchos::ParameterList>& 
params = Teuchos::null);
 
  888                           const Teuchos::RCP<const map_type>& 
rangeMap,
 
  889                           const Teuchos::RCP<const import_type>& 
importer =
 
  891                           const Teuchos::RCP<const export_type>& 
exporter =
 
  893                           const Teuchos::RCP<Teuchos::ParameterList>& 
params =
 
  900  Teuchos::RCP<const Teuchos::Comm<int>> 
getComm() 
const override;
 
  903  Teuchos::RCP<const map_type> 
getRowMap() 
const override;
 
  906  Teuchos::RCP<const map_type> 
getColMap() 
const override;
 
  909  Teuchos::RCP<const map_type> 
getDomainMap() 
const override;
 
  912  Teuchos::RCP<const map_type> 
getRangeMap() 
const override;
 
  915  Teuchos::RCP<const import_type> 
getImporter() 
const override;
 
  918  Teuchos::RCP<const export_type> 
getExporter() 
const override;
 
 1098                   nonconst_global_inds_host_view_type& 
gblColInds,
 
 1110                  nonconst_local_inds_host_view_type& 
gblColInds,
 
 1126      global_inds_host_view_type& 
gblColInds) 
const override;
 
 1145      local_inds_host_view_type& 
lclColInds) 
const override;
 
 1158           const Teuchos::EVerbosityLevel 
verbLevel =
 
 1159               Teuchos::Describable::verbLevel_default) 
const override;
 
 1182                 const size_t numSameIDs,
 
 1194                  const bool verbose);
 
 1196  std::unique_ptr<padding_type>
 
 1200      const size_t numSameIDs,
 
 1205      const bool verbose) 
const;
 
 1208  std::unique_ptr<padding_type>
 
 1209  computeCrsPaddingForImports(
 
 1212      Kokkos::DualView<packet_type*, buffer_device_type> imports,
 
 1214      const bool verbose) 
const;
 
 1216  std::unique_ptr<padding_type>
 
 1217  computePaddingForCrsMatrixUnpack(
 
 1220      Kokkos::DualView<char*, buffer_device_type> imports,
 
 1222      const bool verbose) 
const;
 
 1225  computeCrsPaddingForSameIDs(
 
 1232  computeCrsPaddingForPermutedIDs(
 
 1244      const Kokkos::DualView<const local_ordinal_type*, buffer_device_type>& 
exportLIDs,
 
 1245      Kokkos::DualView<packet_type*, buffer_device_type>& exports,
 
 1255  pack(
const Teuchos::ArrayView<const local_ordinal_type>& 
exportLIDs,
 
 1256       Teuchos::Array<global_ordinal_type>& exports,
 
 1261  packFillActive(
const Teuchos::ArrayView<const local_ordinal_type>& 
exportLIDs,
 
 1262                 Teuchos::Array<global_ordinal_type>& exports,
 
 1271                    Kokkos::DualView<
size_t*,
 
 1287                   Kokkos::DualView<
size_t*,
 
 1340  getLocalDiagOffsets(
const Kokkos::View<size_t*, device_type, Kokkos::MemoryUnmanaged>& offsets) 
const;
 
 1369                const typename local_graph_device_type::entries_type::non_const_type& 
columnIndices);
 
 1382                const Teuchos::ArrayRCP<local_ordinal_type>& 
columnIndices);
 
 1439                 const Teuchos::RCP<const import_type>& 
newImport = Teuchos::null,
 
 1466                              const Teuchos::RCP<const import_type>& 
newImporter);
 
 1492                             const Teuchos::RCP<const export_type>& 
newExporter);
 
 1528  struct pack_functor {
 
 1534    typedef typename DestOffsetViewType::non_const_value_type ScalarIndx;
 
 1542      , src_offset(src_offset_)
 
 1546    void operator()(
size_t row)
 const {
 
 1547      ScalarIndx 
i       = src_offset(row);
 
 1548      ScalarIndx 
j       = dest_offset(row);
 
 1549      const ScalarIndx 
k = dest_offset(row + 1);
 
 1550      for (; 
j < 
k; 
j++, 
i++) {
 
 1558  template <
class CrsGraphType>
 
 1559  friend Teuchos::RCP<CrsGraphType>
 
 1560  importAndFillCompleteCrsGraph(
const Teuchos::RCP<const CrsGraphType>& sourceGraph,
 
 1561                                const Import<
typename CrsGraphType::local_ordinal_type,
 
 1562                                             typename CrsGraphType::global_ordinal_type,
 
 1563                                             typename CrsGraphType::node_type>& importer,
 
 1564                                const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 1565                                                             typename CrsGraphType::global_ordinal_type,
 
 1566                                                             typename CrsGraphType::node_type>>& domainMap,
 
 1567                                const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 1568                                                             typename CrsGraphType::global_ordinal_type,
 
 1569                                                             typename CrsGraphType::node_type>>& rangeMap,
 
 1570                                const Teuchos::RCP<Teuchos::ParameterList>& params);
 
 1573  template <
class CrsGraphType>
 
 1574  friend Teuchos::RCP<CrsGraphType>
 
 1575  importAndFillCompleteCrsGraph(
const Teuchos::RCP<const CrsGraphType>& sourceGraph,
 
 1576                                const Import<
typename CrsGraphType::local_ordinal_type,
 
 1577                                             typename CrsGraphType::global_ordinal_type,
 
 1578                                             typename CrsGraphType::node_type>& rowImporter,
 
 1579                                const Import<
typename CrsGraphType::local_ordinal_type,
 
 1580                                             typename CrsGraphType::global_ordinal_type,
 
 1581                                             typename CrsGraphType::node_type>& domainImporter,
 
 1582                                const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 1583                                                             typename CrsGraphType::global_ordinal_type,
 
 1584                                                             typename CrsGraphType::node_type>>& domainMap,
 
 1585                                const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 1586                                                             typename CrsGraphType::global_ordinal_type,
 
 1587                                                             typename CrsGraphType::node_type>>& rangeMap,
 
 1588                                const Teuchos::RCP<Teuchos::ParameterList>& params);
 
 1591  template <
class CrsGraphType>
 
 1592  friend Teuchos::RCP<CrsGraphType>
 
 1593  exportAndFillCompleteCrsGraph(
const Teuchos::RCP<const CrsGraphType>& sourceGraph,
 
 1594                                const Export<
typename CrsGraphType::local_ordinal_type,
 
 1595                                             typename CrsGraphType::global_ordinal_type,
 
 1596                                             typename CrsGraphType::node_type>& exporter,
 
 1597                                const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 1598                                                             typename CrsGraphType::global_ordinal_type,
 
 1599                                                             typename CrsGraphType::node_type>>& domainMap,
 
 1600                                const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 1601                                                             typename CrsGraphType::global_ordinal_type,
 
 1602                                                             typename CrsGraphType::node_type>>& rangeMap,
 
 1603                                const Teuchos::RCP<Teuchos::ParameterList>& params);
 
 1606  template <
class CrsGraphType>
 
 1607  friend Teuchos::RCP<CrsGraphType>
 
 1608  exportAndFillCompleteCrsGraph(
const Teuchos::RCP<const CrsGraphType>& sourceGraph,
 
 1609                                const Export<
typename CrsGraphType::local_ordinal_type,
 
 1610                                             typename CrsGraphType::global_ordinal_type,
 
 1611                                             typename CrsGraphType::node_type>& rowExporter,
 
 1612                                const Export<
typename CrsGraphType::local_ordinal_type,
 
 1613                                             typename CrsGraphType::global_ordinal_type,
 
 1614                                             typename CrsGraphType::node_type>& domainExporter,
 
 1615                                const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 1616                                                             typename CrsGraphType::global_ordinal_type,
 
 1617                                                             typename CrsGraphType::node_type>>& domainMap,
 
 1618                                const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 1619                                                             typename CrsGraphType::global_ordinal_type,
 
 1620                                                             typename CrsGraphType::node_type>>& rangeMap,
 
 1621                                const Teuchos::RCP<Teuchos::ParameterList>& params);
 
 1640  importAndFillComplete(Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node>>& destGraph,
 
 1642                        const Teuchos::RCP<const map_type>& domainMap,
 
 1643                        const Teuchos::RCP<const map_type>& rangeMap,
 
 1644                        const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) 
const;
 
 1662  importAndFillComplete(Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node>>& destGraph,
 
 1665                        const Teuchos::RCP<const map_type>& domainMap,
 
 1666                        const Teuchos::RCP<const map_type>& rangeMap,
 
 1667                        const Teuchos::RCP<Teuchos::ParameterList>& params) 
const;
 
 1685  exportAndFillComplete(Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node>>& destGraph,
 
 1687                        const Teuchos::RCP<const map_type>& domainMap      = Teuchos::null,
 
 1688                        const Teuchos::RCP<const map_type>& rangeMap       = Teuchos::null,
 
 1689                        const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) 
const;
 
 1707  exportAndFillComplete(Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node>>& destGraph,
 
 1710                        const Teuchos::RCP<const map_type>& domainMap,
 
 1711                        const Teuchos::RCP<const map_type>& rangeMap,
 
 1712                        const Teuchos::RCP<Teuchos::ParameterList>& params) 
const;
 
 1736  transferAndFillComplete(Teuchos::RCP<CrsGraph<local_ordinal_type, global_ordinal_type, Node>>& destGraph,
 
 1737                          const ::Tpetra::Details::Transfer<local_ordinal_type, global_ordinal_type, Node>& rowTransfer,
 
 1738                          const Teuchos::RCP<const ::Tpetra::Details::Transfer<local_ordinal_type, global_ordinal_type, Node>>& domainTransfer,
 
 1739                          const Teuchos::RCP<const map_type>& domainMap      = Teuchos::null,
 
 1740                          const Teuchos::RCP<const map_type>& rangeMap       = Teuchos::null,
 
 1741                          const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) 
const;
 
 1746  struct SLocalGlobalViews {
 
 1747    Teuchos::ArrayView<const global_ordinal_type> ginds;
 
 1748    Teuchos::ArrayView<const local_ordinal_type> linds;
 
 1750  struct SLocalGlobalNCViews {
 
 1751    Teuchos::ArrayView<global_ordinal_type> ginds;
 
 1752    Teuchos::ArrayView<local_ordinal_type> linds;
 
 1755  bool indicesAreAllocated() 
const;
 
 1758  allocateIndices(
const ELocalGlobal lg, 
const bool verbose = 
false);
 
 1772  void makeColMap(Teuchos::Array<int>& remotePIDs);
 
 1794  std::pair<size_t, std::string>
 
 1807                   const bool useRemotePIDs);
 
 1849                const SLocalGlobalViews& newInds,
 
 1850                const ELocalGlobal lg,
 
 1851                const ELocalGlobal I);
 
 1865                          const size_t numInputInds);
 
 1879                          const size_t numInputInds,
 
 1880                          std::function<
void(
const size_t, 
const size_t, 
const size_t)> fun =
 
 1881                              std::function<
void(
const size_t, 
const size_t, 
const size_t)>());
 
 1885                         const Teuchos::ArrayView<const local_ordinal_type>& gblColInds,
 
 1886                         std::function<
void(
const size_t, 
const size_t, 
const size_t)> fun =
 
 1887                             std::function<
void(
const size_t, 
const size_t, 
const size_t)>());
 
 1906                    const Teuchos::ArrayView<const global_ordinal_type>& indices,
 
 1907                    std::function<
void(
const size_t, 
const size_t, 
const size_t)> fun) 
const;
 
 1946#ifdef KOKKOS_ENABLE_SERIAL 
 1947      !std::is_same<execution_space, Kokkos::Serial>::value;
 
 1972  sortAndMergeAllIndices(
const bool sorted, 
const bool merged);
 
 2001                     const Teuchos::RCP<const map_type>& 
rangeMap);
 
 2003  void staticAssertions() 
const;
 
 2004  void clearGlobalConstants();
 
 2029  bool haveLocalOffRankOffsets()
 const { 
return haveLocalOffRankOffsets_; }
 
 2083  void fillLocalGraph(
const Teuchos::RCP<Teuchos::ParameterList>& params);
 
 2091  void swap(CrsGraph<local_ordinal_type, global_ordinal_type, Node>& graph);
 
 2125      Teuchos::OrdinalTraits<size_t>::invalid();
 
 2131      Teuchos::OrdinalTraits<global_size_t>::invalid();
 
 2138      Teuchos::OrdinalTraits<global_size_t>::invalid();
 
 2152  row_ptrs_device_view_type rowPtrsUnpacked_dev_;
 
 2153  mutable row_ptrs_host_view_type rowPtrsUnpacked_host_;
 
 2158  row_ptrs_device_view_type rowPtrsPacked_dev_;
 
 2159  mutable row_ptrs_host_view_type rowPtrsPacked_host_;
 
 2162  bool packedUnpackedRowPtrsMatch_ = 
false;
 
 2165  void setRowPtrsUnpacked(
const row_ptrs_device_view_type& 
dview) {
 
 2166    packedUnpackedRowPtrsMatch_ = 
false;
 
 2167    rowPtrsUnpacked_dev_        = 
dview;
 
 2169    rowPtrsUnpacked_host_ = row_ptrs_host_view_type();
 
 2174    return rowPtrsUnpacked_dev_;
 
 
 2179    if (rowPtrsUnpacked_host_.extent(0) != rowPtrsUnpacked_dev_.extent(0)) {
 
 2184      if constexpr (std::is_same_v<typename Node::memory_space, Kokkos::HostSpace>) {
 
 2185        rowPtrsUnpacked_host_ = rowPtrsUnpacked_dev_;
 
 2188        typename row_ptrs_host_view_type::non_const_type 
rowPtrsTemp(
 
 2189            Kokkos::view_alloc(Kokkos::WithoutInitializing, 
"rowPtrsUnpacked_host_"), rowPtrsUnpacked_dev_.extent(0));
 
 2190        Kokkos::deep_copy(
rowPtrsTemp, rowPtrsUnpacked_dev_);
 
 2194      if (packedUnpackedRowPtrsMatch_) {
 
 2195        rowPtrsPacked_host_ = rowPtrsUnpacked_host_;
 
 2198    return rowPtrsUnpacked_host_;
 
 
 2201  void setRowPtrsPacked(
const row_ptrs_device_view_type& 
dview) {
 
 2202    packedUnpackedRowPtrsMatch_ = 
false;
 
 2203    rowPtrsPacked_dev_          = 
dview;
 
 2205    rowPtrsPacked_host_ = row_ptrs_host_view_type();
 
 2210    return rowPtrsPacked_dev_;
 
 
 2215    if (rowPtrsPacked_host_.extent(0) != rowPtrsPacked_dev_.extent(0)) {
 
 2220      if constexpr (std::is_same_v<typename Node::memory_space, Kokkos::HostSpace>) {
 
 2221        rowPtrsPacked_host_ = rowPtrsPacked_dev_;
 
 2224        typename row_ptrs_host_view_type::non_const_type 
rowPtrsTemp(
 
 2225            Kokkos::view_alloc(Kokkos::WithoutInitializing, 
"rowPtrsPacked_host_"), rowPtrsPacked_dev_.extent(0));
 
 2226        Kokkos::deep_copy(
rowPtrsTemp, rowPtrsPacked_dev_);
 
 2230      if (packedUnpackedRowPtrsMatch_) {
 
 2231        rowPtrsUnpacked_host_ = rowPtrsPacked_host_;
 
 2234    return rowPtrsPacked_host_;
 
 
 2241  void setRowPtrs(
const row_ptrs_device_view_type& 
dview) {
 
 2242    packedUnpackedRowPtrsMatch_ = 
true;
 
 2243    rowPtrsUnpacked_dev_        = 
dview;
 
 2244    rowPtrsPacked_dev_          = 
dview;
 
 2246    rowPtrsUnpacked_host_ = row_ptrs_host_view_type();
 
 2247    rowPtrsPacked_host_   = row_ptrs_host_view_type();
 
 2300  typename local_inds_dualv_type::t_host::const_type
 
 2306  typename local_inds_dualv_type::t_dev::const_type
 
 2312  typename global_inds_dualv_type::t_host::const_type
 
 2318  typename global_inds_dualv_type::t_dev::const_type
 
 2324  typename local_inds_dualv_type::t_host
 
 2356  typename Kokkos::View<const size_t*, device_type>::host_mirror_type
 
 2441      Details::STORAGE_1D_UNPACKED;
 
 2443  bool indicesAreAllocated_ = 
false;
 
 2444  bool indicesAreLocal_     = 
false;
 
 2445  bool indicesAreGlobal_    = 
false;
 
 2446  bool fillComplete_        = 
false;
 
 2458  mutable bool haveLocalOffRankOffsets_ = 
false;
 
 2460  typedef typename std::map<global_ordinal_type, std::vector<global_ordinal_type>> nonlocals_type;
 
 2483  static bool getDebug();
 
 2487  bool debug_ = getDebug();
 
 2490  static bool getVerbose();
 
 2495  bool verbose_ = getVerbose();
 
 2499  mutable bool need_sync_host_uvm_access = 
false;
 
 2502  void set_need_sync_host_uvm_access() {
 
 2503    need_sync_host_uvm_access = 
true;
 
 2507  void execute_sync_host_uvm_access()
 const {
 
 2508    if (need_sync_host_uvm_access) {
 
 2509      Kokkos::fence(
"CrsGraph::execute_sync_host_uvm_access");
 
 2510      need_sync_host_uvm_access = 
false;
 
 
 2522template <
class LocalOrdinal, 
class GlobalOrdinal, 
class Node>
 
 2523Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node>>
 
 2528    const Teuchos::RCP<Teuchos::ParameterList>& 
params =
 
 
 2585template <
class CrsGraphType>
 
 2586Teuchos::RCP<CrsGraphType>
 
 2588                              const Import<
typename CrsGraphType::local_ordinal_type,
 
 2589                                           typename CrsGraphType::global_ordinal_type,
 
 2590                                           typename CrsGraphType::node_type>& 
importer,
 
 2591                              const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 2592                                                           typename CrsGraphType::global_ordinal_type,
 
 2593                                                           typename CrsGraphType::node_type>>& domainMap = Teuchos::null,
 
 2594                              const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 2595                                                           typename CrsGraphType::global_ordinal_type,
 
 2596                                                           typename CrsGraphType::node_type>>& 
rangeMap  = Teuchos::null,
 
 2597                              const Teuchos::RCP<Teuchos::ParameterList>& 
params                         = Teuchos::null) {
 
 
 2653template <
class CrsGraphType>
 
 2654Teuchos::RCP<CrsGraphType>
 
 2656                              const Import<
typename CrsGraphType::local_ordinal_type,
 
 2657                                           typename CrsGraphType::global_ordinal_type,
 
 2659                              const Import<
typename CrsGraphType::local_ordinal_type,
 
 2660                                           typename CrsGraphType::global_ordinal_type,
 
 2662                              const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 2663                                                           typename CrsGraphType::global_ordinal_type,
 
 2664                                                           typename CrsGraphType::node_type>>& domainMap,
 
 2665                              const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 2666                                                           typename CrsGraphType::global_ordinal_type,
 
 2667                                                           typename CrsGraphType::node_type>>& 
rangeMap,
 
 2668                              const Teuchos::RCP<Teuchos::ParameterList>& 
params) {
 
 
 2707template <
class CrsGraphType>
 
 2708Teuchos::RCP<CrsGraphType>
 
 2710                              const Export<
typename CrsGraphType::local_ordinal_type,
 
 2711                                           typename CrsGraphType::global_ordinal_type,
 
 2712                                           typename CrsGraphType::node_type>& 
exporter,
 
 2713                              const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 2714                                                           typename CrsGraphType::global_ordinal_type,
 
 2715                                                           typename CrsGraphType::node_type>>& domainMap = Teuchos::null,
 
 2716                              const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 2717                                                           typename CrsGraphType::global_ordinal_type,
 
 2718                                                           typename CrsGraphType::node_type>>& 
rangeMap  = Teuchos::null,
 
 2719                              const Teuchos::RCP<Teuchos::ParameterList>& 
params                         = Teuchos::null) {
 
 
 2758template <
class CrsGraphType>
 
 2759Teuchos::RCP<CrsGraphType>
 
 2761                              const Export<
typename CrsGraphType::local_ordinal_type,
 
 2762                                           typename CrsGraphType::global_ordinal_type,
 
 2764                              const Export<
typename CrsGraphType::local_ordinal_type,
 
 2765                                           typename CrsGraphType::global_ordinal_type,
 
 2767                              const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 2768                                                           typename CrsGraphType::global_ordinal_type,
 
 2769                                                           typename CrsGraphType::node_type>>& domainMap,
 
 2770                              const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
 
 2771                                                           typename CrsGraphType::global_ordinal_type,
 
 2772                                                           typename CrsGraphType::node_type>>& 
rangeMap,
 
 2773                              const Teuchos::RCP<Teuchos::ParameterList>& 
params) {
 
 
Forward declaration of Tpetra::BlockCrsMatrix.
 
Forward declaration of Tpetra::CrsGraph.
 
Forward declaration of Tpetra::CrsMatrix.
 
Stand-alone utility functions and macros.
 
A distributed graph accessed by rows (adjacency lists) and stored sparsely.
 
bool isMerged() const
Whether duplicate column indices in each row have been merged.
 
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
 
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...
 
global_size_t globalMaxNumRowEntries_
Global maximum of the number of entries in each row.
 
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...
 
Kokkos::View< size_t *, Kokkos::LayoutLeft, device_type >::host_mirror_type num_row_entries_type
Row offsets for "1-D" storage.
 
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...
 
size_t getNumEntriesInLocalRow(local_ordinal_type localRow) const override
Get the number of entries in the given row (local index).
 
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 > &rowImporter, const Import< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > &domainImporter, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &domainMap, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Nonmember CrsGraph constructor that fuses Import and fillComplete().
 
Teuchos::RCP< const map_type > getColMap() const override
Returns the Map that describes the column distribution in this graph.
 
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Default parameter list suitable for validation.
 
Details::EStorageStatus storageStatus_
Status of the graph's storage, when not in a fill-complete state.
 
::Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > import_type
The Import specialization used by this class.
 
global_ordinal_type packet_type
Type of each entry of the DistObject communication buffer.
 
GlobalOrdinal global_ordinal_type
The type of the graph's global indices.
 
void insertGlobalIndicesIntoNonownedRows(const global_ordinal_type gblRow, const global_ordinal_type gblColInds[], const local_ordinal_type numGblColInds)
Implementation of insertGlobalIndices for nonowned rows.
 
Teuchos::RCP< const map_type > rangeMap_
The Map describing the range of the (matrix corresponding to the) graph.
 
std::pair< size_t, std::string > makeIndicesLocal(const bool verbose=false)
Convert column indices from global to local.
 
local_inds_device_view_type getLocalIndicesDevice() const
Get a device view of the packed column indicies.
 
global_size_t getGlobalNumEntries() const override
Returns the global number of entries in the graph.
 
bool isIdenticalTo(const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > &graph) const
Create a cloned CrsGraph for a different Node type.
 
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const override
Returns the communicator.
 
local_inds_wdv_type lclIndsUnpacked_wdv
Local ordinals of column indices for all rows Valid when isLocallyIndexed is true If OptimizedStorage...
 
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
 
void globalAssemble()
Communicate nonlocal contributions to other processes.
 
RowInfo getRowInfoFromGlobalRowIndex(const global_ordinal_type gblRow) const
Get information about the locally owned row with global index gblRow.
 
void getLocalDiagOffsets(const Kokkos::View< size_t *, device_type, Kokkos::MemoryUnmanaged > &offsets) const
Get offsets of the diagonal entries in the graph.
 
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.
 
CrsGraph(const CrsGraph< local_ordinal_type, global_ordinal_type, node_type > &)=default
Copy constructor (default).
 
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.
 
global_inds_wdv_type gblInds_wdv
Global ordinals of column indices for all rows.
 
size_t nodeMaxNumRowEntries_
Local maximum of the number of entries in each row.
 
size_t sortAndMergeRowIndices(const RowInfo &rowInfo, const bool sorted, const bool merged)
Sort and merge duplicate column indices in the given row.
 
Teuchos::RCP< const import_type > importer_
The Import from the domain Map to the column Map.
 
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().
 
num_row_entries_type k_numRowEntries_
The number of local entries in each locally owned row.
 
CrsGraph(CrsGraph< local_ordinal_type, global_ordinal_type, node_type > &&)=default
Move constructor (default).
 
const row_ptrs_device_view_type & getRowPtrsUnpackedDevice() const
Get the unpacked row pointers on device.
 
size_t numAllocForAllRows_
The maximum number of entries to allow in each locally owned row.
 
bool hasColMap() const override
Whether the graph has a column Map.
 
LocalOrdinal local_ordinal_type
The type of the graph's local indices.
 
std::string description() const override
Return a one-line human-readable description of this object.
 
bool isStorageOptimized() const
Returns true if storage has been optimized.
 
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.
 
void removeLocalIndices(local_ordinal_type localRow)
Remove all graph indices from the specified local row.
 
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 getGlobalNumRows() const override
Returns the number of global rows in the graph.
 
Teuchos::RCP< const map_type > getDomainMap() const override
Returns the Map associated with the domain of this graph.
 
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.
 
void computeLocalConstants()
Compute local constants, if they have not yet been computed.
 
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 setParameterList(const Teuchos::RCP< Teuchos::ParameterList > ¶ms) override
Set the given list of parameters (must be nonnull).
 
static const bool useAtomicUpdatesByDefault
Whether transformLocalValues should use atomic updates by default.
 
void resumeFill(const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Resume fill operations.
 
size_t insertIndices(RowInfo &rowInfo, const SLocalGlobalViews &newInds, const ELocalGlobal lg, const ELocalGlobal I)
Insert indices into the given row.
 
typename Node::device_type device_type
This class' Kokkos device type.
 
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 insertGlobalIndicesFiltered(const local_ordinal_type lclRow, const global_ordinal_type gblColInds[], const local_ordinal_type numGblColInds)
Like insertGlobalIndices(), but with column Map filtering.
 
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
 
RowInfo getRowInfo(const local_ordinal_type myRow) const
Get information about the locally owned row with local index myRow.
 
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...
 
typename local_graph_device_type::HostMirror local_graph_host_type
The type of the part of the sparse graph on each MPI process.
 
KokkosSparse::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.
 
Teuchos::RCP< const map_type > colMap_
The Map describing the distribution of columns of the graph.
 
bool noRedundancies_
Whether the graph's indices are non-redundant (merged) in each row, on this process.
 
row_ptrs_host_view_type getLocalRowPtrsHost() const
Get a host view of the packed row offsets.
 
bool isSorted() const
Whether graph indices in all rows are known to be sorted.
 
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 ...
 
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.
 
void insertLocalIndices(const local_ordinal_type localRow, const Teuchos::ArrayView< const local_ordinal_type > &indices)
Insert local indices into the graph.
 
local_inds_host_view_type getLocalIndicesHost() const
Get a host view of the packed column indicies.
 
bool supportsRowViews() const override
Whether this class implements getLocalRowView() and getGlobalRowView() (it does).
 
size_t getNumEntriesInGlobalRow(global_ordinal_type globalRow) const override
Returns the current number of entries on this node in the specified global row.
 
bool isFillComplete() const override
Whether fillComplete() has been called and the graph is in compute mode.
 
void setDomainRangeMaps(const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap)
 
void swap(CrsGraph< local_ordinal_type, global_ordinal_type, Node > &graph)
Swaps the data from *this with the data and maps from graph.
 
CrsGraph & operator=(const CrsGraph< local_ordinal_type, global_ordinal_type, node_type > &)=default
Assignment operator (default).
 
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.
 
const row_ptrs_host_view_type & getRowPtrsUnpackedHost() const
Get the unpacked row pointers on host. Lazily make a copy from device.
 
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.
 
void makeColMap(Teuchos::Array< int > &remotePIDs)
Make and set the graph's column Map.
 
bool haveGlobalConstants_
Whether all processes have computed global constants.
 
size_t getGlobalMaxNumRowEntries() const override
Maximum number of entries in any row of the graph, over all processes in the graph's communicator.
 
void checkInternalState() const
Throw an exception if the internal state is not consistent.
 
typename dist_object_type::buffer_device_type buffer_device_type
Kokkos::Device specialization for communication buffers.
 
Teuchos::RCP< const map_type > getRangeMap() const override
Returns the Map associated with the domain of this graph.
 
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.
 
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().
 
bool sortGhostsAssociatedWithEachProcessor_
Whether to require makeColMap() (and therefore fillComplete()) to order column Map GIDs associated wi...
 
size_t getNumAllocatedEntriesInGlobalRow(global_ordinal_type globalRow) const
Current number of allocated entries in the given row on the calling (MPI) process,...
 
Teuchos::RCP< const export_type > getExporter() const override
Returns the exporter associated with this graph.
 
typename device_type::execution_space execution_space
This class' Kokkos execution space.
 
void makeImportExport(Teuchos::Array< int > &remotePIDs, const bool useRemotePIDs)
Make the Import and Export objects, if needed.
 
global_ordinal_type getIndexBase() const override
Returns the index base for global indices for this graph.
 
row_ptrs_device_view_type getLocalRowPtrsDevice() const
Get a device view of the packed row offsets.
 
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.
 
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...
 
bool isFillActive() const
Whether resumeFill() has been called and the graph is in edit mode.
 
Teuchos::RCP< const map_type > getRowMap() const override
Returns the Map that describes the row distribution in this graph.
 
global_size_t globalNumEntries_
Global number of entries in the graph.
 
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.
 
::Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node > export_type
The Export specialization used by this class.
 
size_t getLocalNumEntries() const override
The local number of entries in the graph.
 
Teuchos::RCP< const import_type > getImporter() const override
Returns the importer associated with this graph.
 
local_inds_wdv_type lclIndsPacked_wdv
Local ordinals of column indices for all rows Valid when isLocallyIndexed is true Built during fillCo...
 
Teuchos::RCP< const map_type > domainMap_
The Map describing the domain of the (matrix corresponding to the) graph.
 
const row_ptrs_host_view_type & getRowPtrsPackedHost() const
Get the packed row pointers on host. Lazily make a copy from device.
 
size_t getLocalNumCols() const override
Returns the number of columns connected to the locally owned rows of this graph.
 
nonlocals_type nonlocals_
Nonlocal data given to insertGlobalIndices.
 
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
 
void getLocalOffRankOffsets(offset_device_view_type &offsets) const
Get offsets of the off-rank entries in the graph.
 
global_size_t getGlobalNumCols() const override
Returns the number of global columns in the graph.
 
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.
 
Kokkos::View< constsize_t *, device_type >::host_mirror_type k_numAllocPerRow_
The maximum number of entries to allow in each locally owned row, per row.
 
bool indicesAreSorted_
Whether the graph's indices are sorted in each row, on this process.
 
Node node_type
This class' Kokkos Node type.
 
Teuchos::RCP< const export_type > exporter_
The Export from the row Map to the range Map.
 
void insertGlobalIndices(const global_ordinal_type globalRow, const Teuchos::ArrayView< const global_ordinal_type > &indices)
Insert global indices into the graph.
 
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...
 
void replaceDomainMap(const Teuchos::RCP< const map_type > &newDomainMap)
Replace the current domain Map with the given objects.
 
CrsGraph & operator=(CrsGraph< local_ordinal_type, global_ordinal_type, node_type > &&)=default
Move assignment (default).
 
void computeGlobalConstants()
Compute global constants, if they have not yet been computed.
 
size_t getNumAllocatedEntriesInLocalRow(local_ordinal_type localRow) const
Current number of allocated entries in the given row on the calling (MPI) process,...
 
virtual ~CrsGraph()=default
Destructor (virtual for memory safety of derived classes).
 
offset_device_view_type k_offRankOffsets_
The offsets for off-rank entries.
 
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.
 
void setLocallyModified()
Report that we made a local modification to its structure.
 
size_t getLocalAllocationSize() const
The local number of indices allocated for the graph, over all rows on the calling (MPI) process.
 
void replaceRangeMap(const Teuchos::RCP< const map_type > &newRangeMap)
Replace the current Range Map with the given objects.
 
Teuchos::RCP< const map_type > rowMap_
The Map describing the distribution of rows of the graph.
 
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 > &rowExporter, const Export< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > &domainExporter, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &domainMap, const Teuchos::RCP< const Map< typename CrsGraphType::local_ordinal_type, typename CrsGraphType::global_ordinal_type, typename CrsGraphType::node_type > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Nonmember CrsGraph constructor that fuses Export and fillComplete().
 
const row_ptrs_device_view_type & getRowPtrsPackedDevice() const
Get the packed row pointers on device.
 
virtual void removeEmptyProcessesInPlace(const Teuchos::RCP< const map_type > &newMap) override
Remove processes owning zero rows from the Maps and their communicator.
 
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.
 
bool isGloballyIndexed() const override
Whether the graph's column indices are stored as global indices.
 
bool isLocallyIndexed() const override
Whether the graph's column indices are stored as local indices.
 
size_t getLocalMaxNumRowEntries() const override
Maximum number of entries in any row of the graph, on this process.
 
virtual bool checkSizes(const SrcDistObject &source) override
Compare the source and target (this) objects for compatibility.
 
local_graph_device_type getLocalGraphDevice() const
Get the local graph.
 
size_t getLocalNumRows() const override
Returns the number of graph rows owned on the calling node.
 
void replaceColMap(const Teuchos::RCP< const map_type > &newColMap)
Replace the graph's current column Map with the given Map.
 
bool haveLocalConstants_
Whether this process has computed local constants.
 
Struct that holds views of the contents of a CrsMatrix.
 
Sparse matrix that presents a row-oriented interface that lets users read or modify entries.
 
Keep track of how much more space a CrsGraph or CrsMatrix needs, when the graph or matrix is the targ...
 
Base class for distributed Tpetra objects that support data redistribution.
 
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).
 
Kokkos::Device< typename device_type::execution_space, buffer_memory_space > buffer_device_type
Kokkos::Device specialization for communication buffers.
 
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.
 
Communication plan for data redistribution from a (possibly) multiply-owned to a uniquely-owned distr...
 
A distributed graph accessed by rows (adjacency lists) and stored sparsely.
 
Communication plan for data redistribution from a uniquely-owned to a (possibly) multiply-owned distr...
 
A parallel distribution of indices over processes.
 
An abstract interface for graphs accessed by rows.
 
Abstract base class for objects that can be the source of an Import or Export operation.
 
Implementation details of Tpetra.
 
EStorageStatus
Status of the graph's or matrix's storage, when not in a fill-complete state.
 
Namespace Tpetra contains the class and methods constituting the Tpetra library.
 
CombineMode
Rule for combining data in an Import or Export.
 
Allocation information for a locally owned row in a CrsGraph or CrsMatrix.