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"
20template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
21ImportExportData<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)
37 TEUCHOS_ASSERT(!
out_.is_null());
40template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
41ImportExportData<LocalOrdinal, GlobalOrdinal, Node>::
42 ImportExportData(
const Teuchos::RCP<const map_type>& source,
43 const Teuchos::RCP<const map_type>& target)
44 : ImportExportData(source, target, Teuchos::null, Teuchos::null) {}
46template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
47ImportExportData<LocalOrdinal, GlobalOrdinal, Node>::
48 ImportExportData(
const Teuchos::RCP<const map_type>& source,
49 const Teuchos::RCP<const map_type>& target,
50 const Teuchos::RCP<Teuchos::FancyOStream>& out)
51 : ImportExportData(source, target, out, Teuchos::null) {}
53template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
54ImportExportData<LocalOrdinal, GlobalOrdinal, Node>::
55 ImportExportData(
const Teuchos::RCP<const map_type>& source,
56 const Teuchos::RCP<const map_type>& target,
57 const Teuchos::RCP<Teuchos::ParameterList>& plist)
58 : ImportExportData(source, target, Teuchos::null, plist) {}
60template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
61Teuchos::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.
Kokkos::DualView< LocalOrdinal *, device_type > remoteLIDs_
"Incoming" indices.
Kokkos::DualView< LocalOrdinal *, device_type > exportLIDs_
"Outgoing" local indices.
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > target_
Target Map of the Import or Export.
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.