10 #ifndef XPETRA_TPETRAEXPORT_DEF_HPP
11 #define XPETRA_TPETRAEXPORT_DEF_HPP
14 #include "Tpetra_Distributor.hpp"
18 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
21 const Teuchos::RCP<const map_type>& target)
22 : export_(Teuchos::rcp(new Tpetra::
Export<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(source),
toTpetra(target)))) {
25 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
28 const Teuchos::RCP<const map_type>& target,
29 const Teuchos::RCP<Teuchos::ParameterList>& plist)
30 : export_(Teuchos::rcp(new Tpetra::
Export<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(source),
toTpetra(target), plist))) {
33 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
36 : export_(Teuchos::rcp(new Tpetra::
Export<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(rhs)))) {
39 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
44 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
49 return export_->getNumSameIDs();
52 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
57 return export_->getNumPermuteIDs();
60 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
61 ArrayView<const LocalOrdinal>
65 return export_->getPermuteFromLIDs();
68 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
69 ArrayView<const LocalOrdinal>
73 return export_->getPermuteToLIDs();
76 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
81 return export_->getNumRemoteIDs();
84 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
85 ArrayView<const LocalOrdinal>
89 return export_->getRemoteLIDs();
92 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
97 return export_->getNumExportIDs();
100 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
101 ArrayView<const LocalOrdinal>
105 return export_->getExportLIDs();
108 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
113 return export_->getExportPIDs();
116 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
117 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
121 return toXpetra(export_->getSourceMap());
124 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
125 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
129 return toXpetra(export_->getTargetMap());
132 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
136 export_->getDistributor().setParameterList(params);
137 auto revDistor = export_->getDistributor().getReverse(
false);
138 if (!revDistor.is_null())
139 revDistor->setParameterList(params);
142 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
149 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
152 const RCP<
const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>& exp)
156 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
157 RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>
163 #ifdef HAVE_XPETRA_EPETRA
165 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
170 :
public Export<int, int, EpetraNode> {
183 TpetraExport(
const Teuchos::RCP<const map_type>& source,
const Teuchos::RCP<const map_type>& target) {
192 const Teuchos::RCP<const map_type>& target,
193 const Teuchos::RCP<Teuchos::ParameterList>& plist) {
223 ArrayView<const LocalOrdinal>
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
226 ArrayView<const LocalOrdinal>
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
232 ArrayView<const LocalOrdinal>
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
238 ArrayView<const LocalOrdinal>
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
241 ArrayView<const int>
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
244 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
getSourceMap()
const {
return Teuchos::null; }
247 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
getTargetMap()
const {
return Teuchos::null; }
258 void print(std::ostream& os)
const {
267 TpetraExport(
const RCP<
const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>& exp) {
274 RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>
getTpetra_Export()
const {
return Teuchos::null; }
279 #endif // #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT)))
281 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
286 :
public Export<int, long long, EpetraNode> {
299 TpetraExport(
const Teuchos::RCP<const map_type>& source,
const Teuchos::RCP<const map_type>& target) {
308 const Teuchos::RCP<const map_type>& target,
309 const Teuchos::RCP<Teuchos::ParameterList>& plist) {
339 ArrayView<const LocalOrdinal>
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
342 ArrayView<const LocalOrdinal>
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
348 ArrayView<const LocalOrdinal>
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
354 ArrayView<const LocalOrdinal>
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
357 ArrayView<const int>
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
360 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
getSourceMap()
const {
return Teuchos::null; }
363 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
getTargetMap()
const {
return Teuchos::null; }
374 void print(std::ostream& os)
const {
383 TpetraExport(
const RCP<
const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>& exp) {
390 RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>
getTpetra_Export()
const {
return Teuchos::null; }
395 #endif // #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))
397 #endif // HAVE_XPETRA_EPETRA
401 #endif // XPETRA_TPETRAEXPORT_DEF_HPP
size_t getNumSameIDs() const
Number of initial identical IDs.
TpetraExport(const Export< LocalOrdinal, GlobalOrdinal, Node > &rhs)
Copy constructor.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const
The source Map used to construct this Export.
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.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The target Map used to construct this Export.
TpetraExport(const RCP< const Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >> &exp)
TpetraExport constructor to wrap a Tpetra::Export object.
~TpetraExport()
Destructor.
TpetraExport(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).
RCP< const Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Export() const
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
TpetraExport(const Export< LocalOrdinal, GlobalOrdinal, Node > &rhs)
Copy constructor.
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.
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
RCP< const Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Export() const
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
ArrayView< const LocalOrdinal > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
void print(std::ostream &os) const
Print the Export's data to the given output stream.
TpetraExport(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct a Export object from the source and target Map.
size_t getNumSameIDs() const
Number of initial identical IDs.
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
size_t getNumExportIDs() const
Number of entries that must be sent by the calling process to other processes.
size_t getNumSameIDs() const
Number of initial identical IDs.
~TpetraExport()
Destructor.
~TpetraExport()
Destructor.
TpetraExport(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).
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
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::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
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 Export.
ArrayView< const LocalOrdinal > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getSourceMap() const
The source Map used to construct this Export.
TpetraExport(const RCP< const Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node >> &exp)
TpetraExport constructor to wrap a Tpetra::Export object.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set parameters on the underlying object.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set parameters on the underlying object.
RCP< const Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Export() const
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The target Map used to construct this Export.
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
void print(std::ostream &os) const
Print the Export's data to the given output stream.
TpetraExport(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct a Export object from the source and target Map.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set distributor parameters.
#define XPETRA_MONITOR(funcName)
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
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.
TpetraExport(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Construct a Export object from the source and target Map.
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.
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.
ArrayView< const LocalOrdinal > getExportLIDs() const
List of entries in the source Map that will be sent to 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 Export.
void print(std::ostream &os) const
Print the Export's data to the given output stream.
ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)