10#ifndef TPETRA_IMPORTEXPORTDATA_DEF_HPP
11#define TPETRA_IMPORTEXPORTDATA_DEF_HPP
13#include "Tpetra_Map.hpp"
14#include "Tpetra_Details_makeValidVerboseStream.hpp"
15#include "Teuchos_FancyOStream.hpp"
16#include "Teuchos_ParameterList.hpp"
20 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
21 ImportExportData<LocalOrdinal, GlobalOrdinal, Node>::
22 ImportExportData (
const Teuchos::RCP<const map_type>& source,
23 const Teuchos::RCP<const map_type>& target,
24 const Teuchos::RCP<Teuchos::FancyOStream>& out,
25 const Teuchos::RCP<Teuchos::ParameterList>& plist) :
33 TEUCHOS_ASSERT( !
out_.is_null () );
36 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
37 ImportExportData<LocalOrdinal, GlobalOrdinal, Node>::
38 ImportExportData (
const Teuchos::RCP<const map_type>& source,
39 const Teuchos::RCP<const map_type>& target) :
40 ImportExportData (source, target, Teuchos::null, Teuchos::null)
43 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
44 ImportExportData<LocalOrdinal, GlobalOrdinal, Node>::
45 ImportExportData (
const Teuchos::RCP<const map_type>& source,
46 const Teuchos::RCP<const map_type>& target,
47 const Teuchos::RCP<Teuchos::FancyOStream>& out) :
48 ImportExportData (source, target, out, Teuchos::null)
51 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
52 ImportExportData<LocalOrdinal, GlobalOrdinal, Node>::
53 ImportExportData (
const Teuchos::RCP<const map_type>& source,
54 const Teuchos::RCP<const map_type>& target,
55 const Teuchos::RCP<Teuchos::ParameterList>& plist) :
56 ImportExportData (source, target, Teuchos::null, plist)
59 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
60 Teuchos::RCP<ImportExportData<LocalOrdinal, GlobalOrdinal, Node> >
64 using Teuchos::ArrayView;
65 using data_type = ImportExportData<LocalOrdinal, GlobalOrdinal, Node>;
80 tData->exportPIDs_.resize (tData->exportLIDs_.extent (0));
83 const size_t NumReceives =
distributor_.getNumReceives();
84 ArrayView<const int> ProcsFrom =
distributor_.getProcsFrom();
85 ArrayView<const size_t> LengthsFrom =
distributor_.getLengthsFrom();
90 bool isLocallyComplete =
true;
91 for (
size_t i = 0, j = 0; i < NumReceives; ++i) {
92 const int pid = ProcsFrom[i];
94 isLocallyComplete =
false;
96 for (
size_t k = 0; k < LengthsFrom[i]; ++k) {
97 tData->exportPIDs_[j] = pid;
101 tData->isLocallyComplete_ = isLocallyComplete;
115#define TPETRA_IMPORTEXPORTDATA_INSTANT(LO, GO, NODE) \
116 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.