62#include "Tpetra_Map.hpp"
63#include "Tpetra_Import.hpp"
66#include "Teuchos_FancyOStream.hpp"
78 template<
class MapType>
81 using local_ordinal_type =
typename MapType::local_ordinal_type;
82 using global_ordinal_type =
typename MapType::global_ordinal_type;
83 using node_type =
typename MapType::node_type;
87 static Teuchos::RCP<const map_type>
94 using ::Tpetra::Details::Behavior;
96 using Teuchos::ArrayView;
97 using Teuchos::FancyOStream;
98 using Teuchos::getFancyOStream;
101 using Teuchos::rcpFromRef;
103 using LO = local_ordinal_type;
104 using GO = global_ordinal_type;
105 const char prefix[] =
"Tpetra::Details::makeOptimizedColMap: ";
114 (
outPtr.is_null (), std::logic_error,
115 "outPtr is null; this should never happen!");
121 std::ostringstream
os;
122 const int myRank = comm->getRank ();
124 verboseHeader = std::unique_ptr<std::string> (
new std::string (
os.str ()));
127 std::ostringstream
os;
133 std::ostringstream
os;
147 const LO
colMapLclNumInds =
static_cast<LO
> (colMap.getLocalNumElements ());
150 std::ostringstream
os;
153 const GO
gid = colMap.getGlobalElement (
lid);
177 std::ostringstream
os;
213 err <<
prefix <<
"On Process " << comm->getRank () <<
", ownedPos = "
221 err <<
prefix <<
"On Process " << comm->getRank () <<
", remotePos = "
245 err <<
prefix <<
"On Process " << comm->getRank () <<
", some indices "
246 "in the input colMap (the original column Map) are not in domMap (the "
247 "domain Map). Either these indices or the domain Map is invalid. "
248 "Likely cause: For a nonsquare matrix, you must give the domain and "
249 "range Maps as input to fillComplete." <<
endl;
262 err <<
prefix <<
"On Process " << comm->getRank () <<
", "
263 "getRemoteIndexList returned -1 for the process ranks of "
264 "one or more GIDs on this process." <<
endl;
269 std::ostringstream
os;
279 std::ostringstream
os;
289 colMap.getIndexBase (),
292 std::ostringstream
os;
329 static std::pair<Teuchos::RCP<const map_type>,
330 Teuchos::RCP<import_type> >
381 template<
class MapType>
382 Teuchos::RCP<const MapType>
388 typename MapType::local_ordinal_type,
389 typename MapType::global_ordinal_type,
390 typename MapType::node_type>*
oldImport =
nullptr)
393 typename MapType::local_ordinal_type,
394 typename MapType::global_ordinal_type,
395 typename MapType::node_type>;
458 template<
class MapType>
459 std::pair<Teuchos::RCP<const MapType>,
460 Teuchos::RCP<typename OptColMap<MapType>::import_type> >
467 using local_ordinal_type =
typename MapType::local_ordinal_type;
468 using global_ordinal_type =
typename MapType::global_ordinal_type;
469 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)
Sort the first array, and apply the resulting permutation to the second array.
LookupStatus
Return status of Map remote index lookup (getRemoteIndexList()).