10 #ifndef XPETRA_TPETRAIMPORT_DEF_HPP
11 #define XPETRA_TPETRAIMPORT_DEF_HPP
18 #include "Xpetra_TpetraMap.hpp"
19 #include "Tpetra_Import.hpp"
20 #include "Tpetra_Distributor.hpp"
24 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
26 : import_(Teuchos::rcp(new Tpetra::
Import<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(source),
toTpetra(target)))) {}
28 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
30 : import_(Teuchos::rcp(new Tpetra::
Import<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(source),
toTpetra(target), plist))) {}
32 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
34 : import_(Teuchos::rcp(new Tpetra::
Import<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(import)))) {}
36 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
39 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
40 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
42 Teuchos::RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > newImport = import_->createRemoteOnlyImport(
toTpetra(remoteTarget));
46 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
49 return import_->getNumSameIDs();
52 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
55 return import_->getNumPermuteIDs();
58 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
61 return import_->getPermuteFromLIDs();
64 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
67 return import_->getPermuteToLIDs();
70 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
73 return import_->getNumRemoteIDs();
76 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
79 import_->getDistributor().setParameterList(params);
80 auto revDistor = import_->getDistributor().getReverse(
false);
81 if (!revDistor.is_null())
82 revDistor->setParameterList(params);
85 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
88 return import_->getRemoteLIDs();
91 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
94 return import_->getNumExportIDs();
97 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
100 return import_->getExportLIDs();
103 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
106 return import_->getExportPIDs();
109 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
112 return toXpetra(import_->getSourceMap());
115 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
118 return toXpetra(import_->getTargetMap());
121 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
127 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
131 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
134 #ifdef HAVE_XPETRA_EPETRA
136 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
137 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
154 TpetraImport(
const Teuchos::RCP<const map_type> &source,
const Teuchos::RCP<const map_type> &target) {
159 TpetraImport(
const Teuchos::RCP<const map_type> &source,
const Teuchos::RCP<const map_type> &target,
const Teuchos::RCP<Teuchos::ParameterList> &plist) {
172 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
174 return Teuchos::null;
189 ArrayView<const LocalOrdinal>
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
192 ArrayView<const LocalOrdinal>
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
198 ArrayView<const LocalOrdinal>
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
204 ArrayView<const LocalOrdinal>
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
207 ArrayView<const int>
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
210 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getSourceMap()
const {
return Teuchos::null; }
213 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getTargetMap()
const {
return Teuchos::null; }
224 void print(std::ostream &os)
const {
233 TpetraImport(
const RCP<
const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > &
import) {
237 RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_Import()
const {
return Teuchos::null; }
244 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
245 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
262 TpetraImport(
const Teuchos::RCP<const map_type> &source,
const Teuchos::RCP<const map_type> &target) {
267 TpetraImport(
const Teuchos::RCP<const map_type> &source,
const Teuchos::RCP<const map_type> &target,
const Teuchos::RCP<Teuchos::ParameterList> &plist) {
280 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
282 return Teuchos::null;
297 ArrayView<const LocalOrdinal>
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
300 ArrayView<const LocalOrdinal>
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
306 ArrayView<const LocalOrdinal>
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
312 ArrayView<const LocalOrdinal>
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
315 ArrayView<const int>
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
318 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getSourceMap()
const {
return Teuchos::null; }
321 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getTargetMap()
const {
return Teuchos::null; }
332 void print(std::ostream &os)
const {
341 TpetraImport(
const RCP<
const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > &
import) {
345 RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_Import()
const {
return Teuchos::null; }
352 #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.