|
Tpetra Matrix/Vector Services
Version of the Day
|
Describes a parallel distribution of objects over processes (Kokkos refactor specialization of Map). More...
#include <Tpetra_KokkosRefactor_Map_decl.hpp>
Inherits Describable.
Public Member Functions | |
| bool | locallySameAs (const Map< LocalOrdinal, GlobalOrdinal, node_type > &map) const |
| Is the given Map locally the same as the input Map? | |
Methods safe to call in a Kokkos parallel kernel on the host. | |
These methods are thread-safe and thread-scalable on the host. You may safely call them in a Kokkos parallel kernel on the host. If DeviceType is not a host device (e.g., if it is Kokkos::Cuda), then you must get the underlying "device Map" object out in order to call these methods in a Kokkos parallel kernel on the device. To do this, call getDeviceView(). | |
| GlobalOrdinal | invalidGlobalIndex () const |
| An invalid global index. | |
| LocalOrdinal | invalidLocalIndex () const |
| An invalid local index. | |
| global_size_t | getGlobalNumElements () const |
| Total number of indices over all processes in the Map's communicator. | |
| size_t | getNodeNumElements () const |
| Number of indices owned by the calling process. | |
| GlobalOrdinal | getIndexBase () const |
| Index base for this Map. | |
| LocalOrdinal | getInvalidLocalIndex () const |
| An invalid local index. | |
| LocalOrdinal | getMinLocalIndex () const |
| The minimum local index (on the calling process). | |
| LocalOrdinal | getMaxLocalIndex () const |
| The maximum local index on the calling process. | |
| GlobalOrdinal | getInvalidGlobalIndex () const |
| An invalid global index. | |
| GlobalOrdinal | getMinGlobalIndex () const |
| The minimum global index owned by the calling process. | |
| GlobalOrdinal | getMaxGlobalIndex () const |
| The maximum global index owned by the calling process. | |
| GlobalOrdinal | getMinAllGlobalIndex () const |
| The minimum global index over all processes in the communicator. | |
| GlobalOrdinal | getMaxAllGlobalIndex () const |
| The maximum global index over all processes in the communicator. | |
| LocalOrdinal | getLocalElement (const GlobalOrdinal globalIndex) const |
| The local index corresponding to the given global index. | |
| GlobalOrdinal | getGlobalElement (const LocalOrdinal localIndex) const |
| The global index corresponding to the given local index. | |
| bool | isNodeLocalElement (const LocalOrdinal localIndex) const |
| Whether the given local index is valid for this Map on this process. | |
| bool | isNodeGlobalElement (const GlobalOrdinal globalIndex) const |
| Whether the given global index is valid for this Map on this process. | |
| bool | isUniform () const |
| Whether the range of global indices is uniform. | |
| bool | isContiguous () const |
| True if this Map is distributed contiguously, else false. | |
| bool | isDistributed () const |
| Whether this Map is globally distributed or locally replicated. | |
Methods <i>not</i> safe to call in a Kokkos parallel kernel. | |
These methods are NOT thread-safe, on either host or device. You may not call them in a Kokkos parallel kernel. | |
| bool | isOneToOne () const |
| Whether the Map is one to one. | |
| template<class OutDeviceType > | |
| Details::Map< LocalOrdinal, GlobalOrdinal, OutDeviceType > | getDeviceView () |
| Get the version of the Map's implementation for the given Kokkos device. | |
| LookupStatus | getRemoteIndexList (const Teuchos::ArrayView< const GlobalOrdinal > &GIDs, const Teuchos::ArrayView< int > &PIDs, const Teuchos::ArrayView< LocalOrdinal > &LIDs) const |
| Return the process ranks and corresponding local indices for the given global indices. | |
| LookupStatus | getRemoteIndexList (const Teuchos::ArrayView< const GlobalOrdinal > &GIDs, const Teuchos::ArrayView< int > &PIDs) const |
| Return the process ranks for the given global indices. | |
| Teuchos::ArrayView< const GlobalOrdinal > | getNodeElementList () const |
| Return a view of the global indices owned by this process. | |
| bool | isCompatible (const Map< LocalOrdinal, GlobalOrdinal, node_type > &map) const |
True if and only if map is compatible with this Map. | |
| bool | isSameAs (const Map< LocalOrdinal, GlobalOrdinal, node_type > &map) const |
True if and only if map is identical to this Map. | |
| Teuchos::RCP< const Teuchos::Comm< int > > | getComm () const |
| Accessors for the Teuchos::Comm and Kokkos Node objects. | |
| Teuchos::RCP< node_type > | getNode () const |
| Get this Map's Kokkos node instance. | |
| std::string | description () const |
Implementation of Teuchos::Describable. | |
| void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const |
| Print this object with the given verbosity level to the given Teuchos::FancyOStream. | |
| template<class OutNodeType > | |
| Teuchos::RCP< const Map < LocalOrdinal, GlobalOrdinal, OutNodeType > > | clone (const Teuchos::RCP< OutNodeType > &node2) const |
| Advanced methods. | |
| RCP< const Map< LocalOrdinal, GlobalOrdinal, node_type > > | removeEmptyProcesses () const |
| Return a new Map with processes with zero elements removed. | |
| RCP< const Map< LocalOrdinal, GlobalOrdinal, node_type > > | replaceCommWithSubset (const Teuchos::RCP< const Teuchos::Comm< int > > &newComm) const |
| Replace this Map's communicator with a subset communicator. | |
Typedefs | |
| typedef LocalOrdinal | local_ordinal_type |
| The type of local indices. | |
| typedef GlobalOrdinal | global_ordinal_type |
| The type of global indices. | |
| typedef Kokkos::Compat::KokkosDeviceWrapperNode < DeviceType > | node_type |
| The type of the Kokkos Node (less useful than device_type). | |
| typedef DeviceType | device_type |
| The type of the Kokkos Device (more useful than node_type). | |
| Map (const global_size_t globalNumIndices, const GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const LocalGlobal lg=GloballyDistributed, const Teuchos::RCP< node_type > &node=KokkosClassic::Details::getNode< node_type >()) | |
| Constructor with Tpetra-defined contiguous uniform distribution. | |
| Map (const global_size_t globalNumIndices, const size_t myNumIndices, const GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< node_type > &node=KokkosClassic::Details::getNode< node_type >()) | |
| Constructor with a user-defined contiguous distribution. | |
| Map (const global_size_t globalNumIndices, const Kokkos::View< const GlobalOrdinal *, device_type > &myGlobalIndices, const GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< node_type > &node=KokkosClassic::Details::getNode< node_type >()) | |
| Constructor with user-defined arbitrary (possibly noncontiguous) distribution. | |
| Map (const global_size_t globalNumIndices, const Teuchos::ArrayView< const GlobalOrdinal > &myGlobalIndices, const GlobalOrdinal indexBase, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const Teuchos::RCP< node_type > &node=KokkosClassic::Details::getNode< node_type >()) | |
| Constructor with user-defined arbitrary (possibly noncontiguous) distribution, as a Teuchos::ArrayView. | |
| Map () | |
| Default constructor (that does nothing). | |
Describes a parallel distribution of objects over processes (Kokkos refactor specialization of Map).
| LocalOrdinal | The type of local indices. Should be an integer, and generally should be signed. A good model of LocalOrdinal is int. (In Epetra, this is always just int.) |
| GlobalOrdinal | The type of global indices. Should be an integer, and generally should be signed. Also, sizeof(GlobalOrdinal) should be greater than to equal to sizeof(LocalOrdinal). For example, if LocalOrdinal is int, good models of GlobalOrdinal are int, long, long long (if the configure-time option Teuchos_ENABLE_LONG_LONG_INT was set), or ptrdiff_t. |
| DeviceType | The Kokkos Device type. |
This class describes a distribution of data elements over one or more processes in a communicator. Each element has a global index (of type GlobalOrdinal) uniquely associated to it. Each global index in the Map is "owned" by one or more processes in the Map's communicator. The user gets to decide what an "element" means; examples include a row or column of a sparse matrix (as in CrsMatrix), or a row of one or more vectors (as in MultiVector).
Before reading the rest of this documentation, it helps to know something about the Teuchos memory management classes, in particular Teuchos::RCP, Teuchos::ArrayRCP, and Teuchos::ArrayView, as well as Kokkos::View. You should also know a little bit about MPI (the Message Passing Interface for distributed-memory programming). You won't have to use MPI directly to use Map, but it helps to be familiar with the general idea of distributed storage of data over a communicator.
The distinction between local and global indices and types might confuse new Tpetra users. Global indices represent the elements of a distributed object (such as rows or columns of a CrsMatrix, or rows of a MultiVector) uniquely over the entire object, which may be distributed over multiple processes. Local indices are local to the process that owns them. If global index G is owned by process P, then there is a unique local index L on process P corresponding to G. If the local index L is valid on process P, then there is a unique global index G owned by P corresponding to the pair (L, P). However, multiple processes might own the same global index (an "overlapping Map"), so a global index G might correspond to multiple (L, P) pairs. In summary, local indices on a process correspond to object elements (e.g., sparse matrix rows or columns) owned by that process.
Tpetra differs from Epetra in that local and global indices may have different types. In Epetra, local and global indices both have type int. In Tpetra, you get to pick the type of each. For example, you can use a 64-bit integer GlobalOrdinal type to solve problems with more than
unknowns, but a 32-bit integer LocalOrdinal type to save bandwidth in sparse matrix-vector multiply.
A contiguous Map divides an interval of global indices over the processes in its communicator, such that each process gets a contiguous interval of zero or more of those global indices, with the indices owned by a process p strictly greater than those owned by process q if
. Formally, we call a Map contiguous when all of the following hold:
and process q owns a global index
, and if
, then
. Different processes may own different numbers of global indices. We call a Map uniform if it is contiguous, and if the user let the Map divide a global count of indices evenly over the Map's communicator's processes. The latter happens by calling the version of Map's constructor that takes a global count of indices, rather than a local count or an arbitrary list of indices.
Map optimizes for the contiguous case. For example, noncontiguous Maps always require communication in order to figure out which process owns a particular global index. (This communication happens in getRemoteIndexList().) Contiguous but nonuniform Maps may also require communication in this case, though we may only need to perform that communication once (at Map setup time). Contiguous Maps also can convert between global and local indices more efficiently.
Globally distributed means that all of the following are true:
If at least one of the above are not true, then the map is locally replicated. (The two are mutually exclusive.)
Globally distributed objects are partitioned across multiple processes in a communicator. Each process owns at least one element in the object's Map that is not owned by another process. For locally replicated objects, each element in the object's Map is owned redundantly by all processes in the object's communicator. Some algorithms use objects that are too small to be distributed across all processes. The upper Hessenberg matrix in a GMRES iterative solve is a good example. In other cases, such as with block iterative methods, block dot product functions produce small dense matrices that are required by all images. Replicated local objects handle these situations.
Like all Tpetra objects that use the new Kokkos back-end, Map has "dual view" semantics. This means that the data live in the preferred memory space of the DeviceType Kokkos device, but are also mirrored in host memory, if host memory is a different memory space. Map is immutable, though, so it does not implement the synch() or modify() methods that let users transfer data between host and device memory, or mark either data set as modified.
Definition at line 196 of file Tpetra_KokkosRefactor_Map_decl.hpp.
| typedef LocalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::local_ordinal_type |
The type of local indices.
Definition at line 205 of file Tpetra_KokkosRefactor_Map_decl.hpp.
| typedef GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::global_ordinal_type |
The type of global indices.
Definition at line 207 of file Tpetra_KokkosRefactor_Map_decl.hpp.
| typedef Kokkos::Compat::KokkosDeviceWrapperNode<DeviceType> Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::node_type |
The type of the Kokkos Node (less useful than device_type).
Definition at line 209 of file Tpetra_KokkosRefactor_Map_decl.hpp.
| typedef DeviceType Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::device_type |
The type of the Kokkos Device (more useful than node_type).
Definition at line 211 of file Tpetra_KokkosRefactor_Map_decl.hpp.
| Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::Map | ( | const global_size_t | globalNumIndices, |
| const GlobalOrdinal | indexBase, | ||
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm, | ||
| const LocalGlobal | lg = GloballyDistributed, |
||
| const Teuchos::RCP< node_type > & | node = KokkosClassic::Details::getNode<node_type> () |
||
| ) |
Constructor with Tpetra-defined contiguous uniform distribution.
This constructor produces a Map with the following contiguous range of numGlobalElements elements: indexBase, indexBase + 1, ..., numGlobalElements + indexBase - 1. Depending on the lg argument, the elements will either be distributed evenly over all the processes in the given communicator comm, or replicated on all processes in the communicator.
Preconditions on numGlobalElements and indexBase will only be checked in a debug build (when Trilinos was configured with CMake option Teuchos_ENABLE_DEBUG:BOOL=ON). If checks are enabled and any check fails, the constructor will throw std::invalid_argument on all processes in the given communicator.
| numGlobalElements | [in] Number of elements in the Map (over all processes). |
| indexBase | [in] The base of the global indices in the Map. This must be the same on every process in the communicator. The index base will also be the smallest global index in the Map. (If you don't know what this should be, use zero.) |
| lg | [in] Either GloballyDistributed or LocallyReplicated. If GloballyDistributed and the communicator contains P processes, then each process will own either numGlobalElements/P or numGlobalElements/P + 1 nonoverlapping contiguous elements. If LocallyReplicated, then all processes will get the same set of elements, namely indexBase, indexBase + 1, ..., numGlobalElements + indexBase - 1. |
| comm | [in] Communicator over which to distribute the elements. |
| node | [in/out] Kokkos Node instance. The type of this object must match the type of the Node template parameter. |
Definition at line 66 of file Tpetra_KokkosRefactor_Map_def.hpp.
| Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::Map | ( | const global_size_t | globalNumIndices, |
| const size_t | myNumIndices, | ||
| const GlobalOrdinal | indexBase, | ||
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm, | ||
| const Teuchos::RCP< node_type > & | node = KokkosClassic::Details::getNode<node_type> () |
||
| ) |
Constructor with a user-defined contiguous distribution.
If N is the sum of numLocalElements over all processes, then this constructor produces a nonoverlapping Map with N elements distributed over all the processes in the given communicator comm, with either numLocalElements or numLocalElements+1 contiguous elements on the calling process.
Preconditions on numGlobalElements, numLocalElements, and indexBase will only be checked in a debug build (when Trilinos was configured with CMake option TEUCHOS_ENABLE_DEBUG:BOOL=ON). If checks are enabled and any check fails, the constructor will throw std::invalid_argument on all processes in the given communicator.
| numGlobalElements | [in] If numGlobalElements == Teuchos::OrdinalTraits<Tpetra::global_size_t>::invalid(), then the number of global elements will be computed (via a global communication) as the sum of numLocalElements over all processes. Otherwise, it must equal the sum of numLocalElements over all processes. |
| numLocalElements | [in] Number of elements that the calling process will own in the Map. |
| indexBase | [in] The base of the global indices in the Map. This must be the same on every process in the given communicator. For this Map constructor, the index base will also be the smallest global index in the Map. If you don't know what this should be, use zero. |
| comm | [in] Communicator over which to distribute the elements. |
| node | [in/out] Kokkos Node instance. The type of this object must match the type of the Node template parameter. |
Definition at line 88 of file Tpetra_KokkosRefactor_Map_def.hpp.
| Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::Map | ( | const global_size_t | globalNumIndices, |
| const Kokkos::View< const GlobalOrdinal *, device_type > & | myGlobalIndices, | ||
| const GlobalOrdinal | indexBase, | ||
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm, | ||
| const Teuchos::RCP< node_type > & | node = KokkosClassic::Details::getNode<node_type> () |
||
| ) |
Constructor with user-defined arbitrary (possibly noncontiguous) distribution.
Call this constructor if you have an arbitrary list of global indices for each process in the given communicator. Those indices need not be contiguous, and the sets of global indices on different processes may overlap. This is the constructor to use to make a general overlapping distribution.
| globalNumIndices | [in] If globalNumIndices == Teuchos::OrdinalTraits<Tpetra::global_size_t>::invalid(), the number of global elements will be computed (via a global communication) as the sum of the counts of local elements. Otherwise, it must equal the sum of the local elements over all processes. This will only be checked if Trilinos' Teuchos package was built with debug support (CMake Boolean option Teuchos_ENABLE_DEBUG:BOOL=ON). If verification fails, the constructor will throw std::invalid_argument. |
| myGlobalIndices | [in] List of global indices owned by the calling process. |
| indexBase | [in] The base of the global indices in the Map. This must be the same on every process in the given communicator. Currently, Map requires that this equal the global minimum index over all processes' myGlobalIndices inputs. |
| comm | [in] Communicator over which to distribute the elements. |
| node | [in/out] Kokkos Node instance. The type of this object must match the type of the Node template parameter. |
Definition at line 119 of file Tpetra_KokkosRefactor_Map_def.hpp.
| Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::Map | ( | const global_size_t | globalNumIndices, |
| const Teuchos::ArrayView< const GlobalOrdinal > & | myGlobalIndices, | ||
| const GlobalOrdinal | indexBase, | ||
| const Teuchos::RCP< const Teuchos::Comm< int > > & | comm, | ||
| const Teuchos::RCP< node_type > & | node = KokkosClassic::Details::getNode<node_type> () |
||
| ) |
Constructor with user-defined arbitrary (possibly noncontiguous) distribution, as a Teuchos::ArrayView.
This is like the previous noncontiguous constructor, except that it takes the input list of global indices as a Teuchos::ArrayView, rather than as a Kokkos::View. We provide this constructor for backwards compatibility.
| globalNumIndices | [in] If globalNumIndices == Teuchos::OrdinalTraits<Tpetra::global_size_t>::invalid(), the number of global elements will be computed (via a global communication) as the sum of the counts of local elements. Otherwise, it must equal the sum of the local elements over all processes. This will only be checked if Trilinos' Teuchos package was built with debug support (CMake Boolean option Teuchos_ENABLE_DEBUG:BOOL=ON). If verification fails, the constructor will throw std::invalid_argument. |
| myGlobalIndices | [in] List of global indices owned by the calling process. |
| indexBase | [in] The base of the global indices in the Map. This must be the same on every process in the given communicator. Currently, Map requires that this equal the global minimum index over all processes' myGlobalIndices inputs. |
| comm | [in] Communicator over which to distribute the elements. |
| node | [in/out] Kokkos Node instance. The type of this object must match the type of the Node template parameter. |
Definition at line 149 of file Tpetra_KokkosRefactor_Map_def.hpp.
| Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::Map | ( | ) |
Default constructor (that does nothing).
This only exists to support view semantics of Map. That is, one can create an empty Map, and then assign a nonempty Map to it using operator=.
This constructor is also useful in methods like clone() and removeEmptyProcesses(), where we have the information to initialize the Map more efficiently ourselves, without going through one of the three usual Map construction paths.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::invalidGlobalIndex | ( | ) | const |
An invalid global index.
Map's methods that return a global index use this index to indicate an error condition. For example, if getGlobalElement() gets a local index that is not owned by the calling process, it returns an invalid global index, which equals the return value of this method.
| LocalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::invalidLocalIndex | ( | ) | const |
An invalid local index.
Map's methods that return a local index use this index to indicate an error condition. For example, if getLocalElement() gets a global index that is not owned by the calling process, it returns an invalid local index, which equals the return value of this method.
| global_size_t Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getGlobalNumElements | ( | ) | const |
Total number of indices over all processes in the Map's communicator.
This is the sum, over all processes in the Map's communicator, of each process' number of owned indices. Note that this counts global indices that are owned by multiple processes multiple times.
Definition at line 203 of file Tpetra_KokkosRefactor_Map_def.hpp.
| size_t Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getNodeNumElements | ( | ) | const |
Number of indices owned by the calling process.
Definition at line 210 of file Tpetra_KokkosRefactor_Map_def.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getIndexBase | ( | ) | const |
Index base for this Map.
Definition at line 217 of file Tpetra_KokkosRefactor_Map_def.hpp.
| LocalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getInvalidLocalIndex | ( | ) | const |
An invalid local index.
Map's methods that return a local index use this index to indicate an error condition. For example, if getLocalElement() gets a global index that is not owned by the calling process, it returns an invalid local index, which equals the return value of this method.
Definition at line 231 of file Tpetra_KokkosRefactor_Map_def.hpp.
| LocalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getMinLocalIndex | ( | ) | const |
The minimum local index (on the calling process).
Definition at line 238 of file Tpetra_KokkosRefactor_Map_def.hpp.
| LocalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getMaxLocalIndex | ( | ) | const |
The maximum local index on the calling process.
If this process owns no indices, that is, if getNodeNumElements() == 0, then this method returns the same return value as getInvalidLocalIndex().
Definition at line 245 of file Tpetra_KokkosRefactor_Map_def.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getInvalidGlobalIndex | ( | ) | const |
An invalid global index.
Map's methods that return a global index use this index to indicate an error condition. For example, if getGlobalElement() gets a global index that is not owned by the calling process, it returns an invalid global index, which equals the return value of this method.
Definition at line 224 of file Tpetra_KokkosRefactor_Map_def.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getMinGlobalIndex | ( | ) | const |
The minimum global index owned by the calling process.
Definition at line 252 of file Tpetra_KokkosRefactor_Map_def.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getMaxGlobalIndex | ( | ) | const |
The maximum global index owned by the calling process.
Definition at line 259 of file Tpetra_KokkosRefactor_Map_def.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getMinAllGlobalIndex | ( | ) | const |
The minimum global index over all processes in the communicator.
Definition at line 266 of file Tpetra_KokkosRefactor_Map_def.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getMaxAllGlobalIndex | ( | ) | const |
The maximum global index over all processes in the communicator.
Definition at line 273 of file Tpetra_KokkosRefactor_Map_def.hpp.
| LocalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getLocalElement | ( | const GlobalOrdinal | globalIndex | ) | const |
The local index corresponding to the given global index.
If the given global index is not owned by this process, return the value returned by getInvalidLocalIndex();
Definition at line 280 of file Tpetra_KokkosRefactor_Map_def.hpp.
| GlobalOrdinal Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getGlobalElement | ( | const LocalOrdinal | localIndex | ) | const |
The global index corresponding to the given local index.
If the given local index is not valid on the calling process, return the value returned by getInvalidGlobalIndex().
Definition at line 288 of file Tpetra_KokkosRefactor_Map_def.hpp.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::isNodeLocalElement | ( | const LocalOrdinal | localIndex | ) | const |
Whether the given local index is valid for this Map on this process.
Definition at line 296 of file Tpetra_KokkosRefactor_Map_def.hpp.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::isNodeGlobalElement | ( | const GlobalOrdinal | globalIndex | ) | const |
Whether the given global index is valid for this Map on this process.
Definition at line 303 of file Tpetra_KokkosRefactor_Map_def.hpp.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::isUniform | ( | ) | const |
Whether the range of global indices is uniform.
This is a conservative quantity. It need only be true if the Map was constructed using the first (uniform contiguous) constructor or a nonmember constructor that calls it. We reserve the right to do more work to check this in the future.
Definition at line 310 of file Tpetra_KokkosRefactor_Map_def.hpp.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::isContiguous | ( | ) | const |
True if this Map is distributed contiguously, else false.
Currently, creating this Map using the constructor for a user-defined arbitrary distribution (that takes a list of global elements owned on each process) means that this method always returns false. We currently make no effort to test whether the user-provided global indices are actually contiguous on all the processes. Many operations may be faster for contiguous Maps. Thus, if you know the indices are contiguous on all processes, you should consider using one of the constructors for contiguous elements.
Definition at line 317 of file Tpetra_KokkosRefactor_Map_def.hpp.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::isDistributed | ( | ) | const |
Whether this Map is globally distributed or locally replicated.
"Globally distributed" means that all of the following are true:
If at least one of the above are not true, then the map is "locally replicated." (The two are mutually exclusive.)
Calling this method requires no communication or computation, because the result is precomputed in Map's constructors.
Definition at line 528 of file Tpetra_KokkosRefactor_Map_def.hpp.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::isOneToOne | ( | ) | const |
Whether the Map is one to one.
This must be called collectively over all processes in the Map's communicator.
Definition at line 894 of file Tpetra_KokkosRefactor_Map_def.hpp.
| Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getDeviceView | ( | ) | [inline] |
Get the version of the Map's implementation for the given Kokkos device.
| OutDeviceType | The Kokkos device type of the returned object. |
This method will only compile if one of two conditions is met:
OutDeviceType is the same as device_type (this Map's original Kokkos device type) </il> OutDeviceType is compatible with device_type::host_mirror_device_type Details::Map<LocalOrdinal, GlobalOrdinal, OutDeviceType>. It has shallow-copy (handle or view) semantics.This method has a handy side effect: if it can do so cheaply, it initializes either the host or device Map implementation of this object, if it is not yet initialized but the other is. This is why the method is marked nonconst.
Definition at line 583 of file Tpetra_KokkosRefactor_Map_decl.hpp.
| LookupStatus Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getRemoteIndexList | ( | const Teuchos::ArrayView< const GlobalOrdinal > & | GIDs, |
| const Teuchos::ArrayView< int > & | PIDs, | ||
| const Teuchos::ArrayView< LocalOrdinal > & | LIDs | ||
| ) | const |
Return the process ranks and corresponding local indices for the given global indices.
This operation must always be called as a collective over all processes in the Map's communicator. For a distributed noncontiguous Map, this operation requires communication.
| GIDs | [in] List of global indices for which to find process ranks and local indices. These global indices need not be owned by the calling process. Indeed, they need not be owned by any process. |
| PIDs | [out] List of process ranks corresponding to the given global indices. If a global index does not belong to any process, the resulting process rank is -1. |
| LIDs | [out] List of local indices (that is, the local index on the process that owns them) corresponding to the given global indices. If a global index does not have a local index, the resulting local index has the value returned by getInvalidLocalIndex(). |
Definition at line 800 of file Tpetra_KokkosRefactor_Map_def.hpp.
| LookupStatus Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getRemoteIndexList | ( | const Teuchos::ArrayView< const GlobalOrdinal > & | GIDs, |
| const Teuchos::ArrayView< int > & | PIDs | ||
| ) | const |
Return the process ranks for the given global indices.
This method must always be called as a collective over all processes in the Map's communicator. For a distributed noncontiguous Map, this operation requires communication.
| GIDs | [in] List of global indices for which to find process ranks and local indices. These global indices need not be owned by the calling process. Indeed, they need not be owned by any process. |
| PIDs | [out] List of process ranks corresponding to the given global indices. If a global index does not belong to any process, the resulting process rank is -1. |
Definition at line 844 of file Tpetra_KokkosRefactor_Map_def.hpp.
| Teuchos::ArrayView< const GlobalOrdinal > Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getNodeElementList | ( | ) | const |
Return a view of the global indices owned by this process.
If you call this method on a contiguous Map, it will create and cache the list of global indices for later use. Beware of calling this if the calling process owns a very large number of global indices.
Definition at line 515 of file Tpetra_KokkosRefactor_Map_def.hpp.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::isCompatible | ( | const Map< LocalOrdinal, GlobalOrdinal, node_type > & | map | ) | const |
True if and only if map is compatible with this Map.
Two Maps are "compatible" if all of the following are true:
Determining #3 requires communication (a reduction over this Map's communicator). This method assumes that the input Map is valid on all processes in this Map's communicator.
Compatibility is useful for determining correctness of certain operations, like assigning one MultiVector X to another Y. If X and Y have the same number of columns, and if their Maps are compatible, then it is legal to assign X to Y or to assign Y to X.
The behavior of this method is undefined if the input Map's communicator and this Map's communicator have different numbers of processes. This method must be called collectively over this Map's communicator.
Definition at line 324 of file Tpetra_KokkosRefactor_Map_def.hpp.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::isSameAs | ( | const Map< LocalOrdinal, GlobalOrdinal, node_type > & | map | ) | const |
True if and only if map is identical to this Map.
"Identical" is stronger than "compatible." Two Maps are identical if all of the following are true:
MPI_IDENT or MPI_CONGRUENT return values of MPI_Comm_compare). "Identical" (isSameAs()) includes and is stronger than "compatible" (isCompatible()).
A Map corresponds to a block permutation over process ranks and global indices. Two Maps with different numbers of processes in their communicators cannot be compatible, let alone identical. Two identical Maps correspond to the same permutation.
The behavior of this method is undefined if the input Map's communicator and this Map's communicator have different numbers of processes. This method must be called collectively over this Map's communicator.
Definition at line 446 of file Tpetra_KokkosRefactor_Map_def.hpp.
| Teuchos::RCP< const Teuchos::Comm< int > > Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getComm | ( | ) | const |
Accessors for the Teuchos::Comm and Kokkos Node objects.
Get this Map's Comm object.
Definition at line 880 of file Tpetra_KokkosRefactor_Map_def.hpp.
| Teuchos::RCP< Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::getNode | ( | ) | const |
Get this Map's Kokkos node instance.
Definition at line 887 of file Tpetra_KokkosRefactor_Map_def.hpp.
| std::string Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::description | ( | ) | const |
Implementation of Teuchos::Describable.
Return a simple one-line description of this object.
Definition at line 535 of file Tpetra_KokkosRefactor_Map_def.hpp.
| void Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::describe | ( | Teuchos::FancyOStream & | out, |
| const Teuchos::EVerbosityLevel | verbLevel = Teuchos::Describable::verbLevel_default |
||
| ) | const |
Print this object with the given verbosity level to the given Teuchos::FancyOStream.
Definition at line 558 of file Tpetra_KokkosRefactor_Map_def.hpp.
| Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, OutNodeType> > Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::clone | ( | const Teuchos::RCP< OutNodeType > & | node2 | ) | const |
Advanced methods.
Create a shallow copy of this Map, with a different Node type.
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > > Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::removeEmptyProcesses | ( | ) | const |
Return a new Map with processes with zero elements removed.
This method first computes a new communicator, which contains only those processes in this Map's communicator (the "original
communicator") that have a nonzero number of elements in this Map (the "original Map"). It then returns a new Map distributed over the new communicator. The new Map represents the same distribution as the original Map, except that processes containing zero elements are not included in the new Map or its communicator. On processes not included in the new Map or communicator, this method returns Teuchos::null.
The returned Map always has a distinct communicator from this Map's original communicator. The new communicator contains a subset of processes from the original communicator. Even if the number of processes in the new communicator equals the number of processes in the original communicator, the new communicator is distinct. (In an MPI implementation, the new communicator is created using MPI_Comm_split.) Furthermore, a process may have a different rank in the new communicator, so be wary of classes that like to store the rank rather than asking the communicator for it each time.
This method must be called collectively on the original communicator. It leaves the original Map and communicator unchanged.
This method was intended for applications such as algebraic multigrid or other multilevel preconditioners. Construction of each level of the multilevel preconditioner typically requires constructing sparse matrices, which in turn requires all-reduces over all participating processes at that level. Matrix sizes at successively coarser levels shrink geometrically. At the coarsest levels, some processes might be left with zero rows of the matrix, or the multigrid implementation might "rebalance" (redistribute the matrix) and intentionally leave some processes with zero rows. Removing processes with zero rows makes the all-reduces and other communication operations cheaper.
Definition at line 701 of file Tpetra_KokkosRefactor_Map_def.hpp.
| Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > > > Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::replaceCommWithSubset | ( | const Teuchos::RCP< const Teuchos::Comm< int > > & | newComm | ) | const |
Replace this Map's communicator with a subset communicator.
This method must be called collectively on the original communicator. It leaves the original Map and communicator unchanged.
Definition at line 641 of file Tpetra_KokkosRefactor_Map_def.hpp.
| bool Tpetra::Map< LocalOrdinal, GlobalOrdinal, Kokkos::Compat::KokkosDeviceWrapperNode< DeviceType > >::locallySameAs | ( | const Map< LocalOrdinal, GlobalOrdinal, node_type > & | map | ) | const |
Is the given Map locally the same as the input Map?
"Locally the same" means that on the calling process, the two Maps' global indices are the same and occur in the same order.
Definition at line 375 of file Tpetra_KokkosRefactor_Map_def.hpp.
1.7.6.1