42 #ifndef TPETRA_IMPORTEXPORTDATA_DEF_HPP 43 #define TPETRA_IMPORTEXPORTDATA_DEF_HPP 45 #include <Tpetra_ImportExportData_decl.hpp> 47 #include <Tpetra_Map.hpp> 50 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
54 : out_ (
Teuchos::getFancyOStream (
Teuchos::rcpFromRef (std::cerr)))
58 , comm_ (source->getComm())
59 , distributor_ (comm_, out_)
62 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
66 const Teuchos::RCP<Teuchos::FancyOStream>& out)
71 ,
comm_ (source->getComm())
75 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
79 const Teuchos::RCP<Teuchos::ParameterList>& plist)
84 ,
comm_ (source->getComm())
88 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
92 const Teuchos::RCP<Teuchos::FancyOStream>& out,
93 const Teuchos::RCP<Teuchos::ParameterList>& plist)
98 ,
comm_ (source->getComm())
102 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
103 RCP<ImportExportData<LocalOrdinal, GlobalOrdinal, Node> >
106 Teuchos::RCP<ImportExportData<LocalOrdinal,GlobalOrdinal,Node> > tData =
110 tData->comm_ =
comm_;
121 tData->exportPIDs_.resize(tData->exportLIDs_.size());
128 for (
size_t i = 0, j = 0; i < NumReceives; ++i) {
129 const int pid = ProcsFrom[i];
130 for (
size_t k = 0; k < LengthsFrom[i]; ++k) {
131 tData->exportPIDs_[j] = pid;
139 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
152 #define TPETRA_IMPORTEXPORTDATA_INSTANT(LO, GO, NODE) \ 154 template class ImportExportData< LO , GO , NODE >; 156 #endif // TPETRA_IMPORTEXPORTDATA_DEF_HPP size_t numSameIDs_
Number of initial identical indices.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Teuchos::RCP< const Teuchos::Comm< int > > comm_
Communicator over which the source and target objects are distributed.
~ImportExportData()
Destructor.
size_t getNumReceives() const
The number of processes from which we will receive data.
Teuchos::Array< LocalOrdinal > permuteToLIDs_
Index of target Map LIDs to which to permute.
ImportExportData(const Teuchos::RCP< const map_type > &source, const Teuchos::RCP< const map_type > &target)
Constructor.
ArrayView< const size_t > getLengthsFrom() const
Number of values this process will receive from each process.
Teuchos::Array< LocalOrdinal > exportLIDs_
"Outgoing" local indices.
Implementation detail of Import and Export.
Teuchos::Array< LocalOrdinal > permuteFromLIDs_
Index of source Map LIDs from which to permute.
Teuchos::RCP< Teuchos::FancyOStream > out_
Output stream for debug output.
Describes a parallel distribution of objects over processes.
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > target_
Target Map of the Import or Export.
Distributor distributor_
Object that actually distributes (sends and receives) data.
ArrayView< const int > getImagesFrom() const
Ranks of the processes sending values to this process.
Teuchos::RCP< ImportExportData< LocalOrdinal, GlobalOrdinal, Node > > reverseClone()
Copy the data, but reverse the direction of the transfer as well as reversing the Distributor...
Teuchos::Array< LocalOrdinal > remoteLIDs_
"Incoming" indices.
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > source_
Source Map of the Import or Export.
RCP< Distributor > getReverse() const
A reverse communication plan Distributor.