42 #ifndef TPETRA_IMPORT_DECL_HPP 43 #define TPETRA_IMPORT_DECL_HPP 45 #include "Tpetra_Details_Transfer.hpp" 113 class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
119 friend class Export<LocalOrdinal,GlobalOrdinal,Node>;
123 typedef ::Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node>
map_type;
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);
248 const GlobalOrdinal targetMapRemoteOrPermuteGlobalIndices[],
249 const int targetMapRemoteOrPermuteProcessRanks[],
250 const LocalOrdinal numTargetMapRemoteOrPermuteGlobalIndices,
251 const bool mayReorderTargetMapIndicesLocally,
252 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null,
253 const Teuchos::RCP<Teuchos::FancyOStream>& out = Teuchos::null);
263 Teuchos::Array<int> & userRemotePIDs,
264 Teuchos::Array<GlobalOrdinal>& remoteGIDs,
265 const Teuchos::ArrayView<const LocalOrdinal> & userExportLIDs,
266 const Teuchos::ArrayView<const int> & userExportPIDs,
267 const bool useRemotePIDs,
268 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null,
269 const Teuchos::RCP<Teuchos::FancyOStream>& out = Teuchos::null);
308 Teuchos::ArrayView<const LocalOrdinal>
getRemoteLIDs()
const;
314 Teuchos::ArrayView<const LocalOrdinal>
getExportLIDs()
const;
357 Teuchos::Array<std::pair<int,GlobalOrdinal>>& remotePGIDs,
358 typename Teuchos::Array<GlobalOrdinal>::size_type& numSameGIDs,
359 typename Teuchos::Array<GlobalOrdinal>::size_type& numPermuteGIDs,
360 typename Teuchos::Array<GlobalOrdinal>::size_type& numRemoteGIDs,
361 const Teuchos::ArrayView<const GlobalOrdinal>& sameGIDs1,
362 const Teuchos::ArrayView<const GlobalOrdinal>& sameGIDs2,
363 Teuchos::Array<GlobalOrdinal>& permuteGIDs1,
364 Teuchos::Array<GlobalOrdinal>& permuteGIDs2,
365 Teuchos::Array<GlobalOrdinal>& remoteGIDs1,
366 Teuchos::Array<GlobalOrdinal>& remoteGIDs2,
367 Teuchos::Array<int>& remotePIDs1,
368 Teuchos::Array<int>& remotePIDs2)
const;
403 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
422 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
430 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
461 describe (Teuchos::FancyOStream& out,
462 const Teuchos::EVerbosityLevel verbLevel =
463 Teuchos::Describable::verbLevel_default)
const;
480 virtual void print (std::ostream& os)
const;
485 Teuchos::RCP<ImportExportData<LocalOrdinal,GlobalOrdinal,Node> > ImportData_;
487 Teuchos::RCP<Teuchos::FancyOStream> out_;
511 init (
const Teuchos::RCP<const map_type>& source,
512 const Teuchos::RCP<const map_type>& target,
514 Teuchos::Array<int> & remotePIDs,
515 const Teuchos::RCP<Teuchos::ParameterList>& plist);
548 void setupSamePermuteRemote (Teuchos::Array<GlobalOrdinal>& remoteGIDs);
579 setupExport (Teuchos::Array<GlobalOrdinal>& remoteGIDs,
bool useRemotePIDs, Teuchos::Array<int> & remotePIDs);
589 Import (
const Teuchos::RCP<const map_type>& source,
590 const Teuchos::RCP<const map_type>& target,
591 const size_t numSameID,
592 Teuchos::Array<LocalOrdinal>& permuteToLIDs,
593 Teuchos::Array<LocalOrdinal>& permuteFromLIDs,
594 Teuchos::Array<LocalOrdinal>& remoteLIDs,
595 Teuchos::Array<LocalOrdinal>& exportLIDs,
596 Teuchos::Array<int>& exportPIDs,
598 const Teuchos::RCP<Teuchos::FancyOStream>& out = Teuchos::null,
599 const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null);
615 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
616 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
621 return Teuchos::null;
623 #ifdef HAVE_TPETRA_DEBUG 624 TEUCHOS_TEST_FOR_EXCEPTION(
625 src == Teuchos::null || tgt == Teuchos::null, std::runtime_error,
626 "Tpetra::createImport(): neither source nor target map may be null:" 627 << std::endl <<
"source: " << src << std::endl <<
"target: " << tgt
629 #endif // HAVE_TPETRA_DEBUG 631 return Teuchos::rcp (
new import_type (src, tgt));
644 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
645 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
648 const Teuchos::RCP<Teuchos::ParameterList>& plist)
651 return Teuchos::null;
653 #ifdef HAVE_TPETRA_DEBUG 654 TEUCHOS_TEST_FOR_EXCEPTION(
655 src == Teuchos::null || tgt == Teuchos::null, std::runtime_error,
656 "Tpetra::createImport(): neither source nor target map may be null:" 657 << std::endl <<
"source: " << src << std::endl <<
"target: " << tgt
659 #endif // HAVE_TPETRA_DEBUG 661 return Teuchos::rcp (
new import_type (src, tgt, plist));
666 #endif // TPETRA_IMPORT_DECL_HPP Teuchos::ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Communication plan for data redistribution from a (possibly) multiply-owned to a uniquely-owned distr...
Teuchos::RCP< const map_type > getTargetMap() const
The Target Map used to construct this Import object.
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.
Import< LocalOrdinal, GlobalOrdinal, Node > & operator=(const Import< LocalOrdinal, GlobalOrdinal, Node > &Source)
Assignment operator.
Forward declaration of Tpetra::ImportExportData.
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > setUnion() const
Return the union of this Import this->getSourceMap()
Teuchos::ArrayView< const LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
Teuchos::ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
Teuchos::RCP< const map_type > getSourceMap() const
The Source Map used to construct this Import object.
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.
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.
int local_ordinal_type
Default value of Scalar template parameter.
::Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
Forward declaration of Tpetra::Export.
Common base class of Import and Export.
Forward declaration of Tpetra::Import.
Sets up and executes a communication plan for a Tpetra DistObject.
Teuchos::ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
bool isLocallyComplete() const
Do all target Map indices on the calling process exist on at least one process (not necessarily this ...
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &plist)
Set parameters.
::Kokkos::Compat::KokkosDeviceWrapperNode< execution_space > node_type
Default value of Node template parameter.
Teuchos::ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
Import(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct an Import from the source and target Maps.
size_t getNumExportIDs() const
Number of entries that must be sent by the calling process to other processes.
Communication plan for data redistribution from a uniquely-owned to a (possibly) multiply-owned distr...
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.
Distributor & getDistributor() const
The Distributor that this Import object uses to move data.
virtual ~Import()
Destructor.
A parallel distribution of indices over processes.
virtual void print(std::ostream &os) const
Print the Import's data to the given output stream.
size_t getNumSameIDs() const
Number of initial identical IDs.