46 #ifndef XPETRA_TPETRAEXPORT_DEF_HPP
47 #define XPETRA_TPETRAEXPORT_DEF_HPP
50 #include "Tpetra_Distributor.hpp"
54 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
57 const Teuchos::RCP<const map_type>& target)
58 : export_(Teuchos::rcp(new Tpetra::
Export<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(source),
toTpetra(target)))) {
61 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
64 const Teuchos::RCP<const map_type>& target,
65 const Teuchos::RCP<Teuchos::ParameterList>& plist)
66 : export_(Teuchos::rcp(new Tpetra::
Export<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(source),
toTpetra(target), plist))) {
69 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
72 : export_(Teuchos::rcp(new Tpetra::
Export<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(rhs)))) {
75 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
80 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
85 return export_->getNumSameIDs();
88 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
93 return export_->getNumPermuteIDs();
96 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
97 ArrayView<const LocalOrdinal>
101 return export_->getPermuteFromLIDs();
104 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
105 ArrayView<const LocalOrdinal>
109 return export_->getPermuteToLIDs();
112 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
117 return export_->getNumRemoteIDs();
120 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
121 ArrayView<const LocalOrdinal>
125 return export_->getRemoteLIDs();
128 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
133 return export_->getNumExportIDs();
136 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
137 ArrayView<const LocalOrdinal>
141 return export_->getExportLIDs();
144 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
149 return export_->getExportPIDs();
152 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
153 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
157 return toXpetra(export_->getSourceMap());
160 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
161 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
165 return toXpetra(export_->getTargetMap());
168 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
172 export_->getDistributor().setParameterList(params);
173 auto revDistor = export_->getDistributor().getReverse(
false);
174 if (!revDistor.is_null())
175 revDistor->setParameterList(params);
178 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
185 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
188 const RCP<
const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>& exp)
192 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
193 RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>
199 #ifdef HAVE_XPETRA_EPETRA
201 #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))))
206 :
public Export<int, int, EpetraNode> {
219 TpetraExport(
const Teuchos::RCP<const map_type>& source,
const Teuchos::RCP<const map_type>& target) {
228 const Teuchos::RCP<const map_type>& target,
229 const Teuchos::RCP<Teuchos::ParameterList>& plist) {
259 ArrayView<const LocalOrdinal>
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
262 ArrayView<const LocalOrdinal>
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
268 ArrayView<const LocalOrdinal>
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
274 ArrayView<const LocalOrdinal>
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
277 ArrayView<const int>
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
280 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
getSourceMap()
const {
return Teuchos::null; }
283 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
getTargetMap()
const {
return Teuchos::null; }
294 void print(std::ostream& os)
const {
303 TpetraExport(
const RCP<
const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>& exp) {
310 RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>
getTpetra_Export()
const {
return Teuchos::null; }
315 #endif // #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT)))
317 #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))))
322 :
public Export<int, long long, EpetraNode> {
335 TpetraExport(
const Teuchos::RCP<const map_type>& source,
const Teuchos::RCP<const map_type>& target) {
344 const Teuchos::RCP<const map_type>& target,
345 const Teuchos::RCP<Teuchos::ParameterList>& plist) {
375 ArrayView<const LocalOrdinal>
getPermuteFromLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
378 ArrayView<const LocalOrdinal>
getPermuteToLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
384 ArrayView<const LocalOrdinal>
getRemoteLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
390 ArrayView<const LocalOrdinal>
getExportLIDs()
const {
return Teuchos::ArrayView<const LocalOrdinal>(); }
393 ArrayView<const int>
getExportPIDs()
const {
return Teuchos::ArrayView<const int>(); }
396 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
getSourceMap()
const {
return Teuchos::null; }
399 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node>>
getTargetMap()
const {
return Teuchos::null; }
410 void print(std::ostream& os)
const {
419 TpetraExport(
const RCP<
const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>& exp) {
426 RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>>
getTpetra_Export()
const {
return Teuchos::null; }
431 #endif // #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))
433 #endif // HAVE_XPETRA_EPETRA
437 #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)