Tpetra parallel linear algebra  Version of the Day
Tpetra_Map_decl.hpp
Go to the documentation of this file.
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 // ************************************************************************
38 // @HEADER
39 
40 #ifndef TPETRA_MAP_DECL_HPP
41 #define TPETRA_MAP_DECL_HPP
42 
46 
47 #include "Tpetra_ConfigDefs.hpp"
48 #include "Tpetra_Map_fwd.hpp"
49 #include "Tpetra_Directory_fwd.hpp"
50 #include "Tpetra_TieBreak_fwd.hpp"
52 #include "Kokkos_DefaultNode.hpp"
53 #include "Kokkos_DualView.hpp"
54 #include "Teuchos_Array.hpp"
55 #include "Teuchos_Comm.hpp"
56 #include "Teuchos_Describable.hpp"
57 
58 
59 namespace Tpetra {
60 
61  namespace Details {
62 
65  template<class OutMapType, class InMapType>
66  struct MapCloner {
67  typedef typename OutMapType::node_type out_node_type;
68  typedef typename InMapType::node_type in_node_type;
69 
70  static OutMapType
71  clone (const InMapType& mapIn,
72  const Teuchos::RCP<out_node_type>& node2);
73  };
74 
75  } // namespace Details
76 
241  template <class LocalOrdinal,
242  class GlobalOrdinal,
243  class Node>
244  class Map : public Teuchos::Describable {
245  public:
247 
248 
250  using local_ordinal_type = LocalOrdinal;
251 
253  using global_ordinal_type = GlobalOrdinal;
254 
260  using device_type = typename Node::device_type;
261 
263  using execution_space = typename device_type::execution_space;
264 
266  using memory_space = typename device_type::memory_space;
267 
269  using node_type = Node;
270 
287  device_type>;
288 
290 
292 
342  Map (const global_size_t numGlobalElements,
343  const global_ordinal_type indexBase,
344  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
345  const LocalGlobal lg=GloballyDistributed);
346 
347 
383  Map (const global_size_t numGlobalElements,
384  const size_t numLocalElements,
385  const global_ordinal_type indexBase,
386  const Teuchos::RCP<const Teuchos::Comm<int> > &comm);
387 
388 
429  Map (const global_size_t numGlobalElements,
430  const Kokkos::View<const global_ordinal_type*, device_type>& indexList,
431  const global_ordinal_type indexBase,
432  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
433 
475  Map (const global_size_t numGlobalElements,
476  const global_ordinal_type indexList[],
477  const local_ordinal_type indexListSize,
478  const global_ordinal_type indexBase,
479  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
480 
522  Map (const global_size_t numGlobalElements,
523  const Teuchos::ArrayView<const global_ordinal_type>& indexList,
524  const global_ordinal_type indexBase,
525  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
526 
527 
541  Map ();
542 
545 
548 
550  Map&
552 
554  Map&
556 
566  virtual ~Map ();
567 
569 
571 
576  bool isOneToOne () const;
577 
584  return numGlobalElements_;
585  }
586 
592  size_t getNodeNumElements () const {
593  return numLocalElements_;
594  }
595 
602  return indexBase_;
603  }
604 
611  return static_cast<local_ordinal_type> (0);
612  }
613 
625  if (this->getNodeNumElements () == 0) {
626  return Tpetra::Details::OrdinalTraits<local_ordinal_type>::invalid ();
627  } else { // Local indices are always zero-based.
628  return static_cast<local_ordinal_type> (this->getNodeNumElements () - 1);
629  }
630  }
631 
637  global_ordinal_type getMinGlobalIndex () const {
638  return minMyGID_;
639  }
640 
647  return maxMyGID_;
648  }
649 
656  return minAllGID_;
657  }
658 
665  return maxAllGID_;
666  }
667 
681 
691 
696  local_map_type getLocalMap () const;
697 
728  getRemoteIndexList (const Teuchos::ArrayView<const global_ordinal_type>& GIDList,
729  const Teuchos::ArrayView< int>& nodeIDList,
730  const Teuchos::ArrayView< local_ordinal_type>& LIDList) const;
731 
756  getRemoteIndexList (const Teuchos::ArrayView<const global_ordinal_type> & GIDList,
757  const Teuchos::ArrayView< int> & nodeIDList) const;
758 
759  private:
771  typedef Kokkos::View<const global_ordinal_type*,
772  Kokkos::LayoutLeft,
773  device_type> global_indices_array_type;
774 
775  public:
795  global_indices_array_type getMyGlobalIndices () const;
796 
807  Teuchos::ArrayView<const global_ordinal_type> getNodeElementList() const;
808 
810 
812 
819  bool isNodeLocalElement (local_ordinal_type localIndex) const;
820 
827  bool isNodeGlobalElement (global_ordinal_type globalIndex) const;
828 
835  bool isUniform () const;
836 
848  bool isContiguous () const;
849 
870  bool isDistributed () const;
871 
897 
929 
935 
952 
954 
956 
958  Teuchos::RCP<const Teuchos::Comm<int> > getComm () const;
959 
960 
962 
964 
966  std::string description () const;
967 
989  void
990  describe (Teuchos::FancyOStream &out,
991  const Teuchos::EVerbosityLevel verbLevel =
992  Teuchos::Describable::verbLevel_default) const;
994 
996 
1045  Teuchos::RCP<const Map<local_ordinal_type, global_ordinal_type, Node> >
1046  removeEmptyProcesses () const;
1047 
1075  Teuchos::RCP<const Map<local_ordinal_type, global_ordinal_type, Node> >
1076  replaceCommWithSubset (const Teuchos::RCP<const Teuchos::Comm<int> >& newComm) const;
1078 
1079  protected:
1080  // This lets other specializations of Map access all of this
1081  // specialization's internal methods and data, so that we can
1082  // implement clone() without exposing the details of Map to users.
1083  template <class LO, class GO, class N> friend class Map;
1084 
1085  private:
1086  template<class OutMapType, class InMapType>
1087  friend struct Details::MapCloner;
1088 
1093  std::string
1094  localDescribeToString (const Teuchos::EVerbosityLevel vl) const;
1095 
1103  void setupDirectory () const;
1104 
1119  bool checkIsDist() const;
1120 
1129  initialNonuniformDebugCheck(
1130  const char errorMessagePrefix[],
1131  const global_size_t numGlobalElements,
1132  const size_t numLocalElements,
1133  const global_ordinal_type indexBase,
1134  const Teuchos::RCP<const Teuchos::Comm<int>>& comm) const;
1135 
1136  void
1137  initWithNonownedHostIndexList(
1138  const char errorMessagePrefix[],
1139  const global_size_t numGlobalElements,
1140  const Kokkos::View<const global_ordinal_type*,
1141  Kokkos::LayoutLeft,
1142  Kokkos::HostSpace,
1143  Kokkos::MemoryUnmanaged>& entryList,
1144  const global_ordinal_type indexBase,
1145  const Teuchos::RCP<const Teuchos::Comm<int>>& comm);
1146 
1148  Teuchos::RCP<const Teuchos::Comm<int> > comm_;
1149 
1151  global_ordinal_type indexBase_;
1152 
1155  global_size_t numGlobalElements_;
1156 
1158  size_t numLocalElements_;
1159 
1161  global_ordinal_type minMyGID_;
1162 
1164  global_ordinal_type maxMyGID_;
1165 
1168  global_ordinal_type minAllGID_;
1169 
1172  global_ordinal_type maxAllGID_;
1173 
1180  global_ordinal_type firstContiguousGID_;
1181 
1195  global_ordinal_type lastContiguousGID_;
1196 
1202  bool uniform_;
1203 
1205  bool contiguous_;
1206 
1215  bool distributed_;
1216 
1249  mutable Kokkos::View<const global_ordinal_type*,
1250  Kokkos::LayoutLeft,
1251  device_type> lgMap_;
1252 
1260 #ifndef SWIG
1261  mutable Kokkos::View<const global_ordinal_type*,
1262  Kokkos::LayoutLeft,
1263  Kokkos::HostSpace> lgMapHost_;
1264 #endif
1265 
1267  typedef ::Tpetra::Details::FixedHashTable<global_ordinal_type, local_ordinal_type, device_type>
1268  global_to_local_table_type;
1269 
1282  global_to_local_table_type glMap_;
1283 
1320  mutable Teuchos::RCP<
1321  Directory<
1323  >
1324  > directory_;
1325  }; // Map class
1326 
1340  template <class LocalOrdinal, class GlobalOrdinal>
1341  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal> >
1342  createLocalMap (const size_t numElements,
1343  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1344 
1359  template <class LocalOrdinal, class GlobalOrdinal, class Node>
1360  Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
1361  createLocalMapWithNode (const size_t numElements,
1362  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1363 
1364 
1372  template <class LocalOrdinal, class GlobalOrdinal>
1373  Teuchos::RCP< const Map<LocalOrdinal,GlobalOrdinal> >
1375  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1376 
1383  template <class LocalOrdinal, class GlobalOrdinal, class Node>
1384  Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
1386  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1387 
1388 
1395  template <class LocalOrdinal, class GlobalOrdinal>
1396  Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal> >
1397  createContigMap (const global_size_t numElements,
1398  const size_t localNumElements,
1399  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1400 
1409  template <class LocalOrdinal, class GlobalOrdinal, class Node>
1410  Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
1412  const size_t localNumElements,
1413  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1414 
1415 
1422  template <class LocalOrdinal, class GlobalOrdinal>
1423  Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal> >
1424  createNonContigMap (const Teuchos::ArrayView<const GlobalOrdinal>& elementList,
1425  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1426 
1434  template <class LocalOrdinal, class GlobalOrdinal, class Node>
1435  Teuchos::RCP< const Map<LocalOrdinal,GlobalOrdinal,Node> >
1436  createNonContigMapWithNode (const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
1437  const Teuchos::RCP<const Teuchos::Comm<int> > &comm);
1438 
1446 
1451  template<class LocalOrdinal, class GlobalOrdinal, class Node>
1452  Teuchos::RCP< const Map<LocalOrdinal,GlobalOrdinal,Node> >
1453  createOneToOne (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& M);
1454 
1460  template<class LocalOrdinal, class GlobalOrdinal, class Node>
1461  Teuchos::RCP< const Map<LocalOrdinal,GlobalOrdinal,Node> >
1463  const ::Tpetra::Details::TieBreak<LocalOrdinal,GlobalOrdinal> & tie_break);
1464 
1465 } // namespace Tpetra
1466 
1467 #include "Tpetra_Directory_decl.hpp"
1468 
1469 namespace Tpetra {
1470  namespace Details {
1471 
1472  template<class OutMapType, class InMapType>
1473  OutMapType TPETRA_DEPRECATED
1474  MapCloner<OutMapType, InMapType>::
1475  clone (const InMapType& mapIn,
1476  const Teuchos::RCP<out_node_type>& /* nodeOut */)
1477  {
1478  static_assert (std::is_same<typename OutMapType::local_ordinal_type,
1479  typename InMapType::local_ordinal_type>::value,
1480  "Tpetra::Map clone: The LocalOrdinal template parameter "
1481  "of the input and output Map types must be the same.");
1482  static_assert (std::is_same<typename OutMapType::global_ordinal_type,
1483  typename InMapType::global_ordinal_type>::value,
1484  "Tpetra::Map clone: The GlobalOrdinal template parameter "
1485  "of the input and output Map types must be the same.");
1486  typedef typename OutMapType::local_ordinal_type LO;
1487  typedef typename OutMapType::global_ordinal_type GO;
1488  typedef ::Tpetra::Directory<LO, GO,
1489  typename OutMapType::node_type> out_dir_type;
1490  typedef typename OutMapType::global_to_local_table_type out_table_type;
1491  typedef typename OutMapType::device_type out_device_type;
1492 
1493  OutMapType mapOut; // Make an empty Map.
1494 
1495  // Fill the new Map with (possibly) shallow copies of all of the
1496  // original Map's data. This is safe because Map is immutable,
1497  // so users can't change the original Map.
1498  mapOut.comm_ = mapIn.comm_;
1499  mapOut.indexBase_ = mapIn.indexBase_;
1500  mapOut.numGlobalElements_ = mapIn.numGlobalElements_;
1501  mapOut.numLocalElements_ = mapIn.numLocalElements_;
1502  mapOut.minMyGID_ = mapIn.minMyGID_;
1503  mapOut.maxMyGID_ = mapIn.maxMyGID_;
1504  mapOut.minAllGID_ = mapIn.minAllGID_;
1505  mapOut.maxAllGID_ = mapIn.maxAllGID_;
1506  mapOut.firstContiguousGID_= mapIn.firstContiguousGID_;
1507  mapOut.lastContiguousGID_ = mapIn.lastContiguousGID_;
1508  mapOut.uniform_ = mapIn.uniform_;
1509  mapOut.contiguous_ = mapIn.contiguous_;
1510  mapOut.distributed_ = mapIn.distributed_;
1511  {
1512  // mfh 25 Dec 2015, 11 Jan 2016: We really only need to make a
1513  // deep copy if the two Map types have different memory
1514  // spaces. However, if you're calling clone(), it is likely
1515  // the case that the memory spaces differ, so it doesn't hurt
1516  // to make a deep copy here.
1517  Kokkos::View<GO*, Kokkos::LayoutLeft, out_device_type>
1518  lgMapOut ("lgMap", mapIn.lgMap_.extent (0));
1519  Kokkos::deep_copy (lgMapOut, mapIn.lgMap_);
1520  mapOut.lgMap_ = lgMapOut; // cast to const
1521 
1522  // mfh 11 Apr 2016: We can't just assign mapIn.lgMapHost_ to
1523  // mapOut.lgMapHost_ either. This is because the memory space
1524  // of the host mirror of a CudaUVMSpace View is also
1525  // CudaUVMSpace, but the memory space of the host mirror of a
1526  // HostSpace View is HostSpace. We can't assign one View to
1527  // another View with a different memory space.
1528  //
1529  // What we _can_ do here, though, is avoid a deep_copy in case
1530  // we're not using CUDA, by exploiting host mirrors.
1531 
1532  // lgMapOut is nonconst, so use it here instead of mapOut.lgMap_.
1533  auto lgMapHostOut =
1534  Kokkos::create_mirror_view (Kokkos::HostSpace (), lgMapOut);
1535  Kokkos::deep_copy (lgMapHostOut, lgMapOut);
1536  mapOut.lgMapHost_ = lgMapHostOut;
1537  }
1538  // This makes a deep copy only if necessary. We could have
1539  // defined operator= to do this, but that would violate
1540  // expectations. (Kokkos::View::operator= only does a shallow
1541  // copy, EVER.)
1542  mapOut.glMap_ = out_table_type (mapIn.glMap_);
1543 
1544  // We could cleverly clone the Directory here if it is
1545  // initialized, but there is no harm in simply creating it
1546  // uninitialized.
1547  mapOut.directory_ = Teuchos::rcp (new out_dir_type ());
1548 
1549  return mapOut;
1550  }
1551  } // namespace Details
1552 
1553 
1554 } // namespace Tpetra
1555 
1558 template <class LocalOrdinal, class GlobalOrdinal, class Node>
1561 { return map1.isSameAs (map2); }
1562 
1565 template <class LocalOrdinal, class GlobalOrdinal, class Node>
1568 { return ! map1.isSameAs (map2); }
1569 
1570 
1571 #endif // TPETRA_MAP_DECL_HPP
Declaration and definition of the Tpetra::Map class, an implementation detail of Tpetra::Map.
Forward declaration of Tpetra::Directory.
Forward declaration of Tpetra::Map.
Forward declaration for Tpetra::TieBreak.
"Local" part of Map suitable for Kokkos kernels.
Implement mapping from global ID to process ID and local ID.
A parallel distribution of indices over processes.
Map(Map< local_ordinal_type, global_ordinal_type, node_type > &&)=default
Move constructor (shallow move).
bool isDistributed() const
Whether this Map is globally distributed or locally replicated.
bool isOneToOne() const
Whether the Map is one to one.
std::string description() const
Implementation of Teuchos::Describable.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal > > createLocalMap(const size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Nonmember constructor for a locally replicated Map with the default Kokkos Node.
global_ordinal_type getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal > > createUniformContigMap(const global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Non-member constructor for a uniformly distributed, contiguous Map with the default Kokkos Node.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal > > createNonContigMap(const Teuchos::ArrayView< const GlobalOrdinal > &elementList, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Nonmember constructor for a non-contiguous Map using the default Kokkos::Device type.
global_ordinal_type getGlobalElement(local_ordinal_type localIndex) const
The global index corresponding to the given local index.
Node node_type
Legacy typedef that will go away at some point.
GlobalOrdinal global_ordinal_type
The type of global indices.
bool operator!=(const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map1, const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map2)
True if map1 is not the same as (in the sense of isSameAs()) map2, else false.
Map & operator=(const Map< local_ordinal_type, global_ordinal_type, node_type > &)=default
Copy assigment (shallow copy).
Teuchos::ArrayView< const global_ordinal_type > getNodeElementList() const
Return a NONOWNING view of the global indices owned by this process.
LookupStatus getRemoteIndexList(const Teuchos::ArrayView< const global_ordinal_type > &GIDList, const Teuchos::ArrayView< int > &nodeIDList, const Teuchos::ArrayView< local_ordinal_type > &LIDList) const
Return the process ranks and corresponding local indices for the given global indices.
bool isNodeLocalElement(local_ordinal_type localIndex) const
Whether the given local index is valid for this Map on the calling process.
bool isUniform() const
Whether the range of global indices is uniform.
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
Accessors for the Teuchos::Comm and Kokkos Node objects.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode(const global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Non-member constructor for a uniformly distributed, contiguous Map with a user-specified Kokkos Node.
typename device_type::execution_space execution_space
The Kokkos execution space.
LocalOrdinal local_ordinal_type
The type of local indices.
Teuchos::RCP< const Map< local_ordinal_type, global_ordinal_type, Node > > removeEmptyProcesses() const
Advanced methods.
global_ordinal_type getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
bool isCompatible(const Map< local_ordinal_type, global_ordinal_type, Node > &map) const
True if and only if map is compatible with this Map.
global_ordinal_type getIndexBase() const
The index base for this Map.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal > > createContigMap(const global_size_t numElements, const size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Non-member constructor for a (potentially) non-uniformly distributed, contiguous Map using the defaul...
bool locallySameAs(const Map< local_ordinal_type, global_ordinal_type, node_type > &map) const
Is this Map locally the same as the input Map?
bool isLocallyFitted(const Map< local_ordinal_type, global_ordinal_type, Node > &map) const
True if and only if map is locally fitted to this Map.
bool operator==(const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map1, const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &map2)
True if map1 is the same as (in the sense of isSameAs()) map2, else false.
virtual ~Map()
Destructor (virtual for memory safety of derived classes).
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createOneToOne(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &M)
Nonmember constructor for a contiguous Map with user-defined weights and a user-specified,...
global_ordinal_type getMinGlobalIndex() const
The minimum global index owned by the calling process.
local_ordinal_type getLocalElement(global_ordinal_type globalIndex) const
The local index corresponding to the given global index.
Teuchos::RCP< const Map< local_ordinal_type, global_ordinal_type, Node > > replaceCommWithSubset(const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const
Replace this Map's communicator with a subset communicator.
::Tpetra::Details::LocalMap< local_ordinal_type, global_ordinal_type, device_type > local_map_type
Type of the "local" Map.
global_ordinal_type getMaxGlobalIndex() const
The maximum global index owned by the calling process.
Map(const Map< local_ordinal_type, global_ordinal_type, node_type > &)=default
Copy constructor (shallow copy).
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(const size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Nonmember constructor for a locally replicated Map with a specified Kokkos Node.
global_size_t getGlobalNumElements() const
The number of elements in this Map.
bool isContiguous() const
True if this Map is distributed contiguously, else false.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createNonContigMapWithNode(const Teuchos::ArrayView< const GlobalOrdinal > &elementList, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Nonmember constructor for a noncontiguous Map with a user-specified, possibly nondefault Kokkos Node ...
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.
bool isNodeGlobalElement(global_ordinal_type globalIndex) const
Whether the given global index is owned by this Map on the calling process.
bool isSameAs(const Map< local_ordinal_type, global_ordinal_type, Node > &map) const
True if and only if map is identical to this Map.
local_ordinal_type getMinLocalIndex() const
The minimum local index.
local_map_type getLocalMap() const
Get the local Map for Kokkos kernels.
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
global_indices_array_type getMyGlobalIndices() const
Return a view of the global indices owned by this process.
typename device_type::memory_space memory_space
The Kokkos memory space.
local_ordinal_type getMaxLocalIndex() const
The maximum local index on the calling process.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createOneToOne(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &M, const ::Tpetra::Details::TieBreak< LocalOrdinal, GlobalOrdinal > &tie_break)
Creates a one-to-one version of the given Map where each GID lives on only one process....
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createContigMapWithNode(const global_size_t numElements, const size_t localNumElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Nonmember constructor for a (potentially) nonuniformly distributed, contiguous Map for a user-specifi...
typename Node::device_type device_type
This class' Kokkos::Device specialization.
Implementation details of Tpetra.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
void deep_copy(MultiVector< DS, DL, DG, DN > &dst, const MultiVector< SS, SL, SG, SN > &src)
Copy the contents of the MultiVector src into dst.
LookupStatus
Return status of Map remote index lookup (getRemoteIndexList()).
size_t global_size_t
Global size_t object.
LocalGlobal
Enum for local versus global allocation of Map entries.
Implementation detail of Map::clone().