42#ifndef TPETRA_IMPORTEXPORTDATA_DEF_HPP
43#define TPETRA_IMPORTEXPORTDATA_DEF_HPP
45#include "Tpetra_Map.hpp"
46#include "Tpetra_Details_makeValidVerboseStream.hpp"
47#include "Teuchos_FancyOStream.hpp"
48#include "Teuchos_ParameterList.hpp"
52 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
53 ImportExportData<LocalOrdinal, GlobalOrdinal, Node>::
54 ImportExportData (
const Teuchos::RCP<const map_type>& source,
55 const Teuchos::RCP<const map_type>& target,
56 const Teuchos::RCP<Teuchos::FancyOStream>& out,
57 const Teuchos::RCP<Teuchos::ParameterList>& plist) :
65 TEUCHOS_ASSERT( !
out_.is_null () );
68 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
69 ImportExportData<LocalOrdinal, GlobalOrdinal, Node>::
70 ImportExportData (
const Teuchos::RCP<const map_type>& source,
71 const Teuchos::RCP<const map_type>& target) :
72 ImportExportData (source, target, Teuchos::null, Teuchos::null)
75 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 ImportExportData<LocalOrdinal, GlobalOrdinal, Node>::
77 ImportExportData (
const Teuchos::RCP<const map_type>& source,
78 const Teuchos::RCP<const map_type>& target,
79 const Teuchos::RCP<Teuchos::FancyOStream>& out) :
80 ImportExportData (source, target, out, Teuchos::null)
83 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
84 ImportExportData<LocalOrdinal, GlobalOrdinal, Node>::
85 ImportExportData (
const Teuchos::RCP<const map_type>& source,
86 const Teuchos::RCP<const map_type>& target,
87 const Teuchos::RCP<Teuchos::ParameterList>& plist) :
88 ImportExportData (source, target, Teuchos::null, plist)
91 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
92 Teuchos::RCP<ImportExportData<LocalOrdinal, GlobalOrdinal, Node> >
96 using Teuchos::ArrayView;
97 using data_type = ImportExportData<LocalOrdinal, GlobalOrdinal, Node>;
112 tData->exportPIDs_.resize (tData->exportLIDs_.extent (0));
115 const size_t NumReceives =
distributor_.getNumReceives();
116 ArrayView<const int> ProcsFrom =
distributor_.getProcsFrom();
117 ArrayView<const size_t> LengthsFrom =
distributor_.getLengthsFrom();
122 bool isLocallyComplete =
true;
123 for (
size_t i = 0, j = 0; i < NumReceives; ++i) {
124 const int pid = ProcsFrom[i];
126 isLocallyComplete =
false;
128 for (
size_t k = 0; k < LengthsFrom[i]; ++k) {
129 tData->exportPIDs_[j] = pid;
133 tData->isLocallyComplete_ = isLocallyComplete;
147#define TPETRA_IMPORTEXPORTDATA_INSTANT(LO, GO, NODE) \
148 template class ImportExportData< LO , GO , NODE >;
Kokkos::DualView< LocalOrdinal *, device_type > permuteToLIDs_
Index of target Map LIDs to which to permute.
Teuchos::RCP< ImportExportData< LocalOrdinal, GlobalOrdinal, Node > > reverseClone()
Copy the data, but reverse the direction of the transfer as well as reversing the Distributor.
Distributor distributor_
Object that actually distributes (sends and receives) data.
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > target_
Target Map of the Import or Export.
Kokkos::DualView< LocalOrdinal *, device_type > remoteLIDs_
"Incoming" indices.
Kokkos::DualView< LocalOrdinal *, device_type > exportLIDs_
"Outgoing" local indices.
Teuchos::RCP< Teuchos::FancyOStream > out_
Output stream for verbose debugging output.
bool isLocallyComplete_
Is this Export or Import locally complete?
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > source_
Source Map of the Import or Export.
size_t numSameIDs_
Number of initial identical indices.
Kokkos::DualView< LocalOrdinal *, device_type > permuteFromLIDs_
Index of source Map LIDs from which to permute.
Implementation details of Tpetra.
Namespace Tpetra contains the class and methods constituting the Tpetra library.