|
Tpetra Matrix/Vector Services
Version of the Day
|
MultiVector for multiple degrees of freedom per mesh point. More...
#include <Tpetra_Experimental_BlockMultiVector_decl.hpp>

Public Types | |
Typedefs to facilitate template metaprogramming. | |
| typedef Scalar | scalar_type |
| The type of entries in the vector. | |
| typedef LO | local_ordinal_type |
| The type of local indices. | |
| typedef GO | global_ordinal_type |
| The type of global indices. | |
| typedef Node | node_type |
| The Kokkos Node type. | |
| typedef Tpetra::Map < local_ordinal_type, global_ordinal_type, node_type > | map_type |
| The specialization of Tpetra::Map that this class uses. | |
| typedef Tpetra::MultiVector < scalar_type, local_ordinal_type, global_ordinal_type, node_type > | mv_type |
| The specialization of Tpetra::MultiVector that this class uses. | |
| typedef LittleVector< Scalar, LO > | little_vec_type |
| "Block view" of all degrees of freedom at a mesh point, for a single column of the MultiVector. | |
| typedef LittleVector< const Scalar, LO > | const_little_vec_type |
| "Const block view" of all degrees of freedom at a mesh point, for a single column of the MultiVector. | |
Public Member Functions | |
Constructors | |
| BlockMultiVector (const map_type &meshMap, const LO blockSize, const LO numVecs) | |
| Constructor that takes a mesh Map, a block size, and a number of vectors (columns). | |
| BlockMultiVector (const map_type &meshMap, const map_type &pointMap, const LO blockSize, const LO numVecs) | |
| Constructor that takes a mesh Map, a point Map, a block size, and a number of vectors (columns). | |
| BlockMultiVector (const mv_type &X_mv, const map_type &meshMap, const LO blockSize) | |
| View an existing MultiVector. | |
| BlockMultiVector () | |
| Default constructor. | |
Coarse-grained operations | |
| void | putScalar (const Scalar &val) |
Fill all entries with the given value val. | |
| void | scale (const Scalar &val) |
Multiply all entries in place by the given value val. | |
Fine-grained data access | |
| bool | replaceLocalValues (const LO localRowIndex, const LO colIndex, const Scalar vals[]) const |
| Replace all values at the given mesh point, using local row and column indices. | |
| bool | replaceGlobalValues (const GO globalRowIndex, const LO colIndex, const Scalar vals[]) const |
| Replace all values at the given mesh point, using a global index. | |
| bool | sumIntoLocalValues (const LO localRowIndex, const LO colIndex, const Scalar vals[]) const |
| Sum into all values at the given mesh point, using a local index. | |
| bool | sumIntoGlobalValues (const GO globalRowIndex, const LO colIndex, const Scalar vals[]) const |
| Sum into all values at the given mesh point, using a global index. | |
| bool | getLocalRowView (const LO localRowIndex, const LO colIndex, Scalar *&vals) const |
| Get a writeable view of the entries at the given mesh point, using a local index. | |
| bool | getGlobalRowView (const GO globalRowIndex, const LO colIndex, Scalar *&vals) const |
| Get a writeable view of the entries at the given mesh point, using a global index. | |
| little_vec_type | getLocalBlock (const LO localRowIndex, const LO colIndex) const |
| Get a view of the degrees of freedom at the given mesh point. | |
Public methods for redistributing data | |
| void | doImport (const SrcDistObject &source, const Import< LO, GO, Node > &importer, CombineMode CM) |
| Import data into this object using an Import object ("forward mode"). | |
| void | doImport (const SrcDistObject &source, const Export< LO, GO, Node > &exporter, CombineMode CM) |
| Import data into this object using an Export object ("reverse mode"). | |
| void | doExport (const SrcDistObject &source, const Export< LO, GO, Node > &exporter, CombineMode CM) |
| Export data into this object using an Export object ("forward mode"). | |
| void | doExport (const SrcDistObject &source, const Import< LO, GO, Node > &importer, CombineMode CM) |
| Export data into this object using an Import object ("reverse mode"). | |
Attribute accessor methods | |
| bool | isDistributed () const |
| Whether this is a globally distributed object. | |
| virtual Teuchos::RCP< const Map< LO, GO, Node > > | getMap () const |
| The Map describing the parallel distribution of this object. | |
I/O methods | |
| void | print (std::ostream &os) const |
| Print this object to the given output stream. | |
Implementation of Teuchos::Describable | |
| virtual std::string | description () const |
| One-line descriptiion of this object. | |
| virtual void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const |
| Print a descriptiion of this object to the given output stream. | |
Protected Types | |
| typedef Scalar | packet_type |
| The type of each datum being sent or received in an Import or Export. | |
Protected Member Functions | |
| Scalar * | getRawPtr () const |
| Raw pointer to the MultiVector's data. | |
| size_t | getStrideX () const |
| Stride between consecutive local entries in the same column. | |
| size_t | getStrideY () const |
| Stride between consecutive local entries in the same row. | |
| bool | isValidLocalMeshIndex (const LO meshLocalIndex) const |
True if and only if meshLocalIndex is a valid local index in the mesh Map. | |
| virtual size_t | constantNumberOfPackets () const |
| Whether the implementation's instance promises always to have a constant number of packets per LID, and if so, how many packets per LID there are. | |
| virtual void | doTransfer (const SrcDistObject &src, CombineMode CM, size_t numSameIDs, const Teuchos::ArrayView< const LO > &permuteToLIDs, const Teuchos::ArrayView< const LO > &permuteFromLIDs, const Teuchos::ArrayView< const LO > &remoteLIDs, const Teuchos::ArrayView< const LO > &exportLIDs, Distributor &distor, ReverseOption revOp) |
| Redistribute data across memory images. | |
| virtual void | createViews () const |
| Hook for creating a const view. | |
| virtual void | createViewsNonConst (KokkosClassic::ReadWriteOption rwo) |
| Hook for creating a nonconst view. | |
| virtual void | releaseViews () const |
| Hook for releasing views. | |
Implementation of DistObject (or DistObjectKA). | |
The methods here implement Tpetra::DistObject or Tpetra::DistObjectKA, depending on a configure-time option. They let BlockMultiVector participate in Import and Export operations. Users don't have to worry about these methods. | |
| virtual bool | checkSizes (const Tpetra::SrcDistObject &source) |
| Compare the source and target (this) objects for compatibility. | |
| virtual void | copyAndPermute (const Tpetra::SrcDistObject &source, size_t numSameIDs, const Teuchos::ArrayView< const LO > &permuteToLIDs, const Teuchos::ArrayView< const LO > &permuteFromLIDs) |
| Perform copies and permutations that are local to this process. | |
| virtual void | packAndPrepare (const Tpetra::SrcDistObject &source, const Teuchos::ArrayView< const LO > &exportLIDs, Teuchos::Array< packet_type > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t &constantNumPackets, Tpetra::Distributor &distor) |
| Perform any packing or preparation required for communication. | |
| virtual void | unpackAndCombine (const Teuchos::ArrayView< const LO > &importLIDs, const Teuchos::ArrayView< const packet_type > &imports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t constantNumPackets, Tpetra::Distributor &distor, Tpetra::CombineMode CM) |
| Perform any unpacking and combining after communication. | |
Protected Attributes | |
| mv_type | mv_ |
| The Tpetra::MultiVector used to represent the data. | |
| Teuchos::RCP< const Map< LO, GO, Node > > | map_ |
| The Map over which this object is distributed. | |
| Teuchos::Array< Scalar > | imports_ |
| Buffer into which packed data are imported (received from other processes). | |
| Teuchos::Array< size_t > | numImportPacketsPerLID_ |
| Number of packets to receive for each receive operation. | |
| Teuchos::Array< Scalar > | exports_ |
| Buffer from which packed data are exported (sent to other processes). | |
| Teuchos::Array< size_t > | numExportPacketsPerLID_ |
| Number of packets to send for each send operation. | |
Methods for use only by experts | |
| void | removeEmptyProcessesInPlace (Teuchos::RCP< Tpetra::DistObject< PT, LO, GO, NT > > &input, const Teuchos::RCP< const Map< LO, GO, NT > > &newMap) |
| void | removeEmptyProcessesInPlace (Teuchos::RCP< Tpetra::DistObject< PT, LO, GO, NT > > &input) |
| virtual void | removeEmptyProcessesInPlace (const Teuchos::RCP< const Map< LO, GO, Node > > &newMap) |
| Remove processes which contain no elements in this object's Map. | |
Access to Maps, the block size, and a MultiVector view. | |
| map_type | getPointMap () const |
| Get this BlockMultiVector's (previously computed) point Map. | |
| LO | getBlockSize () const |
| Get the number of degrees of freedom per mesh point. | |
| LO | getNumVectors () const |
| Get the number of columns (vectors) in the BlockMultiVector. | |
| mv_type | getMultiVectorView () |
| Get a Tpetra::MultiVector that views this BlockMultiVector's data. | |
| static map_type | makePointMap (const map_type &meshMap, const LO blockSize) |
| Create and return the point Map corresponding to the given mesh Map and block size. | |
MultiVector for multiple degrees of freedom per mesh point.
| Scalar | The type of each entry of the block multivector. (You can use real-valued or complex-valued types here, unlike in Epetra, where the scalar type is always double.) |
| LO | The type of local indices. See the documentation of the first template parameter of Map for requirements. |
| GO | The type of global indices. See the documentation of the second template parameter of Map for requirements. |
| Node | The Kokkos Node type. See the documentation of the third template parameter of Map for requirements. |
BlockMultiVector is like Tpetra::MultiVector, but its interface supports multiple degrees of freedom per mesh point. You can specify a mesh point by its local or global index, and read or write the values at that point. Every mesh point must have the same number of degrees of freedom. We call the number of degrees of freedom per mesh point the block size.
BlockMultiVector has view semantics. This means that the copy constructor and assignment operator (operator=) all do shallow copies. If you want to create a deep copy, call createCopy(); if you want to copy deeply between two BlockMultiVector objects, call deep_copy().
The replace*, sumInto*, and get* methods all are meant to be thread-safe. They don't throw exceptions on error; instead, they return an error code. They are marked "const" because Kokkos requires this in order to use them in parallel kernels. "Const" is legitimate here, even though some of these methods may modify entries of the vector. This is because they do not change any constants or pointers (e.g., they do not reallocate memory).
BlockMultiVector stores entries in a column corresponding to degrees of freedom for the same mesh point contiguously. This is not strictly necessary; we could generalize so that they are stored in a strided fashion, or even take away the layout assumption and only allow access to entries by copy (e.g., getLocalRowCopy() instead of getLocalRowView()).
Here is how you are supposed to use this class:
1. Fill the BlockMultiVector. 2. Do global assembly with BlockMultiVector, if necessary. (It implements Tpetra::DistObject, so you can use it with Import or Export.) 3. Call getMultiVectorView() to get a Tpetra::MultiVector which views the BlockMultiVector's data. 4. Give the Tpetra::MultiVector to Trilinos' solvers.
Note that BlockMultiVector is not a subclass of Tpetra::MultiVector. I did this on purpose, for simplicity. You should really think of BlockMultiVector as an in-place reinterpretation of a Tpetra::MultiVector.
This is the first Tpetra class to assume view semantics of all Tpetra objects. In particular, it assumes that Map has have view semantics, so that its copy constructor and assignment operator do shallow copies, and its default constructor (that takes no arguments) compiles and succeeds, creating a meaningful empty object.
Design philosophy of the new block objects:
1. Each mesh point has the same number of degrees of freedom 2. A BlockMultiVector might have a MultiVector, but is not a MultiVector (i.e., is not a subclass of MultiVector)
Point 1 lets us omit the whole untested and probably broken infrastructure of Tpetra::BlockMap. Users fill by mesh points, not degrees of freedom. Thus, they mainly care about the distribution of mesh points, not so much about what GID we assign to which degree of freedom. The latter is just another Map from their perspective, if they care at all. Preconditioners that respect the block structure also just want the mesh Map. Iterative linear solvers treat the matrix and preconditioner as black-box operators. This means that they only care about the domain and range point Maps.
The latter motivates Point 2. BlockMultiVector views a MultiVector, and iterative solvers (and users) can access the MultiVector and work with it directly, along with its (point) Map. It doesn't make sense for BlockMultiVector to implement MultiVector, because the desired fill interfaces of the two classes are different.
Definition at line 147 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
typedef Scalar Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::packet_type [protected] |
The type of each datum being sent or received in an Import or Export.
Note that this type does not always correspond to the Scalar template parameter of subclasses.
Reimplemented from Tpetra::DistObject< Scalar, LO, GO, Node >.
Definition at line 155 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| typedef Scalar Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::scalar_type |
The type of entries in the vector.
Reimplemented in Tpetra::Experimental::BlockVector< Scalar, LO, GO, Node >.
Definition at line 162 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| typedef LO Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::local_ordinal_type |
The type of local indices.
Reimplemented from Tpetra::DistObject< Scalar, LO, GO, Node >.
Reimplemented in Tpetra::Experimental::BlockVector< Scalar, LO, GO, Node >.
Definition at line 164 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| typedef GO Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::global_ordinal_type |
The type of global indices.
Reimplemented from Tpetra::DistObject< Scalar, LO, GO, Node >.
Reimplemented in Tpetra::Experimental::BlockVector< Scalar, LO, GO, Node >.
Definition at line 166 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| typedef Node Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::node_type |
The Kokkos Node type.
Reimplemented from Tpetra::DistObject< Scalar, LO, GO, Node >.
Reimplemented in Tpetra::Experimental::BlockVector< Scalar, LO, GO, Node >.
Definition at line 168 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::map_type |
The specialization of Tpetra::Map that this class uses.
Reimplemented in Tpetra::Experimental::BlockVector< Scalar, LO, GO, Node >.
Definition at line 172 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| typedef Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::mv_type |
The specialization of Tpetra::MultiVector that this class uses.
Reimplemented in Tpetra::Experimental::BlockVector< Scalar, LO, GO, Node >.
Definition at line 175 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| typedef LittleVector<Scalar, LO> Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::little_vec_type |
"Block view" of all degrees of freedom at a mesh point, for a single column of the MultiVector.
A "block view" lets you address all degrees of freedom at a mesh point. You don't have to use this class to access the degrees of freedom. If you do choose to use this class, it implements operator()(LO i), so you can access and modify its entries.
The preferred way to refer to the little_vec_type and const_little_vec_type types, is to get them from the typedefs below. This is because different specializations of BlockVector reserve the right to use different types to implement little_vec_type or const_little_vec_type. This gives us a porting strategy to move from "classic" Tpetra to the Kokkos refactor version.
Reimplemented in Tpetra::Experimental::BlockVector< Scalar, LO, GO, Node >.
Definition at line 192 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| typedef LittleVector<const Scalar, LO> Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::const_little_vec_type |
"Const block view" of all degrees of freedom at a mesh point, for a single column of the MultiVector.
This is just like little_vec_type, except that you can't modify its entries.
Reimplemented in Tpetra::Experimental::BlockVector< Scalar, LO, GO, Node >.
Definition at line 199 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::BlockMultiVector | ( | const map_type & | meshMap, |
| const LO | blockSize, | ||
| const LO | numVecs | ||
| ) |
Constructor that takes a mesh Map, a block size, and a number of vectors (columns).
| meshMap | [in] Map that describes the distribution of mesh points (rather than the distribution of unknowns for those mesh points). |
| blockSize | [in] The number of degrees of freedom per mesh point. We assume that this is the same for all mesh points in the above Map. |
| numVecs | [in] Number of vectors (columns) in the MultiVector. |
The mesh Map describes the distribution of mesh points. Its corresponding point Map describes the distribution of degrees of freedom corresponding to those mesh points. If you have already computed the point Map corresponding to the above mesh Map, then it is more efficient to call the four-argument constructor below, that takes both the mesh Map and the point Map.
There are two ways to get the point Map corresponding to a given mesh Map and block size. You may either call the class method makePointMap(), or you may call this three-argument constructor, and then call getPointMap().
The point Map enables reinterpretation of a BlockMultiVector as a standard Tpetra::MultiVector. This lets users solve linear systems with Trilinos' solvers and preconditioners, that expect vectors as Tpetra::MultiVector instances.
Definition at line 80 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::BlockMultiVector | ( | const map_type & | meshMap, |
| const map_type & | pointMap, | ||
| const LO | blockSize, | ||
| const LO | numVecs | ||
| ) |
Constructor that takes a mesh Map, a point Map, a block size, and a number of vectors (columns).
See the documentation of the three-argument constructor above.
Definition at line 96 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::BlockMultiVector | ( | const mv_type & | X_mv, |
| const map_type & | meshMap, | ||
| const LO | blockSize | ||
| ) |
View an existing MultiVector.
| X_mv | [in/out] The MultiVector to view. It MUST have view semantics; otherwise this constructor throws. Its Map must be the same (in the sense of isSameAs) as the point Map corresponding to the given mesh Map and block size. |
| meshMap | [in] The mesh Map to use for interpreting the given MultiVector (in place) as a BlockMultiVector. |
| blockSize | [in] The number of degrees of freedom per mesh point. We assume that this is the same for all mesh points. |
Definition at line 113 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::BlockMultiVector | ( | ) |
Default constructor.
Creates an empty BlockMultiVector. An empty BlockMultiVector has zero rows, and block size zero.
Definition at line 172 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| BlockMultiVector< Scalar, LO, GO, Node >::map_type Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::makePointMap | ( | const map_type & | meshMap, |
| const LO | blockSize | ||
| ) | [static] |
Create and return the point Map corresponding to the given mesh Map and block size.
This is a class ("static") method so that you can make and reuse a point Map for creating different BlockMultiVector instances, using the more efficient four-argument constructor.
Definition at line 184 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| map_type Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::getPointMap | ( | ) | const [inline] |
Get this BlockMultiVector's (previously computed) point Map.
It is always valid to call this method. A BlockMultiVector always has a point Map. We do not compute the point Map lazily.
Definition at line 287 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| LO Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::getBlockSize | ( | ) | const [inline] |
Get the number of degrees of freedom per mesh point.
Definition at line 292 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| LO Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::getNumVectors | ( | ) | const [inline] |
Get the number of columns (vectors) in the BlockMultiVector.
Definition at line 297 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| BlockMultiVector< Scalar, LO, GO, Node >::mv_type Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::getMultiVectorView | ( | ) |
Get a Tpetra::MultiVector that views this BlockMultiVector's data.
This is how you can give a BlockMultiVector to Trilinos' solvers and preconditioners.
Definition at line 55 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| void Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::putScalar | ( | const Scalar & | val | ) |
Fill all entries with the given value val.
Definition at line 549 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| void Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::scale | ( | const Scalar & | val | ) |
Multiply all entries in place by the given value val.
Definition at line 556 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| bool Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::replaceLocalValues | ( | const LO | localRowIndex, |
| const LO | colIndex, | ||
| const Scalar | vals[] | ||
| ) | const |
Replace all values at the given mesh point, using local row and column indices.
| localRowIndex | [in] Local index of the mesh point. |
| colIndex | [in] Column (vector) to modify. |
| vals | [in] Input values with which to replace whatever existing values are at the mesh point. |
Definition at line 243 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| bool Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::replaceGlobalValues | ( | const GO | globalRowIndex, |
| const LO | colIndex, | ||
| const Scalar | vals[] | ||
| ) | const |
Replace all values at the given mesh point, using a global index.
| globalRowIndex | [in] Global index of the mesh point. |
| colIndex | [in] Column (vector) to modify. |
| vals | [in] Input values with which to sum into whatever existing values are at the mesh point. |
Definition at line 258 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| bool Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::sumIntoLocalValues | ( | const LO | localRowIndex, |
| const LO | colIndex, | ||
| const Scalar | vals[] | ||
| ) | const |
Sum into all values at the given mesh point, using a local index.
| localRowIndex | [in] Local index of the mesh point. |
| colIndex | [in] Column (vector) to modify. |
| vals | [in] Input values with which to replace whatever existing values are at the mesh point. |
Definition at line 288 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| bool Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::sumIntoGlobalValues | ( | const GO | globalRowIndex, |
| const LO | colIndex, | ||
| const Scalar | vals[] | ||
| ) | const |
Sum into all values at the given mesh point, using a global index.
| globalRowIndex | [in] Global index of the mesh point. |
| colIndex | [in] Column (vector) to modify. |
| vals | [in] Input values with which to replace whatever existing values are at the mesh point. |
Definition at line 303 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| bool Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::getLocalRowView | ( | const LO | localRowIndex, |
| const LO | colIndex, | ||
| Scalar *& | vals | ||
| ) | const |
Get a writeable view of the entries at the given mesh point, using a local index.
| localRowIndex | [in] Local index of the mesh point. |
| colIndex | [in] Column (vector) to view. |
| vals | [out] View of the entries at the given mesh point. |
Definition at line 316 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| bool Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::getGlobalRowView | ( | const GO | globalRowIndex, |
| const LO | colIndex, | ||
| Scalar *& | vals | ||
| ) | const |
Get a writeable view of the entries at the given mesh point, using a global index.
| globalRowIndex | [in] Global index of the mesh point. |
| colIndex | [in] Column (vector) to view. |
| vals | [out] View of the entries at the given mesh point. |
Definition at line 330 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| BlockMultiVector< Scalar, LO, GO, Node >::little_vec_type Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::getLocalBlock | ( | const LO | localRowIndex, |
| const LO | colIndex | ||
| ) | const |
Get a view of the degrees of freedom at the given mesh point.
The preferred way to refer to little_vec_type is to get it from BlockMultiVector's typedef. This is because different specializations of BlockMultiVector reserve the right to use different types to implement little_vec_type. This gives us a porting strategy to move from "classic" Tpetra to the Kokkos refactor version.
Definition at line 345 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| bool Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::checkSizes | ( | const Tpetra::SrcDistObject & | source | ) | [protected, virtual] |
Compare the source and target (this) objects for compatibility.
Implements Tpetra::DistObject< Scalar, LO, GO, Node >.
Definition at line 390 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| void Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::copyAndPermute | ( | const Tpetra::SrcDistObject & | source, |
| size_t | numSameIDs, | ||
| const Teuchos::ArrayView< const LO > & | permuteToLIDs, | ||
| const Teuchos::ArrayView< const LO > & | permuteFromLIDs | ||
| ) | [protected, virtual] |
Perform copies and permutations that are local to this process.
| source | [in] On entry, the source object, from which we are distributing. We distribute to the destination object, which is *this object. |
| numSameIDs | [in] The umber of elements that are the same on the source and destination (this) objects. These elements are owned by the same process in both the source and destination objects. No permutation occurs. |
| numPermuteIDs | [in] The number of elements that are locally permuted between the source and destination objects. |
| permuteToLIDs | [in] List of the elements that are permuted. They are listed by their LID in the destination object. |
| permuteFromLIDs | [in] List of the elements that are permuted. They are listed by their LID in the source object. |
Implements Tpetra::DistObject< Scalar, LO, GO, Node >.
Definition at line 397 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| void Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::packAndPrepare | ( | const Tpetra::SrcDistObject & | source, |
| const Teuchos::ArrayView< const LO > & | exportLIDs, | ||
| Teuchos::Array< packet_type > & | exports, | ||
| const Teuchos::ArrayView< size_t > & | numPacketsPerLID, | ||
| size_t & | constantNumPackets, | ||
| Tpetra::Distributor & | distor | ||
| ) | [protected, virtual] |
Perform any packing or preparation required for communication.
| source | [in] Source object for the redistribution. |
| exportLIDs | [in] List of the entries (as local IDs in the source object) we will be sending to other images. |
| exports | [out] On exit, the buffer for data to send. |
| numPacketsPerLID | [out] On exit, the implementation of this method must do one of two things: set numPacketsPerLID[i] to contain the number of packets to be exported for exportLIDs[i] and set constantNumPackets to zero, or set constantNumPackets to a nonzero value. If the latter, the implementation need not fill numPacketsPerLID. |
| constantNumPackets | [out] On exit, 0 if numPacketsPerLID has variable contents (different size for each LID). If nonzero, then it is expected that the number of packets per LID is constant, and that constantNumPackets is that value. |
| distor | [in] The Distributor object we are using. |
Implements Tpetra::DistObject< Scalar, LO, GO, Node >.
Definition at line 441 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| void Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::unpackAndCombine | ( | const Teuchos::ArrayView< const LO > & | importLIDs, |
| const Teuchos::ArrayView< const packet_type > & | imports, | ||
| const Teuchos::ArrayView< size_t > & | numPacketsPerLID, | ||
| size_t | constantNumPackets, | ||
| Tpetra::Distributor & | distor, | ||
| Tpetra::CombineMode | CM | ||
| ) | [protected, virtual] |
Perform any unpacking and combining after communication.
| importLIDs | [in] List of the entries (as LIDs in the destination object) we received from other images. |
| imports | [in] Buffer containing data we received. |
| numPacketsPerLID | [in] If constantNumPackets is zero, then numPacketsPerLID[i] contains the number of packets imported for importLIDs[i]. |
| constantNumPackets | [in] If nonzero, then numPacketsPerLID is constant (same value in all entries) and constantNumPackets is that value. If zero, then numPacketsPerLID[i] is the number of packets imported for importLIDs[i]. |
| distor | [in] The Distributor object we are using. |
| CM | [in] The combine mode to use when combining the imported entries with existing entries. |
Implements Tpetra::DistObject< Scalar, LO, GO, Node >.
Definition at line 495 of file Tpetra_Experimental_BlockMultiVector_def.hpp.
| Scalar* Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::getRawPtr | ( | ) | const [inline, protected] |
Raw pointer to the MultiVector's data.
Definition at line 452 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| size_t Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::getStrideX | ( | ) | const [inline, protected] |
Stride between consecutive local entries in the same column.
Definition at line 457 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| size_t Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::getStrideY | ( | ) | const [inline, protected] |
Stride between consecutive local entries in the same row.
Definition at line 462 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| bool Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::isValidLocalMeshIndex | ( | const LO | meshLocalIndex | ) | const [inline, protected] |
True if and only if meshLocalIndex is a valid local index in the mesh Map.
Definition at line 468 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
| void Tpetra::DistObject< Scalar , LO , GO , Node >::doImport | ( | const SrcDistObject< Scalar, LO, GO, Node > & | source, |
| const Import< LO , GO , Node > & | importer, | ||
| CombineMode | CM | ||
| ) | [inherited] |
Import data into this object using an Import object ("forward mode").
The input DistObject is always the source of the data redistribution operation, and the *this object is always the target.
If you don't know the difference between forward and reverse mode, then you probably want forward mode. Use this method with your precomputed Import object if you want to do an Import, else use doExport() with a precomputed Export object.
| source | [in] The "source" object for redistribution. |
| importer | [in] Precomputed data redistribution plan. Its source Map must be the same as the input DistObject's Map, and its target Map must be the same as this->getMap(). |
| CM | [in] How to combine incoming data with the same global index. |
| void Tpetra::DistObject< Scalar , LO , GO , Node >::doImport | ( | const SrcDistObject< Scalar, LO, GO, Node > & | source, |
| const Export< LO , GO , Node > & | exporter, | ||
| CombineMode | CM | ||
| ) | [inherited] |
Import data into this object using an Export object ("reverse mode").
The input DistObject is always the source of the data redistribution operation, and the *this object is always the target.
If you don't know the difference between forward and reverse mode, then you probably want forward mode. Use the version of doImport() that takes a precomputed Import object in that case.
| source | [in] The "source" object for redistribution. |
| exporter | [in] Precomputed data redistribution plan. Its target Map must be the same as the input DistObject's Map, and its source Map must be the same as this->getMap(). (Note the difference from forward mode.) |
| CM | [in] How to combine incoming data with the same global index. |
| void Tpetra::DistObject< Scalar , LO , GO , Node >::doExport | ( | const SrcDistObject< Scalar, LO, GO, Node > & | source, |
| const Export< LO , GO , Node > & | exporter, | ||
| CombineMode | CM | ||
| ) | [inherited] |
Export data into this object using an Export object ("forward mode").
The input DistObject is always the source of the data redistribution operation, and the *this object is always the target.
If you don't know the difference between forward and reverse mode, then you probably want forward mode. Use this method with your precomputed Export object if you want to do an Export, else use doImport() with a precomputed Import object.
| source | [in] The "source" object for redistribution. |
| exporter | [in] Precomputed data redistribution plan. Its source Map must be the same as the input DistObject's Map, and its target Map must be the same as this->getMap(). |
| CM | [in] How to combine incoming data with the same global index. |
| void Tpetra::DistObject< Scalar , LO , GO , Node >::doExport | ( | const SrcDistObject< Scalar, LO, GO, Node > & | source, |
| const Import< LO , GO , Node > & | importer, | ||
| CombineMode | CM | ||
| ) | [inherited] |
Export data into this object using an Import object ("reverse mode").
The input DistObject is always the source of the data redistribution operation, and the *this object is always the target.
If you don't know the difference between forward and reverse mode, then you probably want forward mode. Use the version of doExport() that takes a precomputed Export object in that case.
| source | [in] The "source" object for redistribution. |
| importer | [in] Precomputed data redistribution plan. Its target Map must be the same as the input DistObject's Map, and its source Map must be the same as this->getMap(). (Note the difference from forward mode.) |
| CM | [in] How to combine incoming data with the same global index. |
| bool Tpetra::DistObject< Scalar , LO , GO , Node >::isDistributed | ( | ) | const [inherited] |
Whether this is a globally distributed object.
For a definition of "globally distributed" (and its opposite, "locally replicated"), see the documentation of Map's isDistributed() method.
| virtual Teuchos::RCP<const Map<LO ,GO ,Node> > Tpetra::DistObject< Scalar , LO , GO , Node >::getMap | ( | ) | const [inline, virtual, inherited] |
The Map describing the parallel distribution of this object.
Note that some Tpetra objects might be distributed using multiple Map objects. For example, CrsMatrix has both a row Map and a column Map. It is up to the subclass to decide which Map to use when invoking the DistObject constructor.
Definition at line 316 of file Tpetra_DistObject_decl.hpp.
| void Tpetra::DistObject< Scalar , LO , GO , Node >::print | ( | std::ostream & | os | ) | const [inherited] |
Print this object to the given output stream.
We generally assume that all MPI processes can print to the given stream.
| virtual std::string Tpetra::DistObject< Scalar , LO , GO , Node >::description | ( | ) | const [virtual, inherited] |
One-line descriptiion of this object.
We declare this method virtual so that subclasses of DistObject may override it.
| virtual void Tpetra::DistObject< Scalar , LO , GO , Node >::describe | ( | Teuchos::FancyOStream & | out, |
| const Teuchos::EVerbosityLevel | verbLevel = Teuchos::Describable::verbLevel_default |
||
| ) | const [virtual, inherited] |
Print a descriptiion of this object to the given output stream.
We declare this method virtual so that subclasses of Distobject may override it.
| virtual void Tpetra::DistObject< Scalar , LO , GO , Node >::removeEmptyProcessesInPlace | ( | const Teuchos::RCP< const Map< LO , GO , Node > > & | newMap | ) | [virtual, inherited] |
Remove processes which contain no elements in this object's Map.
On input, this object is distributed over the Map returned by getMap() (the "original Map," with its communicator, the "original communicator"). The input newMap of this method must be the same as the result of calling getMap()->removeEmptyProcesses(). On processes in the original communicator which contain zero elements ("excluded processes," as opposed to "included processes"), the input newMap must be Teuchos::null (which is what getMap()->removeEmptyProcesses() returns anyway).
On included processes, reassign this object's Map (that would be returned by getMap()) to the input newMap, and do any work that needs to be done to restore correct semantics. On excluded processes, free any data that needs freeing, and do any other work that needs to be done to restore correct semantics.
This method has collective semantics over the original communicator. On exit, the only method of this object which is safe to call on excluded processes is the destructor. This implies that subclasses' destructors must not contain communication operations.
| virtual size_t Tpetra::DistObject< Scalar , LO , GO , Node >::constantNumberOfPackets | ( | ) | const [protected, virtual, inherited] |
Whether the implementation's instance promises always to have a constant number of packets per LID, and if so, how many packets per LID there are.
If this method returns zero, the instance says that it might possibly have a different number of packets for each LID to send or receive. If it returns nonzero, the instance promises that the number of packets is the same for all LIDs, and that the return value is this number of packets per LID.
The default implementation of this method returns zero. This does not affect the behavior of doTransfer() in any way. If a nondefault implementation returns nonzero, doTransfer() will use this information to avoid unnecessary allocation and / or resizing of arrays.
| virtual void Tpetra::DistObject< Scalar , LO , GO , Node >::doTransfer | ( | const SrcDistObject< Scalar, LO, GO, Node > & | src, |
| CombineMode | CM, | ||
| size_t | numSameIDs, | ||
| const Teuchos::ArrayView< const LO > & | permuteToLIDs, | ||
| const Teuchos::ArrayView< const LO > & | permuteFromLIDs, | ||
| const Teuchos::ArrayView< const LO > & | remoteLIDs, | ||
| const Teuchos::ArrayView< const LO > & | exportLIDs, | ||
| Distributor & | distor, | ||
| ReverseOption | revOp | ||
| ) | [protected, virtual, inherited] |
Redistribute data across memory images.
| src | [in] The source object, to redistribute into the target object, which is *this object. |
| CM | [in] The combine mode that describes how to combine values that map to the same global ID on the same process. |
| permuteToLIDs | [in] See copyAndPermute(). |
| permuteFromLIDs | [in] See copyAndPermute(). |
| remoteLIDs | [in] List of entries (as local IDs) in the destination object to receive from other processes. |
| exportLIDs | [in] See packAndPrepare(). |
| distor | [in/out] The Distributor object that knows how to redistribute data. |
| revOp | [in] Whether to do a forward or reverse mode redistribution. |
| virtual void Tpetra::DistObject< Scalar , LO , GO , Node >::createViews | ( | ) | const [protected, virtual, inherited] |
Hook for creating a const view.
doTransfer() calls this on the source object. By default, it does nothing, but the source object can use this as a hint to fetch data from a compute buffer on an off-CPU device (such as a GPU) into host memory.
| virtual void Tpetra::DistObject< Scalar , LO , GO , Node >::createViewsNonConst | ( | KokkosClassic::ReadWriteOption | rwo | ) | [protected, virtual, inherited] |
Hook for creating a nonconst view.
doTransfer() calls this on the destination (*this) object. By default, it does nothing, but the destination object can use this as a hint to fetch data from a compute buffer on an off-CPU device (such as a GPU) into host memory.
| rwo | [in] Whether to create a write-only or a read-and-write view. For Kokkos Node types where compute buffers live in a separate memory space (e.g., in the device memory of a discrete accelerator like a GPU), a write-only view only requires copying from host memory to the compute buffer, whereas a read-and-write view requires copying both ways (once to read, from the compute buffer to host memory, and once to write, back to the compute buffer). |
| virtual void Tpetra::DistObject< Scalar , LO , GO , Node >::releaseViews | ( | ) | const [protected, virtual, inherited] |
Hook for releasing views.
doTransfer() calls this on both the source and destination objects, once it no longer needs to access that object's data. By default, this method does nothing. Implementations may use this as a hint to free host memory which is a view of a compute buffer, once the host memory view is no longer needed. Some implementations may prefer to mirror compute buffers in host memory; for these implementations, releaseViews() may do nothing.
mv_type Tpetra::Experimental::BlockMultiVector< Scalar, LO, GO, Node >::mv_ [protected] |
The Tpetra::MultiVector used to represent the data.
Definition at line 490 of file Tpetra_Experimental_BlockMultiVector_decl.hpp.
Teuchos::RCP<const Map<LO ,GO ,Node> > Tpetra::DistObject< Scalar , LO , GO , Node >::map_ [protected, inherited] |
The Map over which this object is distributed.
Definition at line 611 of file Tpetra_DistObject_decl.hpp.
Teuchos::Array<Scalar > Tpetra::DistObject< Scalar , LO , GO , Node >::imports_ [protected, inherited] |
Buffer into which packed data are imported (received from other processes).
Definition at line 615 of file Tpetra_DistObject_decl.hpp.
Teuchos::Array<size_t> Tpetra::DistObject< Scalar , LO , GO , Node >::numImportPacketsPerLID_ [protected, inherited] |
Number of packets to receive for each receive operation.
This array is used in Distributor::doPosts() (and doReversePosts()) when starting the ireceive operation.
This may be ignored in doTransfer() if constantNumPackets is nonzero, indicating a constant number of packets per LID. (For example, MultiVector sets the constantNumPackets output argument of packAndPrepare() to the number of columns in the multivector.)
Definition at line 627 of file Tpetra_DistObject_decl.hpp.
Teuchos::Array<Scalar > Tpetra::DistObject< Scalar , LO , GO , Node >::exports_ [protected, inherited] |
Buffer from which packed data are exported (sent to other processes).
Definition at line 630 of file Tpetra_DistObject_decl.hpp.
Teuchos::Array<size_t> Tpetra::DistObject< Scalar , LO , GO , Node >::numExportPacketsPerLID_ [protected, inherited] |
Number of packets to send for each send operation.
This array is used in Distributor::doPosts() (and doReversePosts()) for preparing for the send operation.
This may be ignored in doTransfer() if constantNumPackets is nonzero, indicating a constant number of packets per LID. (For example, MultiVector sets the constantNumPackets output argument of packAndPrepare() to the number of columns in the multivector.)
Definition at line 642 of file Tpetra_DistObject_decl.hpp.
1.7.6.1