46 #ifndef XPETRA_TPETRAIMPORT_DEF_HPP
47 #define XPETRA_TPETRAIMPORT_DEF_HPP
54 #include "Xpetra_TpetraMap.hpp"
55 #include "Tpetra_Import.hpp"
56 #include "Tpetra_Distributor.hpp"
60 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
62 : import_(Teuchos::rcp(new Tpetra::
Import<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(source),
toTpetra(target)))) {}
64 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
66 : import_(Teuchos::rcp(new Tpetra::
Import<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(source),
toTpetra(target), plist))) {}
68 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
70 : import_(Teuchos::rcp(new Tpetra::
Import<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(import)))) {}
72 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
75 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
78 Teuchos::RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > newImport = import_->createRemoteOnlyImport(
toTpetra(remoteTarget));
82 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
85 return import_->getNumSameIDs();
88 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
91 return import_->getNumPermuteIDs();
94 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
97 return import_->getPermuteFromLIDs();
100 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
103 return import_->getPermuteToLIDs();
106 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
109 return import_->getNumRemoteIDs();
112 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
115 import_->getDistributor().setParameterList(params);
116 auto revDistor = import_->getDistributor().getReverse(
false);
117 if (!revDistor.is_null())
118 revDistor->setParameterList(params);
121 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
124 return import_->getRemoteLIDs();
127 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
130 return import_->getNumExportIDs();
133 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
136 return import_->getExportLIDs();
139 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
142 return import_->getExportPIDs();
145 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
148 return toXpetra(import_->getSourceMap());
151 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
154 return toXpetra(import_->getTargetMap());
157 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
163 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
167 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
170 #ifdef HAVE_XPETRA_EPETRA
172 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
173 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
190 TpetraImport(
const Teuchos::RCP<const map_type> &source,
const Teuchos::RCP<const map_type> &target) {
195 TpetraImport(
const Teuchos::RCP<const map_type> &source,
const Teuchos::RCP<const map_type> &target,
const Teuchos::RCP<Teuchos::ParameterList> &plist) {
208 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
210 return Teuchos::null;
225 ArrayView<const LocalOrdinal>
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
228 ArrayView<const LocalOrdinal>
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
234 ArrayView<const LocalOrdinal>
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
240 ArrayView<const LocalOrdinal>
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
243 ArrayView<const int>
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
246 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getSourceMap()
const {
return Teuchos::null; }
249 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getTargetMap()
const {
return Teuchos::null; }
260 void print(std::ostream &os)
const {
269 TpetraImport(
const RCP<
const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > &
import) {
273 RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_Import()
const {
return Teuchos::null; }
280 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
281 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
298 TpetraImport(
const Teuchos::RCP<const map_type> &source,
const Teuchos::RCP<const map_type> &target) {
303 TpetraImport(
const Teuchos::RCP<const map_type> &source,
const Teuchos::RCP<const map_type> &target,
const Teuchos::RCP<Teuchos::ParameterList> &plist) {
316 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
318 return Teuchos::null;
333 ArrayView<const LocalOrdinal>
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
336 ArrayView<const LocalOrdinal>
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
342 ArrayView<const LocalOrdinal>
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
348 ArrayView<const LocalOrdinal>
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
351 ArrayView<const int>
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
354 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getSourceMap()
const {
return Teuchos::null; }
357 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getTargetMap()
const {
return Teuchos::null; }
368 void print(std::ostream &os)
const {
377 TpetraImport(
const RCP<
const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > &
import) {
381 RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_Import()
const {
return Teuchos::null; }
388 #endif // HAVE_XPETRA_EPETRA
void print(std::ostream &os) const
Print the Import's data to the given output stream.
TpetraImport(const Import< LocalOrdinal, GlobalOrdinal, Node > &import)
Copy constructor.
size_t getNumSameIDs() const
Number of initial identical IDs.
size_t getNumExportIDs() const
Number of entries that must be sent by the calling process to other processes.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The Target Map used to construct this Import object.
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Import() const
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
~TpetraImport()
Destructor.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
ArrayView< const LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
TpetraImport(const Import< LocalOrdinal, GlobalOrdinal, Node > &import)
Copy constructor.
ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
void print(std::ostream &os) const
Print the Import's data to the given output stream.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The Target Map used to construct this Import object.
size_t getNumExportIDs() const
Number of entries that must be sent by the calling process to other processes.
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > createRemoteOnlyImport(const Teuchos::RCP< const map_type > &remoteTarget) const
Special "constructor".
RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Import() const
TpetraImport(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct an Import from the source and target Maps.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set parameters on the underlying object.
TpetraImport(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target, const Teuchos::RCP< Teuchos::ParameterList > &plist)
Constructor (with list of parameters).
TpetraImport(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct an Import from the source and target Maps.
~TpetraImport()
Destructor.
TpetraImport(const RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > &import)
TpetraImport constructor to wrap a Tpetra::Import object.
size_t getNumSameIDs() const
Number of initial identical IDs.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The Target Map used to construct this Import object.
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > createRemoteOnlyImport(const Teuchos::RCP< const map_type > &remoteTarget) const
Special "constructor".
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > 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
Special "constructor".
TpetraImport(const RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > &import)
TpetraImport constructor to wrap a Tpetra::Import object.
TpetraImport(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct an Import from the source and target Maps.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set parameters on distributor.
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const
The Source Map used to construct this Import object.
#define XPETRA_MONITOR(funcName)
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.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set parameters on the underlying object.
RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Import() const
void print(std::ostream &os) const
Print the Import's data to the given output stream.
size_t getNumExportIDs() const
Number of entries that must be sent by the calling process to other processes.
ArrayView< const LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
TpetraImport(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target, const Teuchos::RCP< Teuchos::ParameterList > &plist)
Constructor (with list of parameters).
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const
The Source Map used to construct this Import object.
~TpetraImport()
Destructor.
size_t getNumSameIDs() const
Number of initial identical IDs.
ArrayView< const LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.