10 #ifndef TPETRA_IMPORT_DECL_HPP
11 #define TPETRA_IMPORT_DECL_HPP
13 #include "Tpetra_Details_Transfer.hpp"
74 template<
class LocalOrdinal,
81 friend class Export<LocalOrdinal,GlobalOrdinal,Node>;
98 Import (
const Teuchos::RCP<const map_type>& source,
99 const Teuchos::RCP<const map_type>& target);
111 Import (
const Teuchos::RCP<const map_type>& source,
112 const Teuchos::RCP<const map_type>& target,
113 const Teuchos::RCP<Teuchos::FancyOStream>& out);
127 Import (
const Teuchos::RCP<const map_type>& source,
128 const Teuchos::RCP<const map_type>& target,
129 const Teuchos::RCP<Teuchos::ParameterList>& plist);
146 Import (
const Teuchos::RCP<const map_type>& source,
147 const Teuchos::RCP<const map_type>& target,
148 const Teuchos::RCP<Teuchos::FancyOStream>& out,
149 const Teuchos::RCP<Teuchos::ParameterList>& plist);
162 Import (
const Teuchos::RCP<const map_type>& source,
163 const Teuchos::RCP<const map_type>& target,
164 Teuchos::Array<int> & remotePIDs,
165 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::rcp(
new Teuchos::ParameterList) );
212 const GlobalOrdinal targetMapRemoteOrPermuteGlobalIndices[],
213 const int targetMapRemoteOrPermuteProcessRanks[],
214 const LocalOrdinal numTargetMapRemoteOrPermuteGlobalIndices,
215 const bool mayReorderTargetMapIndicesLocally,
216 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null,
217 const Teuchos::RCP<Teuchos::FancyOStream>& out = Teuchos::null);
222 const Teuchos::ArrayView<int> & remotePIDs,
223 const Teuchos::ArrayView<const LocalOrdinal> & userExportLIDs,
224 const Teuchos::ArrayView<const int> & userExportPIDs,
225 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null,
226 const Teuchos::RCP<Teuchos::FancyOStream>& out = Teuchos::null);
249 Teuchos::Array<std::pair<int,GlobalOrdinal>>& remotePGIDs,
250 typename Teuchos::Array<GlobalOrdinal>::size_type& numSameGIDs,
251 typename Teuchos::Array<GlobalOrdinal>::size_type& numPermuteGIDs,
252 typename Teuchos::Array<GlobalOrdinal>::size_type& numRemoteGIDs,
253 const Teuchos::ArrayView<const GlobalOrdinal>& sameGIDs1,
254 const Teuchos::ArrayView<const GlobalOrdinal>& sameGIDs2,
255 Teuchos::Array<GlobalOrdinal>& permuteGIDs1,
256 Teuchos::Array<GlobalOrdinal>& permuteGIDs2,
257 Teuchos::Array<GlobalOrdinal>& remoteGIDs1,
258 Teuchos::Array<GlobalOrdinal>& remoteGIDs2,
259 Teuchos::Array<int>& remotePIDs1,
260 Teuchos::Array<int>& remotePIDs2)
const;
295 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
314 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
321 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
351 describe (Teuchos::FancyOStream& out,
352 const Teuchos::EVerbosityLevel verbLevel =
353 Teuchos::Describable::verbLevel_default)
const;
370 virtual void print (std::ostream& os)
const;
394 init (
const Teuchos::RCP<const map_type>& source,
395 const Teuchos::RCP<const map_type>& target,
397 Teuchos::Array<int> & remotePIDs,
398 const Teuchos::RCP<Teuchos::ParameterList>& plist);
431 void setupSamePermuteRemote (Teuchos::Array<GlobalOrdinal>& remoteGIDs);
462 setupExport (Teuchos::Array<GlobalOrdinal>& remoteGIDs,
463 bool useRemotePIDs, Teuchos::Array<int> & remotePIDs,
464 const Teuchos::RCP<Teuchos::ParameterList>& plist= Teuchos::null);
474 Import (
const Teuchos::RCP<const map_type>& source,
475 const Teuchos::RCP<const map_type>& target,
476 const size_t numSameID,
477 Teuchos::Array<LocalOrdinal>& permuteToLIDs,
478 Teuchos::Array<LocalOrdinal>& permuteFromLIDs,
479 Teuchos::Array<LocalOrdinal>& remoteLIDs,
480 Teuchos::Array<LocalOrdinal>& exportLIDs,
481 Teuchos::Array<int>& exportPIDs,
483 const Teuchos::RCP<Teuchos::FancyOStream>& out = Teuchos::null,
484 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null);
498 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
499 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
504 return Teuchos::null;
506 #ifdef HAVE_TPETRA_DEBUG
507 TEUCHOS_TEST_FOR_EXCEPTION(
508 src == Teuchos::null || tgt == Teuchos::null, std::runtime_error,
509 "Tpetra::createImport: Neither source nor target Map may be null.");
510 #endif // HAVE_TPETRA_DEBUG
512 return Teuchos::rcp (
new import_type (src, tgt));
525 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
526 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
529 const Teuchos::RCP<Teuchos::ParameterList>& plist)
532 return Teuchos::null;
534 #ifdef HAVE_TPETRA_DEBUG
535 TEUCHOS_TEST_FOR_EXCEPTION(
536 src == Teuchos::null || tgt == Teuchos::null, std::runtime_error,
537 "Tpetra::createImport(): neither source nor target map may be null:"
538 << std::endl <<
"source: " << src << std::endl <<
"target: " << tgt
540 #endif // HAVE_TPETRA_DEBUG
542 return Teuchos::rcp (
new import_type (src, tgt, plist));
547 #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.