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>
77 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
79 Teuchos::RCP<const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node> > newImport = import_->createRemoteOnlyImport(
toTpetra(remoteTarget));
85 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
87 {
XPETRA_MONITOR(
"TpetraImport::getNumSameIDs");
return import_->getNumSameIDs(); }
89 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
91 {
XPETRA_MONITOR(
"TpetraImport::getNumPermuteIDs");
return import_->getNumPermuteIDs(); }
93 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
95 {
XPETRA_MONITOR(
"TpetraImport::getPermuteFromLIDs");
return import_->getPermuteFromLIDs(); }
97 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
99 {
XPETRA_MONITOR(
"TpetraImport::getPermuteToLIDs");
return import_->getPermuteToLIDs(); }
101 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
103 {
XPETRA_MONITOR(
"TpetraImport::getNumRemoteIDs");
return import_->getNumRemoteIDs(); }
105 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
108 import_->getDistributor().setParameterList(params);
109 auto revDistor = import_->getDistributor().getReverse(
false);
110 if (!revDistor.is_null())
111 revDistor->setParameterList(params);
114 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
116 {
XPETRA_MONITOR(
"TpetraImport::getRemoteLIDs");
return import_->getRemoteLIDs(); }
118 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
120 {
XPETRA_MONITOR(
"TpetraImport::getNumExportIDs");
return import_->getNumExportIDs(); }
122 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
124 {
XPETRA_MONITOR(
"TpetraImport::getExportLIDs");
return import_->getExportLIDs(); }
126 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
128 {
XPETRA_MONITOR(
"TpetraImport::getExportPIDs");
return import_->getExportPIDs(); }
130 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
134 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
138 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
142 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
146 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
151 #ifdef HAVE_XPETRA_EPETRA 153 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \ 154 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT)))) 173 TpetraImport(
const Teuchos::RCP< const map_type > &source,
const Teuchos::RCP< const map_type > &target) {
178 TpetraImport(
const Teuchos::RCP< const map_type > &source,
const Teuchos::RCP< const map_type > &target,
const Teuchos::RCP< Teuchos::ParameterList > &plist) {
192 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
194 return Teuchos::null;
209 ArrayView< const LocalOrdinal >
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
212 ArrayView< const LocalOrdinal >
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
218 ArrayView< const LocalOrdinal >
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
224 ArrayView< const LocalOrdinal >
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
227 ArrayView< const int >
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
230 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getSourceMap()
const {
return Teuchos::null; }
233 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getTargetMap()
const {
return Teuchos::null; }
244 void print(std::ostream &os)
const { }
252 TpetraImport(
const RCP<
const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > &
import) {
256 RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > >
getTpetra_Import()
const {
return Teuchos::null; }
263 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \ 264 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))) 283 TpetraImport(
const Teuchos::RCP< const map_type > &source,
const Teuchos::RCP< const map_type > &target) {
288 TpetraImport(
const Teuchos::RCP< const map_type > &source,
const Teuchos::RCP< const map_type > &target,
const Teuchos::RCP< Teuchos::ParameterList > &plist) {
301 Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
303 return Teuchos::null;
318 ArrayView< const LocalOrdinal >
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
321 ArrayView< const LocalOrdinal >
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
327 ArrayView< const LocalOrdinal >
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
333 ArrayView< const LocalOrdinal >
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
336 ArrayView< const int >
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
339 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getSourceMap()
const {
return Teuchos::null; }
342 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getTargetMap()
const {
return Teuchos::null; }
353 void print(std::ostream &os)
const { }
361 TpetraImport(
const RCP<
const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > &
import) {
365 RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > >
getTpetra_Import()
const {
return Teuchos::null; }
372 #endif // HAVE_XPETRA_EPETRA
TpetraImport(const Import< LocalOrdinal, GlobalOrdinal, Node > &import)
Copy constructor.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set parameters on distributor.
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > createRemoteOnlyImport(const Teuchos::RCP< const map_type > &remoteTarget) const
Special "constructor".
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Import() const
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The Target Map used to construct this Import object.
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
size_t getNumSameIDs() const
Number of initial identical IDs.
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > createRemoteOnlyImport(const Teuchos::RCP< const map_type > &remoteTarget) const
Special "constructor".
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.
~TpetraImport()
Destructor.
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The Target Map used to construct this Import object.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
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
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const
The Source Map used to construct this Import object.
ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
void print(std::ostream &os) const
Print the Import's data to the given output stream.
ArrayView< const LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
void print(std::ostream &os) const
Print the Import's data to the given output stream.
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(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 LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
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.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The Target Map used to construct this Import object.
RCP< const Tpetra::Import< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Import() const
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const
The Source Map used to construct this Import object.
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set parameters on the underlying object.
Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > createRemoteOnlyImport(const Teuchos::RCP< const map_type > &remoteTarget) const
Special "constructor".
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
ArrayView< const LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
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)
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 getNumRemoteIDs() const
Number of entries not on the calling process.
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.
size_t getNumExportIDs() const
Number of entries that must be sent by the calling process to other processes.
#define XPETRA_MONITOR(funcName)
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
size_t getNumSameIDs() const
Number of initial identical IDs.
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.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set parameters on the underlying object.
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
size_t getNumExportIDs() const
Number of entries that must be sent by the calling process to other processes.
ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
ArrayView< const LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.