Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Tpetra_Details_Transfer_def.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Tpetra: Templated Linear Algebra Services Package
4 //
5 // Copyright 2008 NTESS and the Tpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TPETRA_DETAILS_TRANSFER_DEF_HPP
11 #define TPETRA_DETAILS_TRANSFER_DEF_HPP
12 
14 #include "Tpetra_Distributor.hpp"
15 #include "Tpetra_ImportExportData.hpp"
16 #include "Tpetra_Map.hpp"
17 #include "Teuchos_CommHelpers.hpp"
18 #include "Teuchos_TypeNameTraits.hpp"
19 #include <sstream>
20 
21 namespace { // (anonymous)
22 
23 // Assume that dv is sync'd.
24 template <class ElementType, class DeviceType>
25 Teuchos::ArrayView<const ElementType>
26 makeConstArrayViewFromDualView(const Kokkos::DualView<ElementType*, DeviceType>& dv) {
27  TEUCHOS_ASSERT(!dv.need_sync_host());
28  auto hostView = dv.view_host();
29  const auto size = hostView.extent(0);
30  return Teuchos::ArrayView<const ElementType>(size == 0 ? nullptr : hostView.data(), size);
31 }
32 
33 template <class DeviceType, class LocalOrdinal>
34 struct OrderedViewFunctor {
35  OrderedViewFunctor(const Kokkos::View<LocalOrdinal*, DeviceType>& viewToCheck)
36  : viewToCheck_(viewToCheck) {}
37  KOKKOS_INLINE_FUNCTION void operator()(const size_t i, unsigned int& isUnordered) const {
38  isUnordered |= static_cast<unsigned int>(viewToCheck_(i) + 1 != viewToCheck_(i + 1));
39  }
40  Kokkos::View<const LocalOrdinal*, DeviceType> viewToCheck_;
41 };
42 
43 template <class DeviceType, class LocalOrdinal>
44 bool isViewOrdered(const Kokkos::View<LocalOrdinal*, DeviceType>& viewToCheck) {
45  using Kokkos::parallel_reduce;
46  typedef DeviceType DT;
47  typedef typename DT::execution_space DES;
48  typedef Kokkos::RangePolicy<DES, size_t> range_type;
49 
50  const size_t size = viewToCheck.extent(0);
51  unsigned int isUnordered = 0;
52  if (size > 1)
53  parallel_reduce("isViewOrdered",
54  range_type(0, size - 1),
55  OrderedViewFunctor<DeviceType, LocalOrdinal>(viewToCheck),
56  isUnordered);
57  return isUnordered == 0;
58 }
59 
60 } // namespace
61 
62 namespace Tpetra {
63 namespace Details {
64 
65 template <class LO, class GO, class NT>
66 Transfer<LO, GO, NT>::
67  Transfer(const Teuchos::RCP<const map_type>& source,
68  const Teuchos::RCP<const map_type>& target,
69  const Teuchos::RCP<Teuchos::FancyOStream>& out,
70  const Teuchos::RCP<Teuchos::ParameterList>& plist,
71  const std::string& className)
72  : TransferData_(new ImportExportData<LO, GO, NT>(source, target, out, plist)) {
73  TEUCHOS_ASSERT(!TransferData_->out_.is_null());
74  this->setParameterList(plist, className);
75 }
76 
77 template <class LO, class GO, class NT>
79  Transfer(const Transfer<LO, GO, NT>& rhs, reverse_tag) {
80  TEUCHOS_ASSERT(!(rhs.TransferData_).is_null());
81  this->TransferData_ = rhs.TransferData_->reverseClone();
82  TEUCHOS_ASSERT(!this->TransferData_->out_.is_null());
83 }
84 
85 template <class LO, class GO, class NT>
87  setParameterList(const Teuchos::RCP<Teuchos::ParameterList>& plist,
88  const std::string& className) {
89  using ::Tpetra::Details::Behavior;
90 
91  const bool verboseEnv = Behavior::verbose(className.c_str()) ||
92  Behavior::verbose((std::string("Tpetra::") + className).c_str());
93 
94  bool verboseParam = false;
95  if (!plist.is_null()) {
96  // FIXME (mfh 03 Feb 2019) Phase out these parameters in favor of
97  // TPETRA_VERBOSE.
98  if (plist->isType<bool>("Verbose")) {
99  verboseParam = plist->get<bool>("Verbose");
100  } else if (plist->isType<bool>("Debug")) { // backwards compat
101  verboseParam = plist->get<bool>("Debug");
102  }
103  }
104  this->TransferData_->verbose_ = verboseEnv || verboseParam;
105 }
106 
107 template <class LO, class GO, class NT>
108 size_t
110  getNumSameIDs() const {
111  return TransferData_->numSameIDs_;
112 }
113 
114 template <class LO, class GO, class NT>
115 size_t
118  return static_cast<size_t>(TransferData_->permuteFromLIDs_.extent(0));
119 }
120 
121 template <class LO, class GO, class NT>
122 Kokkos::DualView<const LO*, typename Transfer<LO, GO, NT>::device_type>
125  const auto& dv = TransferData_->permuteFromLIDs_;
126  TEUCHOS_TEST_FOR_EXCEPTION(dv.need_sync_device(), std::logic_error,
127  "Tpetra::Details::Transfer::getPermuteFromLIDs_dv: "
128  "DualView needs sync to device");
129  TEUCHOS_TEST_FOR_EXCEPTION(dv.need_sync_host(), std::logic_error,
130  "Tpetra::Details::Transfer::getPermuteFromLIDs_dv: "
131  "DualView needs sync to host");
132  return dv;
133 }
134 
135 template <class LO, class GO, class NT>
136 Teuchos::ArrayView<const LO>
139  return makeConstArrayViewFromDualView(TransferData_->permuteFromLIDs_);
140 }
141 
142 template <class LO, class GO, class NT>
143 Kokkos::DualView<const LO*, typename Transfer<LO, GO, NT>::device_type>
146  const auto& dv = TransferData_->permuteToLIDs_;
147  TEUCHOS_TEST_FOR_EXCEPTION(dv.need_sync_device(), std::logic_error,
148  "Tpetra::Details::Transfer::getPermuteToLIDs_dv: "
149  "DualView needs sync to device");
150  TEUCHOS_TEST_FOR_EXCEPTION(dv.need_sync_host(), std::logic_error,
151  "Tpetra::Details::Transfer::getPermuteToLIDs_dv: "
152  "DualView needs sync to host");
153  return dv;
154 }
155 
156 template <class LO, class GO, class NT>
157 Teuchos::ArrayView<const LO>
160  return makeConstArrayViewFromDualView(TransferData_->permuteToLIDs_);
161 }
162 
163 template <class LO, class GO, class NT>
164 size_t
167  return static_cast<size_t>(TransferData_->remoteLIDs_.extent(0));
168 }
169 
170 template <class LO, class GO, class NT>
171 Kokkos::DualView<const LO*, typename Transfer<LO, GO, NT>::device_type>
174  const auto& dv = TransferData_->remoteLIDs_;
175  TEUCHOS_TEST_FOR_EXCEPTION(dv.need_sync_device(), std::logic_error,
176  "Tpetra::Details::Transfer::getRemoteLIDs_dv: "
177  "DualView needs sync to device");
178  TEUCHOS_TEST_FOR_EXCEPTION(dv.need_sync_host(), std::logic_error,
179  "Tpetra::Details::Transfer::getRemoteLIDs_dv: "
180  "DualView needs sync to host");
181  return dv;
182 }
183 
184 template <class LO, class GO, class NT>
185 Teuchos::ArrayView<const LO>
187  getRemoteLIDs() const {
188  return makeConstArrayViewFromDualView(TransferData_->remoteLIDs_);
189 }
190 
191 template <class LO, class GO, class NT>
192 size_t
195  return static_cast<size_t>(TransferData_->exportLIDs_.extent(0));
196 }
197 
198 template <class LO, class GO, class NT>
199 Kokkos::DualView<const LO*, typename Transfer<LO, GO, NT>::device_type>
202  const auto& dv = TransferData_->exportLIDs_;
203  TEUCHOS_TEST_FOR_EXCEPTION(dv.need_sync_device(), std::logic_error,
204  "Tpetra::Details::Transfer::getExportLIDs_dv: "
205  "DualView needs sync to device");
206  TEUCHOS_TEST_FOR_EXCEPTION(dv.need_sync_host(), std::logic_error,
207  "Tpetra::Details::Transfer::getExportLIDs_dv: "
208  "DualView needs sync to host");
209  return dv;
210 }
211 
212 template <class LO, class GO, class NT>
213 Teuchos::ArrayView<const LO>
215  getExportLIDs() const {
216  return makeConstArrayViewFromDualView(TransferData_->exportLIDs_);
217 }
218 
219 template <class LO, class GO, class NT>
220 Teuchos::ArrayView<const int>
222  getExportPIDs() const {
223  return TransferData_->exportPIDs_();
224 }
225 
226 template <class LO, class GO, class NT>
227 Teuchos::RCP<const typename Transfer<LO, GO, NT>::map_type>
229  getSourceMap() const {
230  return TransferData_->source_;
231 }
232 
233 template <class LO, class GO, class NT>
234 Teuchos::RCP<const typename Transfer<LO, GO, NT>::map_type>
236  getTargetMap() const {
237  return TransferData_->target_;
238 }
239 
240 template <class LO, class GO, class NT>
244  return TransferData_->distributor_;
245 }
246 
247 template <class LO, class GO, class NT>
250  return TransferData_->isLocallyComplete_;
251 }
252 
253 template <class LO, class GO, class NT>
256  return (getNumSameIDs() == std::min(getSourceMap()->getLocalNumElements(),
257  getTargetMap()->getLocalNumElements()));
258 }
259 
260 template <class LO, class GO, class NT>
263  // Check that maps are locally fitted
264  // TODO: We really want to check here that remote LIDs are sorted last.
265  // The current check is too restrictive in special cases.
266  bool ordered = (getNumSameIDs() == std::min(getSourceMap()->getLocalNumElements(),
267  getTargetMap()->getLocalNumElements()));
268  ordered &= (getTargetMap()->getLocalNumElements() == getNumSameIDs() + getNumRemoteIDs());
269  if (ordered) {
270  const auto& dv = TransferData_->remoteLIDs_;
271  TEUCHOS_TEST_FOR_EXCEPTION(dv.need_sync_device(), std::logic_error,
272  "Tpetra::Details::Transfer::getRemoteLIDs_dv: "
273  "DualView needs sync to device");
274  auto v_d = dv.view_device();
275  ordered &= isViewOrdered<device_type, LO>(v_d);
276  }
277  TransferData_->remoteLIDsContiguous_ = ordered;
278 
279  ordered = (getNumSameIDs() == std::min(getSourceMap()->getLocalNumElements(),
280  getTargetMap()->getLocalNumElements()));
281  ordered &= (getSourceMap()->getLocalNumElements() == getNumSameIDs() + getNumExportIDs());
282  if (ordered) {
283  const auto& dv = TransferData_->exportLIDs_;
284  TEUCHOS_TEST_FOR_EXCEPTION(dv.need_sync_device(), std::logic_error,
285  "Tpetra::Details::Transfer::getRemoteLIDs_dv: "
286  "DualView needs sync to device");
287  auto v_d = dv.view_device();
288  ordered &= isViewOrdered<device_type, LO>(v_d);
289  }
290  TransferData_->exportLIDsContiguous_ = ordered;
291 }
292 
293 template <class LO, class GO, class NT>
294 bool Transfer<LO, GO, NT>::
295  areRemoteLIDsContiguous() const {
296  return TransferData_->remoteLIDsContiguous_;
297 }
298 
299 template <class LO, class GO, class NT>
300 bool Transfer<LO, GO, NT>::
301  areExportLIDsContiguous() const {
302  return TransferData_->exportLIDsContiguous_;
303 }
304 
305 template <class LO, class GO, class NT>
307  describe(Teuchos::FancyOStream& out,
308  const Teuchos::EVerbosityLevel verbLevel) const {
309  this->describeImpl(out, "Tpetra::Details::Transfer", verbLevel);
310 }
311 
312 template <class LO, class GO, class NT>
313 Teuchos::FancyOStream&
316  Teuchos::FancyOStream* outPtr = TransferData_->out_.getRawPtr();
317  TEUCHOS_ASSERT(outPtr != nullptr);
318  return *outPtr;
319 }
320 
321 template <class LO, class GO, class NT>
323  verbose() const {
324  return TransferData_->verbose_;
325 }
326 
327 template <class LO, class GO, class NT>
329  describeImpl(Teuchos::FancyOStream& out,
330  const std::string& className,
331  const Teuchos::EVerbosityLevel verbLevel) const {
332  using std::endl;
333  using Teuchos::TypeNameTraits;
334  using Teuchos::VERB_DEFAULT;
335  using Teuchos::VERB_LOW;
336  using Teuchos::VERB_NONE;
337  const Teuchos::EVerbosityLevel vl =
338  (verbLevel == VERB_DEFAULT) ? VERB_LOW : verbLevel;
339 
340  if (vl == VERB_NONE) {
341  return; // don't print anything
342  }
343  // If this Transfer's source Map or Comm is null, then the Transfer
344  // does not participate in collective operations with the other
345  // processes. In that case, it is not even legal to call this
346  // method. The reasonable thing to do in that case is nothing.
347  auto srcMap = this->getSourceMap();
348  if (srcMap.is_null()) {
349  return;
350  }
351  auto comm = srcMap->getComm();
352  if (comm.is_null()) {
353  return;
354  }
355  if (this->getTargetMap().is_null() ||
356  this->getTargetMap()->getComm().is_null()) {
357  return;
358  }
359 
360  const int myRank = comm->getRank();
361  const int numProcs = comm->getSize();
362 
363  // Only Process 0 should touch the output stream, but this method in
364  // general may need to do communication. Thus, we may need to
365  // preserve the current tab level across multiple "if (myRank == 0)
366  // { ... }" inner scopes. This is why we sometimes create OSTab
367  // instances by pointer, instead of by value.
368  Teuchos::RCP<Teuchos::OSTab> tab0, tab1;
369 
370  if (myRank == 0) {
371  // At every verbosity level but VERB_NONE, Process 0 prints.
372  // By convention, describe() always begins with a tab before
373  // printing.
374  tab0 = Teuchos::rcp(new Teuchos::OSTab(out));
375 
376  out << "\"" << className << "\":" << endl;
377  tab1 = Teuchos::rcp(new Teuchos::OSTab(out));
378 
379  {
380  out << "Template parameters:" << endl;
381  Teuchos::OSTab tab2(out);
382  out << "LocalOrdinal: " << TypeNameTraits<LO>::name() << endl
383  << "GlobalOrdinal: " << TypeNameTraits<GO>::name() << endl
384  << "Node: " << TypeNameTraits<NT>::name() << endl;
385  }
386 
387  const std::string label = this->getObjectLabel();
388  if (label != "") {
389  out << "Label: " << label << endl;
390  }
391  out << "Number of processes: " << numProcs << endl;
392  }
393 
394  if (vl > VERB_LOW) {
395  // At higher verbosity levels, describe() is allowed to
396  // communicate in order to print information from other
397  // processes in the object's communicator.
398  this->globalDescribe(out, vl);
399  }
400 
401  // It's illegal to call describe() on a process where either Map is
402  // null. (That implies the process in question is not participating
403  // in collective operations with either Map, and describe is
404  // collective over the Maps' communicator.) Thus, we don't have to
405  // define behavior when either Map is NULL on any process. Thus,
406  // it's OK that the code below isn't quite right (that is, won't
407  // print anything) if either Map is NULL on Process 0.
408 
409  if (myRank == 0) {
410  out << "Source Map:" << endl;
411  }
412  // This is collective over the Map's communicator.
413  this->getSourceMap()->describe(out, vl);
414 
415  if (myRank == 0) {
416  out << "Target Map:" << endl;
417  }
418  // This is collective over the Map's communicator.
419  this->getTargetMap()->describe(out, vl);
420 
421  if (myRank == 0) {
422  out << "Distributor:" << endl;
423  }
424  this->getDistributor().describe(out, vl);
425 }
426 
427 template <class LO, class GO, class NT>
429  globalDescribe(Teuchos::FancyOStream& out,
430  const Teuchos::EVerbosityLevel vl) const {
431  using std::endl;
432  using Teuchos::Comm;
433  using Teuchos::OSTab;
434  using Teuchos::RCP;
435  using Teuchos::toString;
436 
437  // If this Transfer's source Map or Comm is null, then the Transfer
438  // does not participate in collective operations with the other
439  // processes. In that case, it is not even legal to call this
440  // method. The reasonable thing to do in that case is nothing.
441  auto srcMap = this->getSourceMap();
442  if (srcMap.is_null()) {
443  return;
444  }
445  RCP<const Teuchos::Comm<int> > comm = srcMap->getComm();
446  if (comm.is_null()) {
447  return;
448  }
449 
450  const std::string myStr = localDescribeToString(vl);
451  ::Tpetra::Details::gathervPrint(out, myStr, *comm);
452 }
453 
454 template <class LO, class GO, class NT>
455 std::string
456 Transfer<LO, GO, NT>::
457  localDescribeToString(const Teuchos::EVerbosityLevel vl) const {
458  using std::endl;
459  using Teuchos::OSTab;
460  using Teuchos::RCP;
461 
462  RCP<std::ostringstream> outString(new std::ostringstream);
463  RCP<Teuchos::FancyOStream> outp = Teuchos::getFancyOStream(outString);
464  Teuchos::FancyOStream& out = *outp; // only valid during this scope
465 
466  RCP<const Teuchos::Comm<int> > comm = this->getSourceMap()->getComm();
467  if (this->getSourceMap().is_null() ||
468  this->getSourceMap()->getComm().is_null()) {
469  // If this Transfer does not participate in the communicator,
470  // it's not even legal to call this method. However, we need to
471  // do something in this case. The reasonable thing to do is not
472  // to print anything.
473  return std::string("");
474  } else {
475  const int myRank = comm->getRank();
476  const int numProcs = comm->getSize();
477 
478  out << "Process " << myRank << " of " << numProcs << ":" << endl;
479  OSTab tab1(out);
480 
481  out << "numSameIDs: " << getNumSameIDs() << endl;
482  out << "numPermuteIDs: " << getNumPermuteIDs() << endl;
483  out << "numRemoteIDs: " << getNumRemoteIDs() << endl;
484  out << "numExportIDs: " << getNumExportIDs() << endl;
485 
486  // Only print the actual contents of these arrays at the two
487  // highest verbosity levels. Otherwise, just print their counts.
488  if (vl <= Teuchos::VERB_MEDIUM) {
489  out << "permuteFromLIDs count: " << getPermuteFromLIDs().size() << endl
490  << "permuteToLIDs count: " << getPermuteToLIDs().size() << endl
491  << "remoteLIDs count: " << getRemoteLIDs().size() << endl
492  << "exportLIDs count: " << getExportLIDs().size() << endl
493  << "exportPIDs count: " << getExportPIDs() << endl;
494  } else { // vl = VERB_HIGH or VERB_EXTREME
495  // Build RemoteGIDs
496  RCP<const Map<LO, GO, NT> > tmap = getTargetMap();
497  RCP<const Map<LO, GO, NT> > smap = getSourceMap();
498  Teuchos::Array<GO> RemoteGIDs(getRemoteLIDs().size());
499  Teuchos::Array<int> RemotePIDs(getRemoteLIDs().size());
500  for (size_t i = 0; i < (size_t)getRemoteLIDs().size(); i++)
501  RemoteGIDs[i] = tmap->getGlobalElement(getRemoteLIDs()[i]);
502 
503  Teuchos::Array<int> ExportGIDs(getExportLIDs().size());
504  for (size_t i = 0; i < (size_t)getExportLIDs().size(); i++)
505  ExportGIDs[i] = smap->getGlobalElement(getExportLIDs()[i]);
506 
507  // Build RemotePIDs (taken from Tpetra_Import_Util.hpp)
508  const Tpetra::Distributor& D = getDistributor();
509  size_t NumReceives = D.getNumReceives();
510  Teuchos::ArrayView<const int> ProcsFrom = D.getProcsFrom();
511  Teuchos::ArrayView<const size_t> LengthsFrom = D.getLengthsFrom();
512  for (size_t i = 0, j = 0; i < NumReceives; ++i) {
513  const int pid = ProcsFrom[i];
514  for (size_t k = 0; k < LengthsFrom[i]; ++k) {
515  RemotePIDs[j] = pid;
516  j++;
517  }
518  }
519 
520  out << "distor.NumRecvs : " << NumReceives << endl
521  << "distor.ProcsFrom : " << toString(ProcsFrom) << endl
522  << "distor.LengthsFrom: " << toString(LengthsFrom) << endl;
523 
524  out << "distor.NumSends : " << D.getNumSends() << endl
525  << "distor.ProcsTo : " << toString(D.getProcsTo()) << endl
526  << "distor.LengthsTo : " << toString(D.getLengthsTo()) << endl;
527 
528  out << "distor.hasSelfMsg : " << D.hasSelfMessage() << endl;
529 
530  out << "permuteFromLIDs: " << toString(getPermuteFromLIDs()) << endl
531  << "permuteToLIDs: " << toString(getPermuteToLIDs()) << endl
532  << "remoteLIDs: " << toString(getRemoteLIDs()) << endl
533  << "remoteGIDs: " << toString(RemoteGIDs()) << endl
534  << "remotePIDs: " << toString(RemotePIDs()) << endl
535  << "exportLIDs: " << toString(getExportLIDs()) << endl
536  << "exportGIDs: " << toString(ExportGIDs()) << endl
537  << "exportPIDs: " << toString(getExportPIDs()) << endl;
538  }
539 
540  out.flush(); // make sure the ostringstream got everything
541  return outString->str();
542  }
543 }
544 
545 template <class LO, class GO, class NT>
546 void expertSetRemoteLIDsContiguous(Transfer<LO, GO, NT> transfer, bool contig) {
547  transfer.TransferData_->remoteLIDsContiguous_ = contig;
548 }
549 
550 template <class LO, class GO, class NT>
551 void expertSetExportLIDsContiguous(Transfer<LO, GO, NT> transfer, bool contig) {
552  transfer.TransferData_->exportLIDsContiguous_ = contig;
553 }
554 
555 } // namespace Details
556 } // namespace Tpetra
557 
558 #endif // TPETRA_DETAILS_TRANSFER_DEF_HPP
Kokkos::DualView< const LO *, device_type > getRemoteLIDs_dv() const
List of entries in the target Map to receive from other processes, as a const DualView (that is sync&#39;...
void describeImpl(Teuchos::FancyOStream &out, const std::string &className, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Implementation of describe() for subclasses (Tpetra::Import and Tpetra::Export).
Common base class of Import and Export.
size_t getNumReceives() const
The number of processes from which we will receive data.
Teuchos::FancyOStream & verboseOutputStream() const
Valid (nonnull) output stream for verbose output.
bool isLocallyFitted() const
Are source and target map locally fitted?
Declaration of a function that prints strings from each process.
Teuchos::ArrayView< const int > getExportPIDs() const
List of processes to which entries will be sent.
Teuchos::ArrayView< const LO > getPermuteToLIDs() const
List of local IDs in the target Map that are permuted.
Teuchos::RCP< const map_type > getTargetMap() const
The target Map used to construct this Export or Import.
size_t getNumSameIDs() const
Number of initial identical IDs.
Teuchos::ArrayView< const size_t > getLengthsFrom() const
Number of values this process will receive from each process.
Teuchos::ArrayView< const int > getProcsFrom() const
Ranks of the processes sending values to this process.
size_t getNumRemoteIDs() const
Number of entries not on the calling process.
Kokkos::DualView< const LO *, device_type > getPermuteFromLIDs_dv() const
List of local IDs in the source Map that are permuted, as a const DualView (that is sync&#39;d to both ho...
Teuchos::ArrayView< const LO > getRemoteLIDs() const
List of entries in the target Map to receive from other processes.
Teuchos::ArrayView< const int > getProcsTo() const
Ranks of the processes to which this process will send values.
Kokkos::DualView< const LO *, device_type > getPermuteToLIDs_dv() const
List of local IDs in the target Map that are permuted, as a const DualView (that is sync&#39;d to both ho...
size_t getNumPermuteIDs() const
Number of IDs to permute but not to communicate.
bool hasSelfMessage() const
Whether the calling process will send or receive messages to itself.
Implementation detail of Import and Export.
Sets up and executes a communication plan for a Tpetra DistObject.
static bool verbose()
Whether Tpetra is in verbose mode.
Teuchos::RCP< ImportExportData< LO, GO, NT > > TransferData_
All the data needed for executing the Export communication plan.
Kokkos::DualView< const LO *, device_type > getExportLIDs_dv() const
List of entries in the source Map that will be sent to other processes, as a const DualView (that is ...
Teuchos::RCP< const map_type > getSourceMap() const
The source Map used to construct this Export or Import.
size_t getNumExportIDs() const
Number of entries that must be sent by the calling process to other processes.
bool isLocallyComplete() const
Is this Export or Import locally complete?
Teuchos::ArrayView< const size_t > getLengthsTo() const
Number of values this process will send to each process.
Teuchos::ArrayView< const LO > getExportLIDs() const
List of entries in the source Map that will be sent to other processes.
Teuchos::ArrayView< const LO > getPermuteFromLIDs() const
List of local IDs in the source Map that are permuted.
::Tpetra::Distributor & getDistributor() const
The Distributor that this Export or Import object uses to move data.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Describe this object in a human-readable way to the given output stream.
size_t getNumSends() const
The number of processes to which we will send data.
bool verbose() const
Whether to print verbose debugging output.