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 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ************************************************************************
40 // @HEADER
41 
42 #ifndef TPETRA_MAP_DECL_HPP
43 #define TPETRA_MAP_DECL_HPP
44 
48 
49 #include "Tpetra_ConfigDefs.hpp"
50 #include "Tpetra_Map_fwd.hpp"
51 #include "Tpetra_Directory_fwd.hpp"
52 #include "Tpetra_TieBreak_fwd.hpp"
54 #include "Kokkos_DefaultNode.hpp"
55 #include "Kokkos_DualView.hpp"
56 #include "Teuchos_Array.hpp"
57 #include "Teuchos_Comm.hpp"
58 #include "Teuchos_Describable.hpp"
59 
60 
61 namespace Tpetra {
62 
63  namespace Classes {
64  namespace Details {
65 
68  template<class OutMapType, class InMapType>
69  struct MapCloner {
70  typedef typename OutMapType::node_type out_node_type;
71  typedef typename InMapType::node_type in_node_type;
72 
73  static OutMapType
74  clone (const InMapType& mapIn,
75  const Teuchos::RCP<out_node_type>& node2);
76  };
77 
78  } // namespace Details
79 
244  template <class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
245  class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
247  class Map : public Teuchos::Describable {
248  public:
250 
251 
253  typedef LocalOrdinal local_ordinal_type;
255  typedef GlobalOrdinal global_ordinal_type;
257  typedef Node node_type;
258 
260  typedef typename Node::execution_space execution_space;
262  typedef typename Node::memory_space memory_space;
263 
270  typedef typename Node::device_type device_type;
271 
285  typedef ::Tpetra::Details::LocalMap<LocalOrdinal, GlobalOrdinal, device_type>
287 
289 
291 
344  Map (global_size_t numGlobalElements,
345  GlobalOrdinal indexBase,
346  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
347  LocalGlobal lg=GloballyDistributed,
348  const Teuchos::RCP<Node> &node = Teuchos::rcp (new Node));
349 
388  Map (global_size_t numGlobalElements,
389  size_t numLocalElements,
390  GlobalOrdinal indexBase,
391  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
392  const Teuchos::RCP<Node> &node = Teuchos::rcp (new Node));
393 
434  Map (const global_size_t numGlobalElements,
435  const Kokkos::View<const GlobalOrdinal*, device_type>& indexList,
436  const GlobalOrdinal indexBase,
437  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
438 
480  Map (const global_size_t numGlobalElements,
481  const GlobalOrdinal indexList[],
482  const LocalOrdinal indexListSize,
483  const GlobalOrdinal indexBase,
484  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
485 
530  Map (const global_size_t numGlobalElements,
531  const Teuchos::ArrayView<const GlobalOrdinal>& indexList,
532  const GlobalOrdinal indexBase,
533  const Teuchos::RCP<const Teuchos::Comm<int> >& comm,
534  const Teuchos::RCP<Node>& node = Teuchos::rcp (new Node));
535 
549  Map ();
550 
552  ~Map ();
553 
555 
557 
562  bool isOneToOne () const;
563 
570  return numGlobalElements_;
571  }
572 
578  size_t getNodeNumElements () const {
579  return numLocalElements_;
580  }
581 
587  GlobalOrdinal getIndexBase () const {
588  return indexBase_;
589  }
590 
596  LocalOrdinal getMinLocalIndex () const {
597  return static_cast<LocalOrdinal> (0);
598  }
599 
610  LocalOrdinal getMaxLocalIndex () const {
611  if (this->getNodeNumElements () == 0) {
612  return Tpetra::Details::OrdinalTraits<LocalOrdinal>::invalid ();
613  } else { // Local indices are always zero-based.
614  return static_cast<LocalOrdinal> (this->getNodeNumElements () - 1);
615  }
616  }
617 
623  GlobalOrdinal getMinGlobalIndex () const {
624  return minMyGID_;
625  }
626 
632  GlobalOrdinal getMaxGlobalIndex () const {
633  return maxMyGID_;
634  }
635 
641  GlobalOrdinal getMinAllGlobalIndex () const {
642  return minAllGID_;
643  }
644 
650  GlobalOrdinal getMaxAllGlobalIndex () const {
651  return maxAllGID_;
652  }
653 
666  LocalOrdinal getLocalElement (GlobalOrdinal globalIndex) const;
667 
676  GlobalOrdinal getGlobalElement (LocalOrdinal localIndex) const;
677 
682  local_map_type getLocalMap () const;
683 
714  getRemoteIndexList (const Teuchos::ArrayView<const GlobalOrdinal>& GIDList,
715  const Teuchos::ArrayView< int>& nodeIDList,
716  const Teuchos::ArrayView< LocalOrdinal>& LIDList) const;
717 
742  getRemoteIndexList (const Teuchos::ArrayView<const GlobalOrdinal> & GIDList,
743  const Teuchos::ArrayView< int> & nodeIDList) const;
744 
745  private:
757  typedef Kokkos::View<const GlobalOrdinal*,
758  Kokkos::LayoutLeft,
759  device_type> global_indices_array_type;
760 
761  public:
781  global_indices_array_type getMyGlobalIndices () const;
782 
793  Teuchos::ArrayView<const GlobalOrdinal> getNodeElementList() const;
794 
796 
798 
805  bool isNodeLocalElement (LocalOrdinal localIndex) const;
806 
813  bool isNodeGlobalElement (GlobalOrdinal globalIndex) const;
814 
821  bool isUniform () const;
822 
834  bool isContiguous () const;
835 
856  bool isDistributed () const;
857 
882  bool isCompatible (const Map<LocalOrdinal,GlobalOrdinal,Node> &map) const;
883 
914  bool isSameAs (const Map<LocalOrdinal,GlobalOrdinal,Node> &map) const;
915 
920  bool locallySameAs (const Map<LocalOrdinal, GlobalOrdinal, node_type>& map) const;
921 
937  bool isLocallyFitted (const Map<LocalOrdinal, GlobalOrdinal, Node>& map) const;
938 
940 
942 
944  Teuchos::RCP<const Teuchos::Comm<int> > getComm () const;
945 
947  Teuchos::RCP<Node> getNode () const;
948 
950 
952 
954  std::string description () const;
955 
977  void
978  describe (Teuchos::FancyOStream &out,
979  const Teuchos::EVerbosityLevel verbLevel =
980  Teuchos::Describable::verbLevel_default) const;
982 
984 
986  template <class NodeOut>
987  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, NodeOut> >
988  clone (const Teuchos::RCP<NodeOut>& nodeOut) const;
989 
1037  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
1038  removeEmptyProcesses () const;
1039 
1067  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
1068  replaceCommWithSubset (const Teuchos::RCP<const Teuchos::Comm<int> >& newComm) const;
1070 
1071  protected:
1072  // This lets other specializations of Map access all of this
1073  // specialization's internal methods and data, so that we can
1074  // implement clone() without exposing the details of Map to users.
1075  template <class LO, class GO, class N> friend class Map;
1076 
1077  private:
1078  template<class OutMapType, class InMapType>
1079  friend struct Details::MapCloner;
1080 
1085  std::string
1086  localDescribeToString (const Teuchos::EVerbosityLevel vl) const;
1087 
1095  void setupDirectory () const;
1096 
1111  bool checkIsDist() const;
1112 
1121  initialNonuniformDebugCheck (const global_size_t numGlobalElements,
1122  const size_t numLocalElements,
1123  const GlobalOrdinal indexBase,
1124  const Teuchos::RCP<const Teuchos::Comm<int> >& comm) const;
1125 
1126  void
1127  initWithNonownedHostIndexList (const global_size_t numGlobalElements,
1128  const Kokkos::View<const GlobalOrdinal*,
1129  Kokkos::LayoutLeft,
1130  Kokkos::HostSpace,
1131  Kokkos::MemoryUnmanaged>& entryList,
1132  const GlobalOrdinal indexBase,
1133  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1134 
1136  Teuchos::RCP<const Teuchos::Comm<int> > comm_;
1137 
1139  GlobalOrdinal indexBase_;
1140 
1143  global_size_t numGlobalElements_;
1144 
1146  size_t numLocalElements_;
1147 
1149  GlobalOrdinal minMyGID_;
1150 
1152  GlobalOrdinal maxMyGID_;
1153 
1156  GlobalOrdinal minAllGID_;
1157 
1160  GlobalOrdinal maxAllGID_;
1161 
1168  GlobalOrdinal firstContiguousGID_;
1169 
1183  GlobalOrdinal lastContiguousGID_;
1184 
1190  bool uniform_;
1191 
1193  bool contiguous_;
1194 
1203  bool distributed_;
1204 
1237  mutable Kokkos::View<const GlobalOrdinal*,
1238  Kokkos::LayoutLeft,
1239  device_type> lgMap_;
1240 
1248 #ifndef SWIG
1249  mutable typename decltype (lgMap_)::HostMirror lgMapHost_;
1250 #endif
1251 
1253  typedef ::Tpetra::Details::FixedHashTable<GlobalOrdinal, LocalOrdinal, device_type>
1255 
1268  global_to_local_table_type glMap_;
1269 
1306  mutable Teuchos::RCP<Directory<LocalOrdinal,GlobalOrdinal,Node> > directory_;
1307 
1308  }; // Map class
1309 
1310 } // namespace Classes
1311 
1325  template <class LocalOrdinal, class GlobalOrdinal>
1326  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal> >
1327  createLocalMap (const size_t numElements,
1328  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1329 
1346  template <class LocalOrdinal, class GlobalOrdinal, class Node>
1347  Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
1348  createLocalMapWithNode (const size_t numElements,
1349  const Teuchos::RCP<const Teuchos::Comm<int> >& comm,
1350  const Teuchos::RCP<Node>& node = Teuchos::null);
1351 
1359  template <class LocalOrdinal, class GlobalOrdinal>
1360  Teuchos::RCP< const Map<LocalOrdinal,GlobalOrdinal> >
1361  createUniformContigMap (const global_size_t numElements,
1362  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1363 
1370  template <class LocalOrdinal, class GlobalOrdinal, class Node>
1371  Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
1372  createUniformContigMapWithNode (const global_size_t numElements,
1373  const Teuchos::RCP<const Teuchos::Comm<int> >& comm,
1374  const Teuchos::RCP<Node>& node = Teuchos::null);
1375 
1382  template <class LocalOrdinal, class GlobalOrdinal>
1383  Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal> >
1384  createContigMap (const global_size_t numElements,
1385  const size_t localNumElements,
1386  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1387 
1396  template <class LocalOrdinal, class GlobalOrdinal, class Node>
1397  Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
1398  createContigMapWithNode (const global_size_t numElements,
1399  const size_t localNumElements,
1400  const Teuchos::RCP<const Teuchos::Comm<int> >& comm,
1401  const Teuchos::RCP<Node>& node = Teuchos::null);
1402 
1409  template <class LocalOrdinal, class GlobalOrdinal>
1410  Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal> >
1411  createNonContigMap (const Teuchos::ArrayView<const GlobalOrdinal>& elementList,
1412  const Teuchos::RCP<const Teuchos::Comm<int> >& comm);
1413 
1421  template <class LocalOrdinal, class GlobalOrdinal, class Node>
1422  Teuchos::RCP< const Map<LocalOrdinal,GlobalOrdinal,Node> >
1423  createNonContigMapWithNode (const Teuchos::ArrayView<const GlobalOrdinal> &elementList,
1424  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
1425  const Teuchos::RCP<Node>& node = Teuchos::null);
1426 
1434  template <class LocalOrdinal, class GlobalOrdinal, class Node>
1435  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
1436  createWeightedContigMapWithNode (const int thisNodeWeight,
1437  const global_size_t numElements,
1438  const Teuchos::RCP<const Teuchos::Comm<int> > &comm,
1439  const Teuchos::RCP<Node>& node = Teuchos::null);
1440 
1445  template<class LocalOrdinal, class GlobalOrdinal, class Node>
1446  Teuchos::RCP< const Map<LocalOrdinal,GlobalOrdinal,Node> >
1447  createOneToOne (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& M);
1448 
1454  template<class LocalOrdinal, class GlobalOrdinal, class Node>
1455  Teuchos::RCP< const Map<LocalOrdinal,GlobalOrdinal,Node> >
1456  createOneToOne(const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > &M,
1457  const ::Tpetra::Details::TieBreak<LocalOrdinal,GlobalOrdinal> & tie_break);
1458 
1459 } // namespace Tpetra
1460 
1461 #include "Tpetra_Directory_decl.hpp"
1462 
1463 namespace Tpetra {
1464 namespace Classes {
1465  namespace Details {
1466 
1467  template<class OutMapType, class InMapType>
1468  OutMapType
1469  MapCloner<OutMapType, InMapType>::
1470  clone (const InMapType& mapIn,
1471  const Teuchos::RCP<out_node_type>& nodeOut)
1472  {
1473  static_assert (std::is_same<typename OutMapType::local_ordinal_type,
1474  typename InMapType::local_ordinal_type>::value,
1475  "Tpetra::Map clone: The LocalOrdinal template parameter "
1476  "of the input and output Map types must be the same.");
1477  static_assert (std::is_same<typename OutMapType::global_ordinal_type,
1478  typename InMapType::global_ordinal_type>::value,
1479  "Tpetra::Map clone: The GlobalOrdinal template parameter "
1480  "of the input and output Map types must be the same.");
1481  typedef typename OutMapType::local_ordinal_type LO;
1482  typedef typename OutMapType::global_ordinal_type GO;
1484  typename OutMapType::node_type> out_dir_type;
1485  typedef typename OutMapType::global_to_local_table_type out_table_type;
1486  typedef typename OutMapType::device_type out_device_type;
1487 
1488  OutMapType mapOut; // Make an empty Map.
1489 
1490  // Fill the new Map with (possibly) shallow copies of all of the
1491  // original Map's data. This is safe because Map is immutable,
1492  // so users can't change the original Map.
1493  mapOut.comm_ = mapIn.comm_;
1494  mapOut.indexBase_ = mapIn.indexBase_;
1495  mapOut.numGlobalElements_ = mapIn.numGlobalElements_;
1496  mapOut.numLocalElements_ = mapIn.numLocalElements_;
1497  mapOut.minMyGID_ = mapIn.minMyGID_;
1498  mapOut.maxMyGID_ = mapIn.maxMyGID_;
1499  mapOut.minAllGID_ = mapIn.minAllGID_;
1500  mapOut.maxAllGID_ = mapIn.maxAllGID_;
1501  mapOut.firstContiguousGID_= mapIn.firstContiguousGID_;
1502  mapOut.lastContiguousGID_ = mapIn.lastContiguousGID_;
1503  mapOut.uniform_ = mapIn.uniform_;
1504  mapOut.contiguous_ = mapIn.contiguous_;
1505  mapOut.distributed_ = mapIn.distributed_;
1506  {
1507  // mfh 25 Dec 2015, 11 Jan 2016: We really only need to make a
1508  // deep copy if the two Map types have different memory
1509  // spaces. However, if you're calling clone(), it is likely
1510  // the case that the memory spaces differ, so it doesn't hurt
1511  // to make a deep copy here.
1512  Kokkos::View<GO*, Kokkos::LayoutLeft, out_device_type>
1513  lgMapOut ("lgMap", mapIn.lgMap_.extent (0));
1514  Kokkos::deep_copy (lgMapOut, mapIn.lgMap_);
1515  mapOut.lgMap_ = lgMapOut; // cast to const
1516 
1517  // mfh 11 Apr 2016: We can't just assign mapIn.lgMapHost_ to
1518  // mapOut.lgMapHost_ either. This is because the memory space
1519  // of the host mirror of a CudaUVMSpace View is also
1520  // CudaUVMSpace, but the memory space of the host mirror of a
1521  // HostSpace View is HostSpace. We can't assign one View to
1522  // another View with a different memory space.
1523  //
1524  // What we _can_ do here, though, is avoid a deep_copy in case
1525  // we're not using CUDA, by exploiting host mirrors.
1526 
1527  static_assert (std::is_same<typename decltype (mapOut.lgMapHost_)::array_layout,
1528  typename decltype (mapIn.lgMapHost_)::array_layout>::value,
1529  "mapOut.lgMapHost_ and MapIn.lgMapHost_ do not have the same "
1530  "array_layout. Please report this bug to the Tpetra developers.");
1531 
1532  // lgMapOut is nonconst, so use it here instead of mapOut.lgMap_.
1533  auto lgMapHostOut = Kokkos::create_mirror_view (lgMapOut);
1534  Kokkos::deep_copy (lgMapHostOut, lgMapOut);
1535  mapOut.lgMapHost_ = lgMapHostOut;
1536  }
1537  // This makes a deep copy only if necessary. We could have
1538  // defined operator= to do this, but that would violate
1539  // expectations. (Kokkos::View::operator= only does a shallow
1540  // copy, EVER.)
1541  mapOut.glMap_ = out_table_type (mapIn.glMap_);
1542 
1543  // We could cleverly clone the Directory here if it is
1544  // initialized, but there is no harm in simply creating it
1545  // uninitialized.
1546  mapOut.directory_ = Teuchos::rcp (new out_dir_type ());
1547 
1548  return mapOut;
1549  }
1550  } // namespace Details
1551 
1552 
1553  template <class LocalOrdinal, class GlobalOrdinal, class Node>
1554  template <class NodeOut>
1555  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, NodeOut> >
1557  clone (const Teuchos::RCP<NodeOut>& nodeOut) const
1558  {
1559  typedef Map<LocalOrdinal, GlobalOrdinal, Node> in_map_type;
1560  typedef Map<LocalOrdinal, GlobalOrdinal, NodeOut> out_map_type;
1562  // Copy constructor does a shallow copy.
1563  return Teuchos::rcp (new out_map_type (cloner_type::clone (*this, nodeOut)));
1564  }
1565 
1566 } // namespace Classes
1567 } // namespace Tpetra
1568 
1571 template <class LocalOrdinal, class GlobalOrdinal, class Node>
1574 { return map1.isSameAs (map2); }
1575 
1578 template <class LocalOrdinal, class GlobalOrdinal, class Node>
1581 { return ! map1.isSameAs (map2); }
1582 
1583 
1584 #endif // TPETRA_MAP_DECL_HPP
1585 
global_size_t getGlobalNumElements() const
The number of elements in this Map.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Node::execution_space execution_space
The Kokkos execution space.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createUniformContigMapWithNode(const global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::null)
Non-member constructor for a uniformly distributed, contiguous Map with a user-specified Kokkos Node...
LocalOrdinal getMinLocalIndex() const
The minimum local index.
GlobalOrdinal getMaxAllGlobalIndex() const
The maximum global index over all processes in the communicator.
GlobalOrdinal global_ordinal_type
The type of global indices.
LookupStatus
Return status of Map remote index lookup (getRemoteIndexList()).
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createOneToOne(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &M)
Creates a one-to-one version of the given Map where each GID lives on only one process.
LocalOrdinal getMaxLocalIndex() const
The maximum local index on the calling process.
::Tpetra::Details::LocalMap< LocalOrdinal, GlobalOrdinal, device_type > local_map_type
Type of the "local" Map.
Classes::Directory< LocalOrdinal, GlobalOrdinal, Node > Directory
Alias for Tpetra::Classes::Directory.
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...
Declaration and definition of the Tpetra::Map class, an implementation detail of Tpetra::Map.
size_t getNodeNumElements() const
The number of elements belonging to the calling process.
GlobalOrdinal getMinAllGlobalIndex() const
The minimum global index over all processes in the communicator.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, NodeOut > > clone(const Teuchos::RCP< NodeOut > &nodeOut) const
Advanced methods.
Node node_type
The type of the Kokkos Node.
int local_ordinal_type
Default value of Scalar template parameter.
GlobalOrdinal getIndexBase() const
The index base for this Map.
Classes::Map< LocalOrdinal, GlobalOrdinal, Node > Map
Alias for Tpetra::Classes::Map.
Implementation details of Tpetra.
size_t global_size_t
Global size_t object.
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.
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.
Node::memory_space memory_space
The Kokkos memory space.
GlobalOrdinal getMinGlobalIndex() const
The minimum global index owned by the calling process.
Forward declaration of Tpetra::Directory.
Node::device_type device_type
The Kokkos device type over which to allocate Views and perform work.
GlobalOrdinal getMaxGlobalIndex() const
The maximum global index owned by the calling process.
"Local" part of Map suitable for Kokkos kernels.
::Kokkos::Compat::KokkosDeviceWrapperNode< execution_space > node_type
Default value of Node template parameter.
bool isSameAs(const Map< LocalOrdinal, GlobalOrdinal, Node > &map) const
True if and only if map is identical to this Map.
LocalOrdinal local_ordinal_type
The type of local indices.
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.
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.
A parallel distribution of indices over processes.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createLocalMapWithNode(const size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::null)
Nonmember constructor for a locally replicated Map with a specified Kokkos Node.
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, const Teuchos::RCP< Node > &node=Teuchos::null)
Nonmember constructor for a (potentially) nonuniformly distributed, contiguous Map for a user-specifi...
LocalGlobal
Enum for local versus global allocation of Map entries.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > createWeightedContigMapWithNode(const int thisNodeWeight, const global_size_t numElements, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::null)
Nonmember constructor for a contiguous Map with user-defined weights and a user-specified, possibly nondefault Kokkos Node type.
Implementation detail of Map::clone().
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.
Forward declaration of Tpetra::Map.
Forward declaration for Tpetra::TieBreak.
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, Node > > createNonContigMapWithNode(const Teuchos::ArrayView< const GlobalOrdinal > &elementList, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< Node > &node=Teuchos::null)
Nonmember constructor for a noncontiguous Map with a user-specified, possibly nondefault Kokkos Node ...