Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_TpetraExport_def.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Xpetra: A linear algebra interface package
4//
5// Copyright 2012 NTESS and the Xpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef XPETRA_TPETRAEXPORT_DEF_HPP
11#define XPETRA_TPETRAEXPORT_DEF_HPP
12
14#include "Tpetra_Distributor.hpp"
15
16namespace Xpetra {
17
18template <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)))) {
23}
24
25template <class LocalOrdinal, class GlobalOrdinal, class Node>
28 const Teuchos::RCP<const map_type>& target,
30 : export_(Teuchos::rcp(new Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(source), toTpetra(target), plist))) {
31}
32
33template <class LocalOrdinal, class GlobalOrdinal, class Node>
36 : export_(Teuchos::rcp(new Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rhs)))) {
37}
38
39template <class LocalOrdinal, class GlobalOrdinal, class Node>
43
44template <class LocalOrdinal, class GlobalOrdinal, class Node>
45size_t
47 getNumSameIDs() const {
48 XPETRA_MONITOR("TpetraExport::getNumSameIDs");
49 return export_->getNumSameIDs();
50}
51
52template <class LocalOrdinal, class GlobalOrdinal, class Node>
53size_t
55 getNumPermuteIDs() const {
56 XPETRA_MONITOR("TpetraExport::getNumPermuteIDs");
57 return export_->getNumPermuteIDs();
58}
59
60template <class LocalOrdinal, class GlobalOrdinal, class Node>
63 getPermuteFromLIDs() const {
64 XPETRA_MONITOR("TpetraExport::getPermuteFromLIDs");
65 return export_->getPermuteFromLIDs();
66}
67
68template <class LocalOrdinal, class GlobalOrdinal, class Node>
71 getPermuteToLIDs() const {
72 XPETRA_MONITOR("TpetraExport::getPermuteToLIDs");
73 return export_->getPermuteToLIDs();
74}
75
76template <class LocalOrdinal, class GlobalOrdinal, class Node>
77size_t
79 getNumRemoteIDs() const {
80 XPETRA_MONITOR("TpetraExport::getNumRemoteIDs");
81 return export_->getNumRemoteIDs();
82}
83
84template <class LocalOrdinal, class GlobalOrdinal, class Node>
87 getRemoteLIDs() const {
88 XPETRA_MONITOR("TpetraExport::getRemoteLIDs");
89 return export_->getRemoteLIDs();
90}
91
92template <class LocalOrdinal, class GlobalOrdinal, class Node>
93size_t
95 getNumExportIDs() const {
96 XPETRA_MONITOR("TpetraExport::getNumExportIDs");
97 return export_->getNumExportIDs();
98}
99
100template <class LocalOrdinal, class GlobalOrdinal, class Node>
103 getExportLIDs() const {
104 XPETRA_MONITOR("TpetraExport::getExportLIDs");
105 return export_->getExportLIDs();
106}
107
108template <class LocalOrdinal, class GlobalOrdinal, class Node>
111 getExportPIDs() const {
112 XPETRA_MONITOR("TpetraExport::getExportPIDs");
113 return export_->getExportPIDs();
114}
115
116template <class LocalOrdinal, class GlobalOrdinal, class Node>
119 getSourceMap() const {
120 XPETRA_MONITOR("TpetraExport::getSourceMap");
121 return toXpetra(export_->getSourceMap());
122}
123
124template <class LocalOrdinal, class GlobalOrdinal, class Node>
127 getTargetMap() const {
128 XPETRA_MONITOR("TpetraExport::getTargetMap");
129 return toXpetra(export_->getTargetMap());
130}
131
132template <class LocalOrdinal, class GlobalOrdinal, class Node>
135 XPETRA_MONITOR("TpetraExport::setDistributorParameters");
136 export_->getDistributor().setParameterList(params);
137 auto revDistor = export_->getDistributor().getReverse(false);
138 if (!revDistor.is_null())
139 revDistor->setParameterList(params);
140}
141
142template <class LocalOrdinal, class GlobalOrdinal, class Node>
144 print(std::ostream& os) const {
145 XPETRA_MONITOR("TpetraExport::print");
146 export_->print(os);
147}
148
149template <class LocalOrdinal, class GlobalOrdinal, class Node>
155
156template <class LocalOrdinal, class GlobalOrdinal, class Node>
162
163} // namespace Xpetra
164
165#endif // XPETRA_TPETRAEXPORT_DEF_HPP
#define XPETRA_MONITOR(funcName)
ArrayView< const LocalOrdinal > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
void setDistributorParameters(const Teuchos::RCP< Teuchos::ParameterList > params) const
Set distributor parameters.
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 > > getSourceMap() const
The source Map used to construct this Export.
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.
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.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const
The target Map used to construct this Export.
ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
RCP< const Tpetra::Export< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Export() const
void print(std::ostream &os) const
Print the Export's data to the given output stream.
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
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.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toXpetra(RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > graph)
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)