Tpetra Matrix/Vector Services  Version of the Day
Tpetra_BlockMap_def.hpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Tpetra: Templated Linear Algebra Services Package
5 // Copyright (2008) Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ************************************************************************
40 // @HEADER
41 
42 #ifndef TPETRA_BLOCKMAP_DEF_HPP
43 #define TPETRA_BLOCKMAP_DEF_HPP
44 
45 #include "Tpetra_ConfigDefs.hpp"
46 #include "Tpetra_Distributor.hpp"
47 
48 #ifdef DOXYGEN_USE_ONLY
49 #include "Tpetra_BlockMap_decl.hpp"
50 #endif
51 
52 namespace Tpetra {
53 
54 template<class LocalOrdinal,class GlobalOrdinal,class Node>
56  global_size_t numGlobalBlocks,
57  LocalOrdinal blockSize,
58  GlobalOrdinal indexBase,
59  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
60  const Teuchos::RCP<Node> &node)
61  : pointMap_(),
62  globalNumBlocks_(numGlobalBlocks),
63  myGlobalBlockIDs_(),
64  pbuf_firstPointInBlock_(),
65  view_firstPointInBlock_(),
66  blockIDsAreContiguous_(true),
67  constantBlockSize_(blockSize)
68 {
69  TEUCHOS_TEST_FOR_EXCEPTION( blockSize <= 0, std::runtime_error,
70  "Tpetra::BlockMap::BlockMap ERROR: blockSize must be greater than 0.");
71 
72  global_size_t numGlobalPoints = numGlobalBlocks*blockSize;
73 
74  //we compute numLocalPoints to make sure that Tpetra::Map doesn't split
75  //numGlobalPoints in a way that would separate the points within a block
76  //onto different mpi processors.
77 
78  size_t numLocalPoints = numGlobalBlocks/comm->getSize();
79  int remainder = numGlobalBlocks%comm->getSize();
80  int localProc = comm->getRank();
81  if (localProc < remainder) ++numLocalPoints;
82  numLocalPoints *= blockSize;
83 
84  //now create the point-map specifying both numGlobalPoints and numLocalPoints:
85  pointMap_ = Teuchos::rcp(new Map<LocalOrdinal,GlobalOrdinal,Node>(numGlobalPoints, numLocalPoints, indexBase, comm, node));
86 
87  size_t numLocalBlocks = pointMap_->getNodeNumElements()/blockSize;
88  size_t checkLocalBlocks = numLocalPoints/blockSize;
89  //can there be an inconsistency here???
90  TEUCHOS_TEST_FOR_EXCEPTION(numLocalBlocks != checkLocalBlocks, std::runtime_error,
91  "Tpetra::BlockMap::BlockMap ERROR: internal failure, numLocalBlocks not consistent with point-map.");
92 
93  myGlobalBlockIDs_.resize(numLocalBlocks);
94  pbuf_firstPointInBlock_ = node->template allocBuffer<LocalOrdinal>(numLocalBlocks+1);
95  Teuchos::ArrayRCP<LocalOrdinal> v_firstPoints = node->template viewBufferNonConst<LocalOrdinal>(Kokkos::WriteOnly, numLocalBlocks+1, pbuf_firstPointInBlock_);
96 
97  LocalOrdinal firstPoint = pointMap_->getMinLocalIndex();
98  GlobalOrdinal blockID = pointMap_->getMinGlobalIndex()/blockSize;
99  for(size_t i=0; i<numLocalBlocks; ++i) {
100  myGlobalBlockIDs_[i] = blockID++;
101  v_firstPoints[i] = firstPoint;
102  firstPoint += blockSize;
103  }
104  v_firstPoints[numLocalBlocks] = firstPoint;
105  v_firstPoints = Teuchos::null;
106  view_firstPointInBlock_ = node->template viewBuffer<LocalOrdinal>(numLocalBlocks+1, pbuf_firstPointInBlock_);
107 }
108 
109 template<class LocalOrdinal,class GlobalOrdinal,class Node>
111  global_size_t numGlobalBlocks,
112  size_t numLocalBlocks,
113  LocalOrdinal blockSize,
114  GlobalOrdinal indexBase,
115  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
116  const Teuchos::RCP<Node> &node)
117  : pointMap_(),
118  globalNumBlocks_(numGlobalBlocks),
119  myGlobalBlockIDs_(),
120  pbuf_firstPointInBlock_(),
121  view_firstPointInBlock_(),
122  blockIDsAreContiguous_(true),
123  constantBlockSize_(blockSize)
124 {
125  TEUCHOS_TEST_FOR_EXCEPTION( blockSize <= 0, std::runtime_error,
126  "Tpetra::BlockMap::BlockMap ERROR: blockSize must be greater than 0.");
127 
128  global_size_t numGlobalPoints = numGlobalBlocks*blockSize;
129  if (numGlobalBlocks == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
131  }
132 
133  size_t numLocalPoints = numLocalBlocks*blockSize;
134 
135  //now create the point-map specifying both numGlobalPoints and numLocalPoints:
136  pointMap_ = Teuchos::rcp(new Map<LocalOrdinal,GlobalOrdinal,Node>(numGlobalPoints, numLocalPoints, indexBase, comm, node));
137 
138  if (numGlobalBlocks == Teuchos::OrdinalTraits<global_size_t>::invalid()) {
139  Teuchos::reduceAll<int, global_size_t>(*comm, Teuchos::REDUCE_SUM,
140  1, &numLocalBlocks, &globalNumBlocks_);
141  }
142 
143  myGlobalBlockIDs_.resize(numLocalBlocks);
144  pbuf_firstPointInBlock_ = node->template allocBuffer<LocalOrdinal>(numLocalBlocks+1);
145  Teuchos::ArrayRCP<LocalOrdinal> v_firstPoints = node->template viewBufferNonConst<LocalOrdinal>(Kokkos::WriteOnly, numLocalBlocks+1, pbuf_firstPointInBlock_);
146 
147  LocalOrdinal firstPoint = pointMap_->getMinLocalIndex();
148  GlobalOrdinal blockID = pointMap_->getMinGlobalIndex()/blockSize;
149  for(size_t i=0; i<numLocalBlocks; ++i) {
150  myGlobalBlockIDs_[i] = blockID++;
151  v_firstPoints[i] = firstPoint;
152  firstPoint += blockSize;
153  }
154  v_firstPoints[numLocalBlocks] = firstPoint;
155  v_firstPoints = Teuchos::null;
156  view_firstPointInBlock_ = node->template viewBuffer<LocalOrdinal>(numLocalBlocks+1, pbuf_firstPointInBlock_);
157 }
158 
159 template<class LocalOrdinal,class GlobalOrdinal,class Node>
161  global_size_t numGlobalBlocks,
162  const Teuchos::ArrayView<const GlobalOrdinal>& myGlobalBlockIDs,
163  const Teuchos::ArrayView<const GlobalOrdinal>& myFirstGlobalPointInBlocks,
164  const Teuchos::ArrayView<const LocalOrdinal>& blockSizes,
165  GlobalOrdinal indexBase,
166  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
167  const Teuchos::RCP<Node> &node)
168  : pointMap_(),
169  globalNumBlocks_(numGlobalBlocks),
170  myGlobalBlockIDs_(myGlobalBlockIDs),
171  pbuf_firstPointInBlock_(),
172  view_firstPointInBlock_(),
173  blockIDsAreContiguous_(false),
174  constantBlockSize_(0)
175 {
176  TEUCHOS_TEST_FOR_EXCEPTION(myGlobalBlockIDs_.size()!=blockSizes.size(), std::runtime_error,
177  "Tpetra::BlockMap::BlockMap ERROR: input myGlobalBlockIDs and blockSizes arrays must have the same length.");
178 
179  size_t sum_blockSizes = 0;
180  Teuchos::Array<GlobalOrdinal> myGlobalPoints;
182  iter = blockSizes.begin(), iend = blockSizes.end();
183  size_t i = 0;
184  for(; iter!=iend; ++iter) {
185  LocalOrdinal bsize = *iter;
186  sum_blockSizes += bsize;
187  GlobalOrdinal firstPoint = myFirstGlobalPointInBlocks[i++];
188  for(LocalOrdinal j=0; j<bsize; ++j) {
189  myGlobalPoints.push_back(firstPoint+j);
190  }
191  }
192 
193  pointMap_ = Teuchos::rcp(new Map<LocalOrdinal,GlobalOrdinal,Node>(Teuchos::OrdinalTraits<global_size_t>::invalid(), myGlobalPoints(), indexBase, comm, node));
194 
195  global_size_t global_sum;
196  Teuchos::reduceAll<int,global_size_t>(*comm, Teuchos::REDUCE_SUM,
197  Teuchos::as<global_size_t>(myGlobalBlockIDs.size()), Teuchos::outArg(global_sum));
198  globalNumBlocks_ = global_sum;
199 
200  iter = blockSizes.begin();
201  LocalOrdinal firstBlockSize = iter==iend ? 0 : *iter;
202  LocalOrdinal firstPoint = pointMap_->getMinLocalIndex();
203  LocalOrdinal numLocalBlocks = myGlobalBlockIDs.size();
204  pbuf_firstPointInBlock_ = node->template allocBuffer<LocalOrdinal>(numLocalBlocks+1);
205  Teuchos::ArrayRCP<LocalOrdinal> v_firstPoints = node->template viewBufferNonConst<LocalOrdinal>(Kokkos::WriteOnly, numLocalBlocks+1, pbuf_firstPointInBlock_);
206 
207  bool blockSizesAreConstant = true;
208  i=0;
209  for(; iter!=iend; ++iter, ++i) {
210  v_firstPoints[i] = firstPoint;
211  firstPoint += *iter;
212  if (*iter != firstBlockSize) {
213  blockSizesAreConstant = false;
214  }
215  }
216  v_firstPoints[i] = firstPoint;
217  v_firstPoints = Teuchos::null;
218  if (blockSizesAreConstant) constantBlockSize_ = firstBlockSize;
219 
220  size_t num_points = pointMap_->getNodeNumElements();
221  TEUCHOS_TEST_FOR_EXCEPTION(sum_blockSizes != num_points, std::runtime_error,
222  "Tpetra::BlockMap::BlockMap ERROR: internal failure, sum of block-sizes must equal pointMap->getNodeNumElements().");
223 
225  b_iter = myGlobalBlockIDs_.begin(), b_end = myGlobalBlockIDs_.end();
226  GlobalOrdinal id = b_iter==b_end ? 0 : *b_iter;
227  if (b_iter != b_end) ++b_iter;
228  blockIDsAreContiguous_ = true;
229  for(; b_iter != b_end; ++b_iter) {
230  if (*b_iter != id+1) {
231  blockIDsAreContiguous_ = false;
232  break;
233  }
234  ++id;
235  }
236  if (blockIDsAreContiguous_ == false) {
237  setup_noncontig_mapping();
238  }
239 
240  view_firstPointInBlock_ = node->template viewBuffer<LocalOrdinal>(numLocalBlocks+1, pbuf_firstPointInBlock_);
241 }
242 
243 template<class LocalOrdinal,class GlobalOrdinal,class Node>
245  : pointMap_(pointMap),
246  globalNumBlocks_(Teuchos::OrdinalTraits<LocalOrdinal>::invalid()),
247  myGlobalBlockIDs_(myGlobalBlockIDs),
248  pbuf_firstPointInBlock_(),
249  view_firstPointInBlock_(),
250  blockIDsAreContiguous_(false),
251  constantBlockSize_(0)
252 {
253  TEUCHOS_TEST_FOR_EXCEPTION(myGlobalBlockIDs_.size()!=blockSizes.size(), std::runtime_error,
254  "Tpetra::BlockMap::BlockMap ERROR: input myGlobalBlockIDs and blockSizes arrays must have the same length.");
255 
256  global_size_t numLocalBlocks = myGlobalBlockIDs.size();
257  Teuchos::reduceAll<int,global_size_t>(*pointMap->getComm(), Teuchos::REDUCE_SUM, 1, &numLocalBlocks, &globalNumBlocks_);
258 
259  LocalOrdinal firstPoint = pointMap->getMinLocalIndex();
260  size_t sum_blockSizes = 0;
262  iter = blockSizes.begin(), iend = blockSizes.end();
263  LocalOrdinal firstBlockSize = *iter;
264 
265  pbuf_firstPointInBlock_ = node->template allocBuffer<LocalOrdinal>(myGlobalBlockIDs.size()+1);
266  Teuchos::ArrayRCP<LocalOrdinal> v_firstPoints = node->template viewBufferNonConst<LocalOrdinal>(Kokkos::WriteOnly, numLocalBlocks+1, pbuf_firstPointInBlock_);
267 
268  bool blockSizesAreConstant = true;
269  size_t i=0;
270  for(; iter!=iend; ++iter, ++i) {
271  sum_blockSizes += *iter;
272  v_firstPoints[i] = firstPoint;
273  firstPoint += *iter;
274  if (*iter != firstBlockSize) {
275  blockSizesAreConstant = false;
276  }
277  }
278  v_firstPoints[i] = firstPoint;
279  v_firstPoints = Teuchos::null;
280  if (blockSizesAreConstant) constantBlockSize_ = firstBlockSize;
281 
282  size_t num_points = pointMap->getNodeNumElements();
283  TEUCHOS_TEST_FOR_EXCEPTION(sum_blockSizes != num_points, std::runtime_error,
284  "Tpetra::BlockMap::BlockMap ERROR: sum of block-sizes must equal pointMap->getNodeNumElements().");
285 
287  b_iter = myGlobalBlockIDs_.begin(), b_end = myGlobalBlockIDs_.end();
288  GlobalOrdinal id = *b_iter;
289  ++b_iter;
290  blockIDsAreContiguous_ = true;
291  for(; b_iter != b_end; ++b_iter) {
292  if (*b_iter != id+1) {
293  blockIDsAreContiguous_ = false;
294  break;
295  }
296  ++id;
297  }
298  if (blockIDsAreContiguous_ == false) {
299  setup_noncontig_mapping();
300  }
301 
302  view_firstPointInBlock_ = node->template viewBuffer<LocalOrdinal>(numLocalBlocks+1, pbuf_firstPointInBlock_);
303 }
304 
305 template<class LocalOrdinal,class GlobalOrdinal,class Node>
306 void
309  const Teuchos::ArrayView<GlobalOrdinal>& firstGlobalPointInBlocks,
310  const Teuchos::ArrayView<LocalOrdinal>& blockSizes) const
311 {
313  convertBlockMapToPointMap(*this);
314 
315  Teuchos::Array<int> remoteProcs(GBIDs.size());
316  pbmap->getRemoteIndexList(GBIDs(), remoteProcs());
317 
318  Tpetra::Distributor distor(pbmap->getComm());
319 
320  Tpetra::Array<GlobalOrdinal> exportGBIDs;
321  Tpetra::Array<int> exportProcs;
322 
323  distor.createFromRecvs(GBIDs(), remoteProcs(), exportGBIDs, exportProcs);
324 
325  Tpetra::Array<GlobalOrdinal> exportFirstPointInBlocks(exportGBIDs.size());
326  Tpetra::Array<LocalOrdinal> exportSizes(exportGBIDs.size());
327 
329  iter = exportGBIDs.begin(),
330  iter_end = exportGBIDs.end();
331  for(int i=0; iter!=iter_end; ++iter, ++i) {
332  GlobalOrdinal gbid = *iter;
333  LocalOrdinal lbid = getLocalBlockID(gbid);
334  exportFirstPointInBlocks[i] = getFirstGlobalPointInLocalBlock(lbid);
335  exportSizes[i] = getLocalBlockSize(lbid);
336  }
337 
338  size_t numPackets = 1;
339  distor.doPostsAndWaits(exportFirstPointInBlocks().getConst(),
340  numPackets, firstGlobalPointInBlocks);
341 
342  distor.doPostsAndWaits(exportSizes().getConst(), numPackets, blockSizes);
343 }
344 
345 template<class LocalOrdinal,class GlobalOrdinal,class Node>
346 void
348 {
349  typedef typename Teuchos::Array<GlobalOrdinal>::size_type Tsize_t;
350  for(Tsize_t i=0; i<myGlobalBlockIDs_.size(); ++i) {
351  LocalOrdinal li = i;
352  // TODO: Use Tpetra::Details::HashTable here instead of std::map.
353  map_global_to_local_.insert(std::make_pair(myGlobalBlockIDs_[i],li));
354  }
355 }
356 
357 template<class LocalOrdinal,class GlobalOrdinal,class Node>
360 {
361  return globalNumBlocks_;
362 }
363 
364 template<class LocalOrdinal,class GlobalOrdinal,class Node>
365 size_t
367 {
368  return myGlobalBlockIDs_.size();
369 }
370 
371 template<class LocalOrdinal,class GlobalOrdinal,class Node>
374 {
375  return myGlobalBlockIDs_();
376 }
377 
378 template<class LocalOrdinal,class GlobalOrdinal,class Node>
379 bool
381 { return constantBlockSize_ != 0; }
382 
383 template<class LocalOrdinal,class GlobalOrdinal,class Node>
386 {
387  return view_firstPointInBlock_;
388 }
389 
390 template<class LocalOrdinal,class GlobalOrdinal,class Node>
393 {
394  return pbuf_firstPointInBlock_;
395 }
396 
397 template<class LocalOrdinal,class GlobalOrdinal,class Node>
398 GlobalOrdinal
400 {
401  LocalOrdinal invalid = Teuchos::OrdinalTraits<LocalOrdinal>::invalid();
402  if (localBlockID < 0 || localBlockID >= myGlobalBlockIDs_.size()) {
403  return invalid;
404  }
405 
406  return myGlobalBlockIDs_[localBlockID];
407 }
408 
409 template<class LocalOrdinal,class GlobalOrdinal,class Node>
410 LocalOrdinal
412 {
413  LocalOrdinal invalid = Teuchos::OrdinalTraits<LocalOrdinal>::invalid();
414  if (myGlobalBlockIDs_.size() == 0) {
415  return invalid;
416  }
417 
418  if (blockIDsAreContiguous_ == false) {
419  // TODO: Use Tpetra::Details::HashTable instead of std::map.
420  typename std::map<GlobalOrdinal,LocalOrdinal>::const_iterator iter =
421  map_global_to_local_.find(globalBlockID);
422  if (iter == map_global_to_local_.end()) return invalid;
423  return iter->second;
424  }
425 
426  LocalOrdinal localBlockID = globalBlockID - myGlobalBlockIDs_[0];
427  LocalOrdinal numLocalBlocks = myGlobalBlockIDs_.size();
428 
429  if (localBlockID < 0 || localBlockID >= numLocalBlocks) {
430  return invalid;
431  }
432 
433  return localBlockID;
434 }
435 
436 template<class LocalOrdinal,class GlobalOrdinal,class Node>
437 LocalOrdinal
439 {
440  if (constantBlockSize_ != 0) {
441  return constantBlockSize_;
442  }
443 
444  //should this be a debug-mode-only range check?
445  if (localBlockID < 0 || localBlockID >= view_firstPointInBlock_.size()) {
446  throw std::runtime_error("Tpetra::BlockMap::getLocalBlockSize ERROR: localBlockID out of range.");
447  }
448 
449  return view_firstPointInBlock_[localBlockID+1]-view_firstPointInBlock_[localBlockID];
450 }
451 
452 template<class LocalOrdinal,class GlobalOrdinal,class Node>
453 LocalOrdinal
455 {
456  //should this be a debug-mode-only range check?
457  if (localBlockID < 0 || localBlockID >= view_firstPointInBlock_.size()) {
458  throw std::runtime_error("Tpetra::BlockMap::getFirstLocalPointInLocalBlock ERROR: localBlockID out of range.");
459  }
460 
461  return view_firstPointInBlock_[localBlockID];
462 }
463 
464 template<class LocalOrdinal,class GlobalOrdinal,class Node>
465 GlobalOrdinal
467 {
468  //should this be a debug-mode-only range check?
469  if (localBlockID < 0 || localBlockID >= view_firstPointInBlock_.size()) {
470  throw std::runtime_error("Tpetra::BlockMap::getFirstGlobalPointInLocalBlock ERROR: localBlockID out of range.");
471  }
472 
473  return pointMap_->getGlobalElement(view_firstPointInBlock_[localBlockID]);
474 }
475 
476 }//namespace Tpetra
477 
478 //
479 // Explicit instantiation macro
480 //
481 // Must be expanded from within the Tpetra namespace!
482 //
483 
484 #define TPETRA_BLOCKMAP_INSTANT(LO,GO,NODE) \
485  \
486  template class BlockMap< LO , GO , NODE >;
487 
488 #endif
Block-entry counterpart to Tpetra::Map.
BlockMap(global_size_t numGlobalBlocks, LocalOrdinal blockSize, GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Kokkos::DefaultNode::getDefaultNode())
BlockMap constructor specifying numGlobalBlocks and constant blockSize.
LocalOrdinal getLocalBlockID(GlobalOrdinal globalBlockID) const
Return the localBlockID corresponding to the given globalBlockID.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
global_size_t getGlobalNumBlocks() const
Return global number of blocks.
Teuchos::ArrayRCP< const LocalOrdinal > getNodeFirstPointInBlocks() const
Return ArrayRCP of first-local-point in local blocks.
iterator begin() const
bool isBlockSizeConstant() const
Return true if all blocks have the same size.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
const_pointer const_iterator
size_type size() const
size_type size() const
GlobalOrdinal getGlobalBlockID(LocalOrdinal localBlockID) const
Return the globalBlockID corresponding to the given localBlockID.
size_t global_size_t
Global size_t object.
Ordinal size_type
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
LocalOrdinal getLocalBlockSize(LocalOrdinal localBlockID) const
Return the block-size for localBlockID.
Sets up and executes a communication plan for a Tpetra DistObject.
void getRemoteBlockInfo(const Teuchos::ArrayView< const GlobalOrdinal > &GBIDs, const Teuchos::ArrayView< GlobalOrdinal > &firstGlobalPointInBlocks, const Teuchos::ArrayView< LocalOrdinal > &blockSizes) const
Return the first-global-point-in-block and block-sizes for a list of block-IDs on remote processors...
size_t getNodeNumBlocks() const
Return number of blocks on the local processor.
void resize(size_type new_size, const value_type &x=value_type())
iterator end()
std::vector< T >::const_iterator const_iterator
void push_back(const value_type &x)
Describes a parallel distribution of objects over processes.
iterator end() const
size_type size() const
Teuchos::ArrayView< const GlobalOrdinal > getNodeBlockIDs() const
Return array-view of block-ids for this local processor.
const T & getConst(T &t)
iterator begin()
GlobalOrdinal getFirstGlobalPointInLocalBlock(LocalOrdinal localBlockID) const
Return the first global point-index corresponding to localBlockID.
LocalOrdinal getFirstLocalPointInLocalBlock(LocalOrdinal localBlockID) const
Return the first local point-index corresponding to localBlockID.
Teuchos::ArrayRCP< const LocalOrdinal > getNodeFirstPointInBlocks_Device() const
Return device-resident ArrayRCP of first-local-point in local blocks.