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>
64 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
68 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
72 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
78 {
XPETRA_MONITOR(
"TpetraImport::getNumSameIDs");
return import_->getNumSameIDs(); }
80 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
82 {
XPETRA_MONITOR(
"TpetraImport::getNumPermuteIDs");
return import_->getNumPermuteIDs(); }
84 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
86 {
XPETRA_MONITOR(
"TpetraImport::getPermuteFromLIDs");
return import_->getPermuteFromLIDs(); }
88 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
90 {
XPETRA_MONITOR(
"TpetraImport::getPermuteToLIDs");
return import_->getPermuteToLIDs(); }
92 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
94 {
XPETRA_MONITOR(
"TpetraImport::getNumRemoteIDs");
return import_->getNumRemoteIDs(); }
96 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
99 import_->getDistributor().setParameterList(params);
100 auto revDistor = import_->getDistributor().getReverse(
false);
101 if (!revDistor.is_null())
102 revDistor->setParameterList(params);
105 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
107 {
XPETRA_MONITOR(
"TpetraImport::getRemoteLIDs");
return import_->getRemoteLIDs(); }
109 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
111 {
XPETRA_MONITOR(
"TpetraImport::getNumExportIDs");
return import_->getNumExportIDs(); }
113 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
115 {
XPETRA_MONITOR(
"TpetraImport::getExportLIDs");
return import_->getExportLIDs(); }
117 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
119 {
XPETRA_MONITOR(
"TpetraImport::getExportPIDs");
return import_->getExportPIDs(); }
121 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
125 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
129 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
133 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
137 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
142 #ifdef HAVE_XPETRA_EPETRA
144 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
145 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
164 TpetraImport(
const Teuchos::RCP< const map_type > &source,
const Teuchos::RCP< const map_type > &target) {
169 TpetraImport(
const Teuchos::RCP< const map_type > &source,
const Teuchos::RCP< const map_type > &target,
const Teuchos::RCP< Teuchos::ParameterList > &plist) {
193 ArrayView< const LocalOrdinal >
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
196 ArrayView< const LocalOrdinal >
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
202 ArrayView< const LocalOrdinal >
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
208 ArrayView< const LocalOrdinal >
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
211 ArrayView< const int >
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
214 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getSourceMap()
const {
return Teuchos::null; }
217 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getTargetMap()
const {
return Teuchos::null; }
228 void print(std::ostream &os)
const { }
236 TpetraImport(
const RCP<
const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > &
import) {
240 RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > >
getTpetra_Import()
const {
return Teuchos::null; }
247 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
248 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
267 TpetraImport(
const Teuchos::RCP< const map_type > &source,
const Teuchos::RCP< const map_type > &target) {
272 TpetraImport(
const Teuchos::RCP< const map_type > &source,
const Teuchos::RCP< const map_type > &target,
const Teuchos::RCP< Teuchos::ParameterList > &plist) {
296 ArrayView< const LocalOrdinal >
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
299 ArrayView< const LocalOrdinal >
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
305 ArrayView< const LocalOrdinal >
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
311 ArrayView< const LocalOrdinal >
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
314 ArrayView< const int >
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
317 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getSourceMap()
const {
return Teuchos::null; }
320 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getTargetMap()
const {
return Teuchos::null; }
331 void print(std::ostream &os)
const { }
339 TpetraImport(
const RCP<
const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > &
import) {
343 RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > >
getTpetra_Import()
const {
return Teuchos::null; }
350 #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.
RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Import() const
size_t getNumExportIDs() const
Number of entries that must be sent by the calling process to other processes.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The Target Map used to construct this Import object.
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 LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
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 LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
~TpetraImport()
Destructor.
ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
TpetraImport(const Import< LocalOrdinal, GlobalOrdinal, Node > &import)
Copy constructor.
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.
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
TpetraImport(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct an Import from the source and target Maps.
ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
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.
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Import() const
ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The Target Map used to construct this Import object.
TpetraImport(const RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > &import)
TpetraImport constructor to wrap a Tpetra::Import object.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
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 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.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const
The Source Map used to construct this Import object.
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.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const
The Source Map used to construct this Import object.
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).
ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
~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.