28#include "Tpetra_Map.hpp"
29#include "Tpetra_Import.hpp"
32#include "Teuchos_FancyOStream.hpp"
44 template<
class MapType>
47 using local_ordinal_type =
typename MapType::local_ordinal_type;
48 using global_ordinal_type =
typename MapType::global_ordinal_type;
49 using node_type =
typename MapType::node_type;
53 static Teuchos::RCP<const map_type>
60 using ::Tpetra::Details::Behavior;
62 using Teuchos::ArrayView;
63 using Teuchos::FancyOStream;
64 using Teuchos::getFancyOStream;
67 using Teuchos::rcpFromRef;
69 using LO = local_ordinal_type;
70 using GO = global_ordinal_type;
71 const char prefix[] =
"Tpetra::Details::makeOptimizedColMap: ";
80 (
outPtr.is_null (), std::logic_error,
81 "outPtr is null; this should never happen!");
87 std::ostringstream
os;
88 const int myRank = comm->getRank ();
90 verboseHeader = std::unique_ptr<std::string> (
new std::string (
os.str ()));
93 std::ostringstream
os;
99 std::ostringstream
os;
113 const LO
colMapLclNumInds =
static_cast<LO
> (colMap.getLocalNumElements ());
116 std::ostringstream
os;
119 const GO
gid = colMap.getGlobalElement (
lid);
143 std::ostringstream
os;
179 err <<
prefix <<
"On Process " << comm->getRank () <<
", ownedPos = "
187 err <<
prefix <<
"On Process " << comm->getRank () <<
", remotePos = "
211 err <<
prefix <<
"On Process " << comm->getRank () <<
", some indices "
212 "in the input colMap (the original column Map) are not in domMap (the "
213 "domain Map). Either these indices or the domain Map is invalid. "
214 "Likely cause: For a nonsquare matrix, you must give the domain and "
215 "range Maps as input to fillComplete." <<
endl;
228 err <<
prefix <<
"On Process " << comm->getRank () <<
", "
229 "getRemoteIndexList returned -1 for the process ranks of "
230 "one or more GIDs on this process." <<
endl;
235 std::ostringstream
os;
245 std::ostringstream
os;
255 colMap.getIndexBase (),
258 std::ostringstream
os;
295 static std::pair<Teuchos::RCP<const map_type>,
296 Teuchos::RCP<import_type> >
347 template<
class MapType>
348 Teuchos::RCP<const MapType>
354 typename MapType::local_ordinal_type,
355 typename MapType::global_ordinal_type,
356 typename MapType::node_type>*
oldImport =
nullptr)
359 typename MapType::local_ordinal_type,
360 typename MapType::global_ordinal_type,
361 typename MapType::node_type>;
424 template<
class MapType>
425 std::pair<Teuchos::RCP<const MapType>,
426 Teuchos::RCP<typename OptColMap<MapType>::import_type> >
433 using local_ordinal_type =
typename MapType::local_ordinal_type;
434 using global_ordinal_type =
typename MapType::global_ordinal_type;
435 using node_type =
typename MapType::node_type;
Declaration of Tpetra::Details::Behavior, a class that describes Tpetra's behavior.
Stand-alone utility functions and macros.
Struct that holds views of the contents of a CrsMatrix.
static bool verbose()
Whether Tpetra is in verbose mode.
Implementation detail of makeOptimizedColMap, and makeOptimizedColMapAndImport.
static std::pair< Teuchos::RCP< const map_type >, Teuchos::RCP< import_type > > makeOptColMapAndImport(std::ostream &errStream, bool &lclErr, const map_type &domMap, const map_type &colMap, const import_type *oldImport)
Return an optimized reordering of the given column Map. Optionally, recompute an Import from the inpu...
Communication plan for data redistribution from a uniquely-owned to a (possibly) multiply-owned distr...
A parallel distribution of indices over processes.
Implementation details of Tpetra.
std::pair< Teuchos::RCP< const MapType >, Teuchos::RCP< typename OptColMap< MapType >::import_type > > makeOptimizedColMapAndImport(std::ostream &errStream, bool &lclErr, const MapType &domMap, const MapType &colMap, const typename OptColMap< MapType >::import_type *oldImport=nullptr)
Return an optimized reordering of the given column Map. Optionally, recompute an Import from the inpu...
Teuchos::RCP< const MapType > makeOptimizedColMap(std::ostream &errStream, bool &lclErr, const MapType &domMap, const MapType &colMap, const Tpetra::Import< typename MapType::local_ordinal_type, typename MapType::global_ordinal_type, typename MapType::node_type > *oldImport=nullptr)
Return an optimized reordering of the given column Map.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
void sort2(const IT1 &first1, const IT1 &last1, const IT2 &first2, const bool stableSort=false)
Sort the first array, and apply the resulting permutation to the second array.
LookupStatus
Return status of Map remote index lookup (getRemoteIndexList()).