42 #ifndef TPETRA_CRSGRAPH_DECL_HPP 43 #define TPETRA_CRSGRAPH_DECL_HPP 56 #include "Tpetra_DistObject.hpp" 57 #include "Tpetra_Exceptions.hpp" 58 #include "Tpetra_RowGraph.hpp" 61 #include "KokkosSparse_findRelOffset.hpp" 62 #include "Kokkos_DualView.hpp" 63 #include "Kokkos_StaticCrsGraph.hpp" 65 #include "Teuchos_CommHelpers.hpp" 66 #include "Teuchos_Describable.hpp" 67 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp" 73 #ifndef DOXYGEN_SHOULD_SKIP_THIS 76 template<
class OutputCrsGraphType,
class InputCrsGraphType>
77 class CrsGraphCopier {
79 static Teuchos::RCP<OutputCrsGraphType>
80 clone (
const InputCrsGraphType& graphIn,
81 const Teuchos::RCP<typename OutputCrsGraphType::node_type> nodeOut,
82 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
88 template<
class ViewType>
89 struct UnmanagedView {
90 static_assert (Kokkos::is_view<ViewType>::value,
91 "ViewType must be a Kokkos::View specialization.");
95 typedef Kokkos::View<
typename ViewType::data_type,
96 typename ViewType::array_layout,
97 typename ViewType::device_type,
98 Kokkos::MemoryUnmanaged> type;
102 #endif // DOXYGEN_SHOULD_SKIP_THIS 183 virtual bool isLowerTriangularImpl ()
const = 0;
184 virtual bool isUpperTriangularImpl ()
const = 0;
185 virtual size_t getGlobalNumDiagsImpl ()
const = 0;
257 class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
260 public RowGraph<LocalOrdinal, GlobalOrdinal, Node>,
265 public Teuchos::ParameterListAcceptorDefaultBase,
268 template <
class S,
class LO,
class GO,
class N>
270 template <
class LO2,
class GO2,
class N2>
290 typedef Kokkos::StaticCrsGraph<LocalOrdinal,
301 typedef typename local_graph_type::entries_type::non_const_type t_LocalOrdinal_1D
TPETRA_DEPRECATED;
331 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
332 size_t maxNumEntriesPerRow,
334 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
353 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
354 const Kokkos::DualView<const size_t*, execution_space>& numEntPerRow,
356 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
376 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
377 const Teuchos::ArrayRCP<const size_t>& numEntPerRow,
379 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
402 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
403 const Teuchos::RCP<const map_type>& colMap,
404 const size_t maxNumEntriesPerRow,
406 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
426 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
427 const Teuchos::RCP<const map_type>& colMap,
428 const Kokkos::DualView<const size_t*, execution_space>& numEntPerRow,
430 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
451 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
452 const Teuchos::RCP<const map_type>& colMap,
453 const Teuchos::ArrayRCP<const size_t>& numEntPerRow,
455 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
476 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
477 const Teuchos::RCP<const map_type>& colMap,
478 const typename local_graph_type::row_map_type& rowPointers,
479 const typename local_graph_type::entries_type::non_const_type& columnIndices,
480 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
501 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
502 const Teuchos::RCP<const map_type>& colMap,
503 const Teuchos::ArrayRCP<size_t> & rowPointers,
504 const Teuchos::ArrayRCP<LocalOrdinal> & columnIndices,
505 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
525 CrsGraph (
const Teuchos::RCP<const map_type>& rowMap,
526 const Teuchos::RCP<const map_type>& colMap,
527 const local_graph_type& lclGraph,
528 const Teuchos::RCP<Teuchos::ParameterList>& params);
554 CrsGraph (
const local_graph_type& lclGraph,
555 const Teuchos::RCP<const map_type>& rowMap,
556 const Teuchos::RCP<const map_type>& colMap,
557 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
558 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
559 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
588 template<
class Node2>
589 Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node2> >
590 clone (
const Teuchos::RCP<Node2>& node2,
591 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
const 595 typedef ::Tpetra::Details::CrsGraphCopier<output_crs_graph_type, input_crs_graph_type> copier_type;
596 return copier_type::clone (*
this, node2, params);
608 setParameterList (
const Teuchos::RCP<Teuchos::ParameterList>& params)
override;
611 Teuchos::RCP<const Teuchos::ParameterList>
612 getValidParameters ()
const override;
640 insertGlobalIndices (
const GlobalOrdinal globalRow,
641 const Teuchos::ArrayView<const GlobalOrdinal>& indices);
650 insertGlobalIndices (
const GlobalOrdinal globalRow,
651 const LocalOrdinal numEnt,
652 const GlobalOrdinal inds[]);
670 insertLocalIndices (
const LocalOrdinal localRow,
671 const Teuchos::ArrayView<const LocalOrdinal> &indices);
680 insertLocalIndices (
const LocalOrdinal localRow,
681 const LocalOrdinal numEnt,
682 const LocalOrdinal inds[]);
694 void removeLocalIndices (LocalOrdinal localRow);
707 void globalAssemble ();
727 void resumeFill (
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
767 fillComplete (
const Teuchos::RCP<const map_type> &domainMap,
768 const Teuchos::RCP<const map_type> &rangeMap,
769 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
799 fillComplete (
const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
830 expertStaticFillComplete (
const Teuchos::RCP<const map_type> & domainMap,
831 const Teuchos::RCP<const map_type> & rangeMap,
832 const Teuchos::RCP<const import_type> &importer=Teuchos::null,
833 const Teuchos::RCP<const export_type> &exporter=Teuchos::null,
834 const Teuchos::RCP<Teuchos::ParameterList> ¶ms=Teuchos::null);
840 Teuchos::RCP<const Teuchos::Comm<int> > getComm()
const override;
843 Teuchos::RCP<node_type> getNode()
const override;
846 Teuchos::RCP<const map_type> getRowMap ()
const override;
849 Teuchos::RCP<const map_type> getColMap ()
const override;
852 Teuchos::RCP<const map_type> getDomainMap ()
const override;
855 Teuchos::RCP<const map_type> getRangeMap ()
const override;
858 Teuchos::RCP<const import_type> getImporter ()
const override;
861 Teuchos::RCP<const export_type> getExporter ()
const override;
875 size_t getNodeNumRows()
const override;
880 size_t getNodeNumCols()
const override;
883 GlobalOrdinal getIndexBase()
const override;
899 size_t getNodeNumEntries()
const override;
904 getNumEntriesInGlobalRow (GlobalOrdinal globalRow)
const override;
913 getNumEntriesInLocalRow (LocalOrdinal localRow)
const override;
934 size_t getNodeAllocationSize ()
const;
943 size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow)
const;
952 size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow)
const;
982 size_t TPETRA_DEPRECATED getNodeNumDiags()
const override;
995 size_t getNodeNumDiagsImpl ()
const override;
1010 size_t getGlobalMaxNumRowEntries ()
const override;
1016 size_t getNodeMaxNumRowEntries ()
const override;
1033 bool hasColMap ()
const override;
1046 bool isLowerTriangularImpl ()
const override;
1058 bool TPETRA_DEPRECATED isLowerTriangular ()
const override;
1071 bool isUpperTriangularImpl ()
const override;
1083 bool TPETRA_DEPRECATED isUpperTriangular ()
const override;
1086 bool isLocallyIndexed()
const override;
1089 bool isGloballyIndexed()
const override;
1092 bool isFillComplete()
const override;
1095 bool isFillActive()
const;
1104 bool isSorted()
const;
1113 bool isStorageOptimized()
const;
1124 getGlobalRowCopy (GlobalOrdinal GlobalRow,
1125 const Teuchos::ArrayView<GlobalOrdinal>& Indices,
1126 size_t& NumIndices)
const override;
1136 getLocalRowCopy (LocalOrdinal LocalRow,
1137 const Teuchos::ArrayView<LocalOrdinal>& indices,
1138 size_t& NumIndices)
const override;
1151 getGlobalRowView (
const GlobalOrdinal gblRow,
1152 Teuchos::ArrayView<const GlobalOrdinal>& gblColInds)
const override;
1156 bool supportsRowViews ()
const override;
1169 getLocalRowView (
const LocalOrdinal lclRow,
1170 Teuchos::ArrayView<const LocalOrdinal>& lclColInds)
const override;
1177 std::string description ()
const override;
1182 describe (Teuchos::FancyOStream& out,
1183 const Teuchos::EVerbosityLevel verbLevel =
1184 Teuchos::Describable::verbLevel_default)
const override;
1196 const Teuchos::ArrayView<const LocalOrdinal> &permuteToLIDs,
1197 const Teuchos::ArrayView<const LocalOrdinal> &permuteFromLIDs)
override;
1201 const Teuchos::ArrayView<const LocalOrdinal> &exportLIDs,
1202 Teuchos::Array<GlobalOrdinal> &exports,
1203 const Teuchos::ArrayView<size_t> & numPacketsPerLID,
1204 size_t& constantNumPackets,
1208 pack (
const Teuchos::ArrayView<const LocalOrdinal>& exportLIDs,
1209 Teuchos::Array<GlobalOrdinal>& exports,
1210 const Teuchos::ArrayView<size_t>& numPacketsPerLID,
1211 size_t& constantNumPackets,
1215 unpackAndCombine (
const Teuchos::ArrayView<const LocalOrdinal> &importLIDs,
1216 const Teuchos::ArrayView<const GlobalOrdinal> &imports,
1217 const Teuchos::ArrayView<size_t> &numPacketsPerLID,
1218 size_t constantNumPackets,
1268 getLocalDiagOffsets (
const Kokkos::View<size_t*, device_type, Kokkos::MemoryUnmanaged>& offsets)
const;
1280 getLocalDiagOffsets (Teuchos::ArrayRCP<size_t>& offsets)
const;
1305 getNumEntriesPerLocalRowUpperBound (Teuchos::ArrayRCP<const size_t>& boundPerLocalRow,
1306 size_t& boundForAllLocalRows,
1307 bool& boundSameForAllLocalRows)
const;
1318 setAllIndices (
const typename local_graph_type::row_map_type& rowPointers,
1319 const typename local_graph_type::entries_type::non_const_type& columnIndices);
1330 setAllIndices (
const Teuchos::ArrayRCP<size_t> & rowPointers,
1331 const Teuchos::ArrayRCP<LocalOrdinal> & columnIndices);
1340 Teuchos::ArrayRCP<const size_t> getNodeRowPtrs ()
const;
1345 Teuchos::ArrayRCP<const LocalOrdinal> getNodePackedIndices()
const;
1357 void replaceColMap (
const Teuchos::RCP<const map_type>& newColMap);
1379 reindexColumns (
const Teuchos::RCP<const map_type>& newColMap,
1380 const Teuchos::RCP<const import_type>& newImport = Teuchos::null,
1381 const bool sortIndicesInEachRow =
true);
1397 replaceDomainMapAndImporter (
const Teuchos::RCP<const map_type>& newDomainMap,
1398 const Teuchos::RCP<const import_type>& newImporter);
1432 template<
class ViewType,
class OffsetViewType >
1433 struct pack_functor {
1434 typedef typename ViewType::execution_space execution_space;
1437 OffsetViewType src_offset;
1438 OffsetViewType dest_offset;
1439 typedef typename OffsetViewType::non_const_value_type ScalarIndx;
1441 pack_functor(ViewType dest_, ViewType src_, OffsetViewType dest_offset_, OffsetViewType src_offset_):
1442 src(src_),dest(dest_),src_offset(src_offset_),dest_offset(dest_offset_) {};
1444 KOKKOS_INLINE_FUNCTION
1445 void operator() (
size_t row)
const {
1446 ScalarIndx i = src_offset(row);
1447 ScalarIndx j = dest_offset(row);
1448 const ScalarIndx k = dest_offset(row+1);
1457 template<
class CrsGraphType>
1458 friend Teuchos::RCP<CrsGraphType>
1460 const Import<
typename CrsGraphType::local_ordinal_type,
1461 typename CrsGraphType::global_ordinal_type,
1462 typename CrsGraphType::node_type>& importer,
1463 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1464 typename CrsGraphType::global_ordinal_type,
1465 typename CrsGraphType::node_type> >& domainMap,
1466 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1467 typename CrsGraphType::global_ordinal_type,
1468 typename CrsGraphType::node_type> >& rangeMap,
1469 const Teuchos::RCP<Teuchos::ParameterList>& params);
1472 template<
class CrsGraphType>
1473 friend Teuchos::RCP<CrsGraphType>
1475 const Import<
typename CrsGraphType::local_ordinal_type,
1476 typename CrsGraphType::global_ordinal_type,
1477 typename CrsGraphType::node_type>& rowImporter,
1478 const Import<
typename CrsGraphType::local_ordinal_type,
1479 typename CrsGraphType::global_ordinal_type,
1480 typename CrsGraphType::node_type>& domainImporter,
1481 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1482 typename CrsGraphType::global_ordinal_type,
1483 typename CrsGraphType::node_type> >& domainMap,
1484 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1485 typename CrsGraphType::global_ordinal_type,
1486 typename CrsGraphType::node_type> >& rangeMap,
1487 const Teuchos::RCP<Teuchos::ParameterList>& params);
1491 template<
class CrsGraphType>
1492 friend Teuchos::RCP<CrsGraphType>
1494 const Export<
typename CrsGraphType::local_ordinal_type,
1495 typename CrsGraphType::global_ordinal_type,
1496 typename CrsGraphType::node_type>& exporter,
1497 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1498 typename CrsGraphType::global_ordinal_type,
1499 typename CrsGraphType::node_type> >& domainMap,
1500 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1501 typename CrsGraphType::global_ordinal_type,
1502 typename CrsGraphType::node_type> >& rangeMap,
1503 const Teuchos::RCP<Teuchos::ParameterList>& params);
1506 template<
class CrsGraphType>
1507 friend Teuchos::RCP<CrsGraphType>
1509 const Export<
typename CrsGraphType::local_ordinal_type,
1510 typename CrsGraphType::global_ordinal_type,
1511 typename CrsGraphType::node_type>& rowExporter,
1512 const Export<
typename CrsGraphType::local_ordinal_type,
1513 typename CrsGraphType::global_ordinal_type,
1514 typename CrsGraphType::node_type>& domainExporter,
1515 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1516 typename CrsGraphType::global_ordinal_type,
1517 typename CrsGraphType::node_type> >& domainMap,
1518 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
1519 typename CrsGraphType::global_ordinal_type,
1520 typename CrsGraphType::node_type> >& rangeMap,
1521 const Teuchos::RCP<Teuchos::ParameterList>& params);
1542 const Teuchos::RCP<const map_type>& domainMap,
1543 const Teuchos::RCP<const map_type>& rangeMap,
1544 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
const;
1565 const Teuchos::RCP<const map_type>& domainMap,
1566 const Teuchos::RCP<const map_type>& rangeMap,
1567 const Teuchos::RCP<Teuchos::ParameterList>& params)
const;
1588 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
1589 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
1590 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
const;
1611 const Teuchos::RCP<const map_type>& domainMap,
1612 const Teuchos::RCP<const map_type>& rangeMap,
1613 const Teuchos::RCP<Teuchos::ParameterList>& params)
const;
1639 const ::Tpetra::Details::Transfer<LocalOrdinal, GlobalOrdinal, Node>& rowTransfer,
1640 const Teuchos::RCP<const ::Tpetra::Details::Transfer<LocalOrdinal, GlobalOrdinal, Node> > & domainTransfer,
1641 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
1642 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
1643 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
const;
1648 struct SLocalGlobalViews {
1649 Teuchos::ArrayView<const GlobalOrdinal> ginds;
1650 Teuchos::ArrayView<const LocalOrdinal> linds;
1652 struct SLocalGlobalNCViews {
1653 Teuchos::ArrayView<GlobalOrdinal> ginds;
1654 Teuchos::ArrayView<LocalOrdinal> linds;
1657 bool indicesAreAllocated ()
const;
1658 void allocateIndices (
const ELocalGlobal lg);
1672 void makeColMap (Teuchos::Array<int>& remotePIDs);
1690 std::pair<size_t, std::string> makeIndicesLocal ();
1701 makeImportExport (Teuchos::Array<int>& remotePIDs,
1702 const bool useRemotePIDs);
1743 insertIndices (
RowInfo& rowInfo,
1744 const SLocalGlobalViews& newInds,
1745 const ELocalGlobal lg,
1746 const ELocalGlobal I);
1758 insertGlobalIndicesImpl (
const LocalOrdinal lclRow,
1759 const GlobalOrdinal inputGblColInds[],
1760 const size_t numInputInds);
1772 insertGlobalIndicesImpl (
const RowInfo& rowInfo,
1773 const GlobalOrdinal inputGblColInds[],
1774 const size_t numInputInds);
1777 insertLocalIndicesImpl (
const LocalOrdinal lclRow,
1778 const Teuchos::ArrayView<const LocalOrdinal>& gblColInds);
1792 insertGlobalIndicesFiltered (
const LocalOrdinal lclRow,
1793 const GlobalOrdinal gblColInds[],
1794 const LocalOrdinal numGblColInds);
1808 insertGlobalIndicesIntoNonownedRows (
const GlobalOrdinal gblRow,
1809 const GlobalOrdinal gblColInds[],
1810 const LocalOrdinal numGblColInds);
1816 static const bool useAtomicUpdatesByDefault =
1817 #ifdef KOKKOS_ENABLE_SERIAL 1818 ! std::is_same<execution_space, Kokkos::Serial>::value;
1821 #endif // KOKKOS_ENABLE_SERIAL 1828 bool isMerged ()
const;
1835 void setLocallyModified ();
1843 sortAndMergeAllIndices (
const bool sorted,
const bool merged);
1856 size_t sortAndMergeRowIndices (
const RowInfo& rowInfo,
1871 setDomainRangeMaps (
const Teuchos::RCP<const map_type>& domainMap,
1872 const Teuchos::RCP<const map_type>& rangeMap);
1874 void staticAssertions()
const;
1875 void clearGlobalConstants();
1909 void computeGlobalConstants (
const bool computeLocalTriangularConstants);
1946 void computeLocalConstants (
const bool computeLocalTriangularConstants);
1950 RowInfo getRowInfo (
const LocalOrdinal myRow)
const;
1964 RowInfo getRowInfoFromGlobalRowIndex (
const GlobalOrdinal gblRow)
const;
1969 Teuchos::ArrayView<const LocalOrdinal>
1970 getLocalView (
const RowInfo rowinfo)
const;
1975 Teuchos::ArrayView<LocalOrdinal>
1976 getLocalViewNonConst (
const RowInfo rowinfo);
1990 getLocalViewRawConst (
const LocalOrdinal*& lclInds,
1991 LocalOrdinal& capacity,
1992 const RowInfo& rowInfo)
const;
2002 Kokkos::View<const LocalOrdinal*, execution_space, Kokkos::MemoryUnmanaged>
2003 getLocalKokkosRowView (
const RowInfo& rowInfo)
const;
2011 Kokkos::View<LocalOrdinal*, execution_space, Kokkos::MemoryUnmanaged>
2012 getLocalKokkosRowViewNonConst (
const RowInfo& rowInfo);
2020 Kokkos::View<const GlobalOrdinal*, execution_space, Kokkos::MemoryUnmanaged>
2021 getGlobalKokkosRowView (
const RowInfo& rowInfo)
const;
2028 Teuchos::ArrayView<const GlobalOrdinal>
2029 getGlobalView (
const RowInfo& rowinfo)
const;
2034 Teuchos::ArrayView<GlobalOrdinal>
2035 getGlobalViewNonConst (
const RowInfo& rowinfo);
2050 getGlobalViewRawConst (
const GlobalOrdinal*& gblInds,
2051 LocalOrdinal& capacity,
2052 const RowInfo& rowInfo)
const;
2062 local_graph_type getLocalGraph ()
const;
2065 void fillLocalGraph (
const Teuchos::RCP<Teuchos::ParameterList>& params);
2068 void checkInternalState ()
const;
2150 typename Kokkos::View<const size_t*, execution_space>::HostMirror
2294 bool indicesAreAllocated_;
2295 bool indicesAreLocal_;
2296 bool indicesAreGlobal_;
2341 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
2342 Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
2344 size_t maxNumEntriesPerRow = 0,
2345 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
2349 return rcp (
new graph_type (map, maxNumEntriesPerRow,
DynamicProfile, params));
2400 template<
class CrsGraphType>
2401 Teuchos::RCP<CrsGraphType>
2403 const Import<
typename CrsGraphType::local_ordinal_type,
2404 typename CrsGraphType::global_ordinal_type,
2405 typename CrsGraphType::node_type>& importer,
2406 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2407 typename CrsGraphType::global_ordinal_type,
2408 typename CrsGraphType::node_type> >& domainMap = Teuchos::null,
2409 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2410 typename CrsGraphType::global_ordinal_type,
2411 typename CrsGraphType::node_type> >& rangeMap = Teuchos::null,
2412 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
2414 Teuchos::RCP<CrsGraphType> destGraph;
2415 sourceGraph->importAndFillComplete (destGraph,importer,domainMap, rangeMap, params);
2469 template<
class CrsGraphType>
2470 Teuchos::RCP<CrsGraphType>
2472 const Import<
typename CrsGraphType::local_ordinal_type,
2473 typename CrsGraphType::global_ordinal_type,
2474 typename CrsGraphType::node_type>& rowImporter,
2475 const Import<
typename CrsGraphType::local_ordinal_type,
2476 typename CrsGraphType::global_ordinal_type,
2477 typename CrsGraphType::node_type>& domainImporter,
2478 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2479 typename CrsGraphType::global_ordinal_type,
2480 typename CrsGraphType::node_type> >& domainMap,
2481 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2482 typename CrsGraphType::global_ordinal_type,
2483 typename CrsGraphType::node_type> >& rangeMap,
2484 const Teuchos::RCP<Teuchos::ParameterList>& params)
2486 Teuchos::RCP<CrsGraphType> destGraph;
2487 sourceGraph->importAndFillComplete (destGraph,rowImporter,domainImporter, domainMap, rangeMap, params);
2524 template<
class CrsGraphType>
2525 Teuchos::RCP<CrsGraphType>
2527 const Export<
typename CrsGraphType::local_ordinal_type,
2528 typename CrsGraphType::global_ordinal_type,
2529 typename CrsGraphType::node_type>& exporter,
2530 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2531 typename CrsGraphType::global_ordinal_type,
2532 typename CrsGraphType::node_type> >& domainMap = Teuchos::null,
2533 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2534 typename CrsGraphType::global_ordinal_type,
2535 typename CrsGraphType::node_type> >& rangeMap = Teuchos::null,
2536 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
2538 Teuchos::RCP<CrsGraphType> destGraph;
2539 sourceGraph->exportAndFillComplete (destGraph,exporter,domainMap, rangeMap, params);
2576 template<
class CrsGraphType>
2577 Teuchos::RCP<CrsGraphType>
2579 const Export<
typename CrsGraphType::local_ordinal_type,
2580 typename CrsGraphType::global_ordinal_type,
2581 typename CrsGraphType::node_type>& rowExporter,
2582 const Export<
typename CrsGraphType::local_ordinal_type,
2583 typename CrsGraphType::global_ordinal_type,
2584 typename CrsGraphType::node_type>& domainExporter,
2585 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2586 typename CrsGraphType::global_ordinal_type,
2587 typename CrsGraphType::node_type> >& domainMap,
2588 const Teuchos::RCP<
const Map<
typename CrsGraphType::local_ordinal_type,
2589 typename CrsGraphType::global_ordinal_type,
2590 typename CrsGraphType::node_type> >& rangeMap,
2591 const Teuchos::RCP<Teuchos::ParameterList>& params)
2593 Teuchos::RCP<CrsGraphType> destGraph;
2594 sourceGraph->exportAndFillComplete (destGraph,rowExporter,domainExporter,domainMap, rangeMap, params);
2600 template<
class LocalOrdinal,
2601 class GlobalOrdinal,
2602 class OutputNodeType,
2603 class InputNodeType>
2604 class CrsGraphCopier<CrsGraph<LocalOrdinal, GlobalOrdinal, OutputNodeType>,
2605 CrsGraph<LocalOrdinal, GlobalOrdinal, InputNodeType> > {
2610 static Teuchos::RCP<output_crs_graph_type>
2611 clone (
const input_crs_graph_type& graphIn,
2612 const Teuchos::RCP<OutputNodeType> &nodeOut,
2613 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
2615 using Teuchos::arcp;
2616 using Teuchos::Array;
2617 using Teuchos::ArrayRCP;
2618 using Teuchos::ArrayView;
2619 using Teuchos::null;
2620 using Teuchos::outArg;
2621 using Teuchos::ParameterList;
2622 using Teuchos::parameterList;
2625 using Teuchos::REDUCE_MIN;
2626 using Teuchos::reduceAll;
2627 using Teuchos::sublist;
2630 typedef LocalOrdinal LO;
2631 typedef GlobalOrdinal GO;
2632 typedef typename ArrayView<const GO>::size_type size_type;
2633 typedef ::Tpetra::Map<LO, GO, InputNodeType> input_map_type;
2634 typedef ::Tpetra::Map<LO, GO, OutputNodeType> output_map_type;
2635 const char prefix[] =
"Tpetra::Details::CrsGraphCopier::clone: ";
2639 bool fillCompleteClone =
true;
2640 bool useLocalIndices = graphIn.hasColMap ();
2643 if (! params.is_null ()) {
2644 fillCompleteClone = params->get (
"fillComplete clone", fillCompleteClone);
2645 useLocalIndices = params->get (
"Locally indexed clone", useLocalIndices);
2646 if (params->get (
"Static profile clone",
true) ==
false) {
2649 debug = params->get (
"Debug", debug);
2652 const Teuchos::Comm<int>& comm = * (graphIn.getRowMap ()->getComm ());
2653 const int myRank = comm.getRank ();
2655 TEUCHOS_TEST_FOR_EXCEPTION(
2656 ! graphIn.hasColMap () && useLocalIndices, std::runtime_error,
2657 prefix <<
"You asked clone() to use local indices (by setting the " 2658 "\"Locally indexed clone\" parameter to true), but the source graph " 2659 "does not yet have a column Map, so this is impossible.");
2662 std::ostringstream os;
2663 os <<
"Process " << myRank <<
": Cloning row Map" << endl;
2667 RCP<const output_map_type> clonedRowMap =
2668 graphIn.getRowMap ()->template clone<OutputNodeType> (nodeOut);
2672 RCP<output_crs_graph_type> clonedGraph;
2674 ArrayRCP<const size_t> numEntriesPerRow;
2675 size_t numEntriesForAll = 0;
2676 bool boundSameForAllLocalRows =
true;
2679 std::ostringstream os;
2680 os <<
"Process " << myRank <<
": Getting per-row bounds" << endl;
2683 graphIn.getNumEntriesPerLocalRowUpperBound (numEntriesPerRow,
2685 boundSameForAllLocalRows);
2687 std::ostringstream os;
2688 os <<
"Process " << myRank <<
": numEntriesForAll = " 2689 << numEntriesForAll << endl;
2694 std::ostringstream os;
2695 os <<
"Process " << myRank <<
": graphIn.getNodeMaxNumRowEntries() = " 2696 << graphIn.getNodeMaxNumRowEntries () << endl;
2700 RCP<ParameterList> graphparams;
2701 if (params.is_null ()) {
2702 graphparams = parameterList (
"CrsGraph");
2704 graphparams = sublist (params,
"CrsGraph");
2706 if (useLocalIndices) {
2707 RCP<const output_map_type> clonedColMap =
2708 graphIn.getColMap ()->template clone<OutputNodeType> (nodeOut);
2709 if (boundSameForAllLocalRows) {
2710 clonedGraph = rcp (
new output_crs_graph_type (clonedRowMap, clonedColMap,
2711 numEntriesForAll, pftype,
2714 clonedGraph = rcp (
new output_crs_graph_type (clonedRowMap, clonedColMap,
2715 numEntriesPerRow, pftype,
2719 if (boundSameForAllLocalRows) {
2720 clonedGraph = rcp (
new output_crs_graph_type (clonedRowMap,
2721 numEntriesForAll, pftype,
2724 clonedGraph = rcp (
new output_crs_graph_type (clonedRowMap,
2726 pftype, graphparams));
2731 std::ostringstream os;
2732 os <<
"Process " << myRank <<
": Invoked output graph's constructor" << endl;
2737 numEntriesPerRow = null;
2738 numEntriesForAll = 0;
2741 const input_map_type& inputRowMap = * (graphIn.getRowMap ());
2742 const size_type numRows =
2743 static_cast<size_type
> (inputRowMap.getNodeNumElements ());
2745 bool failed =
false;
2747 if (useLocalIndices) {
2748 const LO localMinLID = inputRowMap.getMinLocalIndex ();
2749 const LO localMaxLID = inputRowMap.getMaxLocalIndex ();
2751 if (graphIn.isLocallyIndexed ()) {
2754 ArrayView<const LO> linds;
2755 for (LO lrow = localMinLID; lrow <= localMaxLID; ++lrow) {
2756 graphIn.getLocalRowView (lrow, linds);
2757 if (linds.size () != 0) {
2758 clonedGraph->insertLocalIndices (lrow, linds);
2762 catch (std::exception& e) {
2763 std::ostringstream os;
2764 os <<
"Process " << myRank <<
": copying (reading local by view, " 2765 "writing local) indices into the output graph threw an " 2766 "exception: " << e.what () << endl;
2773 TEUCHOS_TEST_FOR_EXCEPTION(
2774 ! graphIn.hasColMap () && useLocalIndices, std::invalid_argument,
2775 prefix <<
"You asked clone() to use local indices (by setting the " 2776 "\"Locally indexed clone\" parameter to true), but the source graph " 2777 "does not yet have a column Map, so this is impossible.");
2792 size_t myMaxNumRowEntries =
2793 graphIn.isFillActive () ?
static_cast<size_t> (0) :
2794 graphIn.getNodeMaxNumRowEntries ();
2796 Array<LO> linds (myMaxNumRowEntries);
2799 for (LO lrow = localMinLID; lrow <= localMaxLID; ++lrow) {
2800 size_t theNumEntries = graphIn.getNumEntriesInLocalRow (lrow);
2801 if (theNumEntries > myMaxNumRowEntries) {
2802 myMaxNumRowEntries = theNumEntries;
2803 linds.resize (myMaxNumRowEntries);
2805 graphIn.getLocalRowCopy (lrow, linds (), theNumEntries);
2806 if (theNumEntries != 0) {
2807 clonedGraph->insertLocalIndices (lrow, linds (0, theNumEntries));
2811 catch (std::exception& e) {
2812 std::ostringstream os;
2813 os <<
"Process " << myRank <<
": copying (reading local by copy, " 2814 "writing local) indices into the output graph threw an exception: " 2815 << e.what () << endl;
2823 const GlobalOrdinal localMinGID = inputRowMap.getMinGlobalIndex ();
2824 const GlobalOrdinal localMaxGID = inputRowMap.getMaxGlobalIndex ();
2825 const bool inputRowMapIsContiguous = inputRowMap.isContiguous ();
2827 if (graphIn.isGloballyIndexed ()) {
2828 ArrayView<const GlobalOrdinal> ginds;
2830 if (inputRowMapIsContiguous) {
2832 for (GO grow = localMinGID; grow <= localMaxGID; ++grow) {
2833 graphIn.getGlobalRowView (grow, ginds);
2834 if (ginds.size () != 0) {
2835 clonedGraph->insertGlobalIndices (grow, ginds);
2839 catch (std::exception& e) {
2840 std::ostringstream os;
2841 os <<
"Process " << myRank <<
": copying (reading global by view, " 2842 "writing global) indices into the output graph threw an " 2843 "exception: " << e.what () << endl;
2850 ArrayView<const GO> inputRowMapGIDs = inputRowMap.getNodeElementList ();
2851 for (size_type k = 0; k < numRows; ++k) {
2852 const GO grow = inputRowMapGIDs[k];
2853 graphIn.getGlobalRowView (grow, ginds);
2854 if (ginds.size () != 0) {
2855 clonedGraph->insertGlobalIndices (grow, ginds);
2859 catch (std::exception& e) {
2860 std::ostringstream os;
2861 os <<
"Process " << myRank <<
": copying (reading global by view, " 2862 "writing global) indices into the output graph threw an " 2863 "exception: " << e.what () << endl;
2876 size_t myMaxNumRowEntries =
2877 graphIn.isFillActive () ?
static_cast<size_t> (0) :
2878 graphIn.getNodeMaxNumRowEntries ();
2880 Array<GO> ginds (myMaxNumRowEntries);
2882 if (inputRowMapIsContiguous) {
2884 for (GO grow = localMinGID; grow <= localMaxGID; ++grow) {
2885 size_t theNumEntries = graphIn.getNumEntriesInGlobalRow (grow);
2886 if (theNumEntries > myMaxNumRowEntries) {
2887 myMaxNumRowEntries = theNumEntries;
2888 ginds.resize (myMaxNumRowEntries);
2890 graphIn.getGlobalRowCopy (grow, ginds (), theNumEntries);
2891 if (theNumEntries != 0) {
2892 clonedGraph->insertGlobalIndices (grow, ginds (0, theNumEntries));
2896 catch (std::exception& e) {
2897 std::ostringstream os;
2898 os <<
"Process " << myRank <<
": copying (reading global by copy, " 2899 "writing global) indices into the output graph threw an " 2900 "exception: " << e.what () << endl;
2907 ArrayView<const GO> inputRowMapGIDs = inputRowMap.getNodeElementList ();
2908 for (size_type k = 0; k < numRows; ++k) {
2909 const GO grow = inputRowMapGIDs[k];
2911 size_t theNumEntries = graphIn.getNumEntriesInGlobalRow (grow);
2912 if (theNumEntries > myMaxNumRowEntries) {
2913 myMaxNumRowEntries = theNumEntries;
2914 ginds.resize (myMaxNumRowEntries);
2916 graphIn.getGlobalRowCopy (grow, ginds (), theNumEntries);
2917 if (theNumEntries != 0) {
2918 clonedGraph->insertGlobalIndices (grow, ginds (0, theNumEntries));
2922 catch (std::exception& e) {
2923 std::ostringstream os;
2924 os <<
"Process " << myRank <<
": copying (reading global by copy, " 2925 "writing global) indices into the output graph threw an " 2926 "exception: " << e.what () << endl;
2936 std::ostringstream os;
2937 os <<
"Process " << myRank <<
": copied entries" << endl;
2941 if (fillCompleteClone) {
2942 RCP<ParameterList> fillparams = params.is_null () ?
2943 parameterList (
"fillComplete") :
2944 sublist (params,
"fillComplete");
2946 RCP<const output_map_type> clonedRangeMap;
2947 RCP<const output_map_type> clonedDomainMap;
2948 if (! graphIn.getRangeMap ().is_null () &&
2949 graphIn.getRangeMap () != graphIn.getRowMap ()) {
2951 graphIn.getRangeMap ()->template clone<OutputNodeType> (nodeOut);
2954 clonedRangeMap = clonedRowMap;
2956 if (! graphIn.getDomainMap ().is_null ()
2957 && graphIn.getDomainMap () != graphIn.getRowMap ()) {
2959 graphIn.getDomainMap ()->template clone<OutputNodeType> (nodeOut);
2962 clonedDomainMap = clonedRowMap;
2966 std::ostringstream os;
2967 os <<
"Process " << myRank <<
": About to call fillComplete on " 2968 "cloned graph" << endl;
2971 clonedGraph->fillComplete (clonedDomainMap, clonedRangeMap, fillparams);
2973 catch (std::exception &e) {
2975 std::ostringstream os;
2976 os << prefix <<
"Process " << myRank <<
": Caught the following " 2977 "exception while calling fillComplete() on clone of type" 2978 << endl << Teuchos::typeName (*clonedGraph) << endl;
2983 int lclSuccess = failed ? 0 : 1;
2985 reduceAll<int, int> (comm, REDUCE_MIN, lclSuccess, outArg (gblSuccess));
2986 TEUCHOS_TEST_FOR_EXCEPTION(
2987 gblSuccess != 1, std::logic_error, prefix <<
2988 "Clone failed on at least one process.");
2991 std::ostringstream os;
2992 os <<
"Process " << myRank <<
": Done with CrsGraph::clone" << endl;
3002 #endif // TPETRA_CRSGRAPH_DECL_HPP Base class for distributed Tpetra objects that support data redistribution.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Node node_type
This class' Kokkos Node type.
Node::device_type device_type
This class' Kokkos device type.
Communication plan for data redistribution from a (possibly) multiply-owned to a uniquely-owned distr...
size_t nodeNumDiags_
Local number of (populated) diagonal entries.
::Tpetra::Details::EStorageStatus storageStatus_
Status of the graph's storage, when not in a fill-complete state.
t_GlobalOrdinal_1D k_gblInds1D_
Global column indices for all rows.
Teuchos::RCP< const map_type > domainMap_
The Map describing the domain of the (matrix corresponding to the) graph.
bool noRedundancies_
Whether the graph's indices are non-redundant (merged) in each row, on this process.
Teuchos::RCP< const import_type > importer_
The Import from the domain Map to the column Map.
Forward declaration of Tpetra::BlockCrsMatrix.
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().
void removeEmptyProcessesInPlace(Teuchos::RCP< DistObjectType > &input, const Teuchos::RCP< const Map< typename DistObjectType::local_ordinal_type, typename DistObjectType::global_ordinal_type, typename DistObjectType::node_type > > &newMap)
Remove processes which contain no elements in this object's Map.
A distributed graph accessed by rows (adjacency lists) and stored sparsely.
Kokkos::View< const size_t *, execution_space >::HostMirror k_numAllocPerRow_
The maximum number of entries to allow in each locally owned row, per row.
Allocation information for a locally owned row in a CrsGraph or CrsMatrix.
int local_ordinal_type
Default value of Scalar template parameter.
bool upperTriangular_
Whether the graph is locally upper triangular.
An abstract interface for graphs accessed by rows.
Implementation details of Tpetra.
Teuchos::RCP< const export_type > exporter_
The Export from the row Map to the range Map.
global_size_t globalMaxNumRowEntries_
Global maximum of the number of entries in each row.
Sparse matrix that presents a row-oriented interface that lets users read or modify entries...
size_t global_size_t
Global size_t object.
size_t numAllocForAllRows_
The maximum number of entries to allow in each locally owned row.
Classes::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > CrsGraph
Alias for Tpetra::Classes::CrsGraph.
local_graph_type::row_map_type::non_const_type t_RowPtrsNC TPETRA_DEPRECATED
DEPRECATED; use local_graph_type::row_map_type::non_const_type instead.
bool haveGlobalConstants_
Whether all processes have computed global constants.
std::map< GlobalOrdinal, std::vector< GlobalOrdinal > > nonlocals_
Nonlocal data given to insertGlobalIndices.
local_graph_type::row_map_type::const_type k_rowPtrs_
Row offsets for "1-D" storage.
Sets up and executes a communication plan for a Tpetra DistObject.
CombineMode
Rule for combining data in an Import or Export.
size_t nodeMaxNumRowEntries_
Local maximum of the number of entries in each row.
bool lowerTriangular_
Whether the graph is locally lower triangular.
CrsGraphType::global_ordinal_type getGlobalNumDiags(const CrsGraphType &G)
Number of populated diagonal entries in the given sparse graph, over all processes in the graph's (MP...
Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const Teuchos::RCP< Node2 > &node2, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null) const
Create a cloned CrsGraph for a different Node type.
Forward declaration of Tpetra::CrsMatrix.
local_graph_type::row_map_type t_RowPtrs TPETRA_DEPRECATED
DEPRECATED; use local_graph_type::row_map_type instead.
Abstract base class for objects that can be the source of an Import or Export operation.
local_graph_type::entries_type::non_const_type k_lclInds1D_
Local column indices for all rows.
num_row_entries_type k_numRowEntries_
The number of local entries in each locally owned row.
local_graph_type lclGraph_
Local graph; only initialized after first fillComplete() call.
::Kokkos::Compat::KokkosDeviceWrapperNode< execution_space > node_type
Default value of Node template parameter.
Kokkos::StaticCrsGraph< LocalOrdinal, Kokkos::LayoutLeft, execution_space > local_graph_type
The type of the part of the sparse graph on each MPI process.
global_size_t globalNumEntries_
Global number of entries in the graph.
Teuchos::RCP< const map_type > rangeMap_
The Map describing the range of the (matrix corresponding to the) graph.
Communication plan for data redistribution from a uniquely-owned to a (possibly) multiply-owned distr...
bool haveLocalConstants_
Whether this process has computed local constants.
int makeColMap(Teuchos::RCP< const Tpetra::Map< LO, GO, NT > > &colMap, Teuchos::Array< int > &remotePIDs, const Teuchos::RCP< const Tpetra::Map< LO, GO, NT > > &domMap, const RowGraph< LO, GO, NT > &graph, const bool sortEachProcsGids=true, std::ostream *errStrm=NULL)
Make the graph's column Map.
global_size_t globalNumDiags_
Global number of (populated) diagonal entries.
Kokkos::View< size_t *, Kokkos::LayoutLeft, device_type >::HostMirror num_row_entries_type
The type of k_numRowEntries_ (see below).
LocalOrdinal local_ordinal_type
This class' first template parameter; the type of local indices.
Stand-alone utility functions and macros.
local_graph_type::entries_type::non_const_type t_LocalOrdinal_1D TPETRA_DEPRECATED
DEPRECATED; use local_graph_type::entries_type::non_const_type instead.
Teuchos::RCP< const map_type > rowMap_
The Map describing the distribution of rows of the graph.
ProfileType pftype_
Whether the graph was allocated with static or dynamic profile.
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
device_type::execution_space execution_space
This class' Kokkos execution space.
local_graph_type LocalStaticCrsGraphType TPETRA_DEPRECATED
DEPRECATED; use local_graph_type (above) instead.
A parallel distribution of indices over processes.
bool indicesAreSorted_
Whether the graph's indices are sorted in each row, on this process.
Teuchos::ArrayRCP< Teuchos::Array< GlobalOrdinal > > gblInds2D_
Global column indices for all rows.
GlobalOrdinal global_ordinal_type
This class' second template parameter; the type of global indices.
Teuchos::RCP< const map_type > colMap_
The Map describing the distribution of columns of the graph.
Mix-in to avoid spurious deprecation warnings due to #2630.
EStorageStatus
Status of the graph's or matrix's storage, when not in a fill-complete state.
Forward declaration of Tpetra::CrsGraph.
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 ...
Kokkos::View< GlobalOrdinal *, execution_space > t_GlobalOrdinal_1D
Type of the k_gblInds1D_ array of global column indices.
Teuchos::ArrayRCP< Teuchos::Array< LocalOrdinal > > lclInds2D_
Local column indices for all rows.
bool sortGhostsAssociatedWithEachProcessor_
Whether to require makeColMap() (and therefore fillComplete()) to order column Map GIDs associated wi...
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().