42 #ifndef TPETRA_IMPORT_DECL_HPP
43 #define TPETRA_IMPORT_DECL_HPP
45 #include "Tpetra_Details_Transfer.hpp"
111 template<
class LocalOrdinal,
118 friend class Export<LocalOrdinal,GlobalOrdinal,Node>;
135 Import (
const Teuchos::RCP<const map_type>& source,
136 const Teuchos::RCP<const map_type>& target);
148 Import (
const Teuchos::RCP<const map_type>& source,
149 const Teuchos::RCP<const map_type>& target,
150 const Teuchos::RCP<Teuchos::FancyOStream>& out);
164 Import (
const Teuchos::RCP<const map_type>& source,
165 const Teuchos::RCP<const map_type>& target,
166 const Teuchos::RCP<Teuchos::ParameterList>& plist);
183 Import (
const Teuchos::RCP<const map_type>& source,
184 const Teuchos::RCP<const map_type>& target,
185 const Teuchos::RCP<Teuchos::FancyOStream>& out,
186 const Teuchos::RCP<Teuchos::ParameterList>& plist);
199 Import (
const Teuchos::RCP<const map_type>& source,
200 const Teuchos::RCP<const map_type>& target,
201 Teuchos::Array<int> & remotePIDs,
202 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::rcp(
new Teuchos::ParameterList) );
249 const GlobalOrdinal targetMapRemoteOrPermuteGlobalIndices[],
250 const int targetMapRemoteOrPermuteProcessRanks[],
251 const LocalOrdinal numTargetMapRemoteOrPermuteGlobalIndices,
252 const bool mayReorderTargetMapIndicesLocally,
253 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null,
254 const Teuchos::RCP<Teuchos::FancyOStream>& out = Teuchos::null);
259 const Teuchos::ArrayView<int> & remotePIDs,
260 const Teuchos::ArrayView<const LocalOrdinal> & userExportLIDs,
261 const Teuchos::ArrayView<const int> & userExportPIDs,
262 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null,
263 const Teuchos::RCP<Teuchos::FancyOStream>& out = Teuchos::null);
286 Teuchos::Array<std::pair<int,GlobalOrdinal>>& remotePGIDs,
287 typename Teuchos::Array<GlobalOrdinal>::size_type& numSameGIDs,
288 typename Teuchos::Array<GlobalOrdinal>::size_type& numPermuteGIDs,
289 typename Teuchos::Array<GlobalOrdinal>::size_type& numRemoteGIDs,
290 const Teuchos::ArrayView<const GlobalOrdinal>& sameGIDs1,
291 const Teuchos::ArrayView<const GlobalOrdinal>& sameGIDs2,
292 Teuchos::Array<GlobalOrdinal>& permuteGIDs1,
293 Teuchos::Array<GlobalOrdinal>& permuteGIDs2,
294 Teuchos::Array<GlobalOrdinal>& remoteGIDs1,
295 Teuchos::Array<GlobalOrdinal>& remoteGIDs2,
296 Teuchos::Array<int>& remotePIDs1,
297 Teuchos::Array<int>& remotePIDs2)
const;
332 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
351 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
358 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
388 describe (Teuchos::FancyOStream& out,
389 const Teuchos::EVerbosityLevel verbLevel =
390 Teuchos::Describable::verbLevel_default)
const;
407 virtual void print (std::ostream& os)
const;
431 init (
const Teuchos::RCP<const map_type>& source,
432 const Teuchos::RCP<const map_type>& target,
434 Teuchos::Array<int> & remotePIDs,
435 const Teuchos::RCP<Teuchos::ParameterList>& plist);
468 void setupSamePermuteRemote (Teuchos::Array<GlobalOrdinal>& remoteGIDs);
499 setupExport (Teuchos::Array<GlobalOrdinal>& remoteGIDs,
500 bool useRemotePIDs, Teuchos::Array<int> & remotePIDs,
501 const Teuchos::RCP<Teuchos::ParameterList>& plist= Teuchos::null);
511 Import (
const Teuchos::RCP<const map_type>& source,
512 const Teuchos::RCP<const map_type>& target,
513 const size_t numSameID,
514 Teuchos::Array<LocalOrdinal>& permuteToLIDs,
515 Teuchos::Array<LocalOrdinal>& permuteFromLIDs,
516 Teuchos::Array<LocalOrdinal>& remoteLIDs,
517 Teuchos::Array<LocalOrdinal>& exportLIDs,
518 Teuchos::Array<int>& exportPIDs,
520 const Teuchos::RCP<Teuchos::FancyOStream>& out = Teuchos::null,
521 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null);
535 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
536 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
541 return Teuchos::null;
543 #ifdef HAVE_TPETRA_DEBUG
544 TEUCHOS_TEST_FOR_EXCEPTION(
545 src == Teuchos::null || tgt == Teuchos::null, std::runtime_error,
546 "Tpetra::createImport: Neither source nor target Map may be null.");
547 #endif // HAVE_TPETRA_DEBUG
549 return Teuchos::rcp (
new import_type (src, tgt));
562 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
563 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
566 const Teuchos::RCP<Teuchos::ParameterList>& plist)
569 return Teuchos::null;
571 #ifdef HAVE_TPETRA_DEBUG
572 TEUCHOS_TEST_FOR_EXCEPTION(
573 src == Teuchos::null || tgt == Teuchos::null, std::runtime_error,
574 "Tpetra::createImport(): neither source nor target map may be null:"
575 << std::endl <<
"source: " << src << std::endl <<
"target: " << tgt
577 #endif // HAVE_TPETRA_DEBUG
579 return Teuchos::rcp (
new import_type (src, tgt, plist));
584 #endif // TPETRA_IMPORT_DECL_HPP
Communication plan for data redistribution from a uniquely-owned to a (possibly) multiply-owned distr...
Common base class of Import and Export.
Import< LocalOrdinal, GlobalOrdinal, Node > & operator=(const Import< LocalOrdinal, GlobalOrdinal, Node > &Source)=default
Assignment operator.
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > createRemoteOnlyImport(const Teuchos::RCP< const map_type > &remoteTarget) const
Returns an importer that contains only the remote entries of this.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Describe this object in a human-readable way to the given output stream.
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > setUnion() const
Return the union of this Import this->getSourceMap()
Forward declaration of Tpetra::Export.
Import(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct an Import from the source and target Maps.
Forward declaration of Tpetra::Import.
Communication plan for data redistribution from a (possibly) multiply-owned to a uniquely-owned distr...
Sets up and executes a communication plan for a Tpetra DistObject.
virtual ~Import()=default
Destructor.
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > createImport(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &src, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &tgt)
Nonmember constructor for Import.
void findUnionTargetGIDs(Teuchos::Array< GlobalOrdinal > &unionTgtGIDs, Teuchos::Array< std::pair< int, GlobalOrdinal >> &remotePGIDs, typename Teuchos::Array< GlobalOrdinal >::size_type &numSameGIDs, typename Teuchos::Array< GlobalOrdinal >::size_type &numPermuteGIDs, typename Teuchos::Array< GlobalOrdinal >::size_type &numRemoteGIDs, const Teuchos::ArrayView< const GlobalOrdinal > &sameGIDs1, const Teuchos::ArrayView< const GlobalOrdinal > &sameGIDs2, Teuchos::Array< GlobalOrdinal > &permuteGIDs1, Teuchos::Array< GlobalOrdinal > &permuteGIDs2, Teuchos::Array< GlobalOrdinal > &remoteGIDs1, Teuchos::Array< GlobalOrdinal > &remoteGIDs2, Teuchos::Array< int > &remotePIDs1, Teuchos::Array< int > &remotePIDs2) const
Find the union of the target IDs from two Import objects.
A parallel distribution of indices over processes.
virtual void print(std::ostream &os) const
Print the Import's data to the given output stream.