|
Tpetra Matrix/Vector Services
Version of the Day
|
Implementation of the Platform concept for MPI-based platforms. More...
#include <Tpetra_MpiPlatform.hpp>
Inherits Describable.
Public Types | |
| typedef Node | NodeType |
| Kokkos Node type over which the platform is templated. | |
Public Member Functions | |
Constructor/Destructor Methods | |
| MpiPlatform (const RCP< Node > &node) | |
| Constructor that accepts a Kokkos Node. | |
| MpiPlatform (const RCP< Node > &node, const RCP< const Teuchos::OpaqueWrapper< MPI_Comm > > &rawMpiComm) | |
| Constructor that accepts a Kokkos Node and MPI communicator. | |
| virtual | ~MpiPlatform () |
| Destructor (virtual for memory safety of derived classes). | |
Class Creation and Accessor Methods | |
| RCP< const Comm< int > > | getComm () const |
The Teuchos::Comm instance with which this object was created. | |
| RCP< Node > | getNode () const |
| The Kokkos Node instance with which this object was created. | |
Protected Attributes | |
| RCP< Teuchos::MpiComm< int > > | comm_ |
| Teuchos::Comm object instantiated for the platform. | |
| RCP< Node > | node_ |
| Kokkos Node object instantiated for the platform. | |
Implementation of the Platform concept for MPI-based platforms.
MpiPlatform specialization for Kokkos::DefaultNode::DefaultNodeType.
MpiPlatform is an implementation of Tpetra's Platform concept. Classes implementing Tpetra's Platform concept are templated on the Kokkos Node type. They have at least the following public interface:
template<class Node> class Platform { public: typedef Node NodeType; explicit Platform (const RCP<Node>& node); RCP<const Comm<int> > getComm() const; RCP<Node> getNode() const; };
MpiPlatform also has a constructor that accepts an MPI communicator, over which the application using the platform should perform communication. The default communicator is MPI_COMM_WORLD. MpiPlatform is only available if Trilinos was built with MPI.
Kokkos::DefaultNode::DefaultNodeType is a typedef, and may have a different type, depending on Trilinos' build options. For example, it may be Kokkos::SerialNode if Trilinos was built without a threading library, or Kokkos::TPINode if Trilinos was built with Pthreads.Definition at line 78 of file Tpetra_MpiPlatform.hpp.
| Tpetra::MpiPlatform< Node >::NodeType |
Kokkos Node type over which the platform is templated.
Definition at line 82 of file Tpetra_MpiPlatform.hpp.
| Tpetra::MpiPlatform< Node >::MpiPlatform | ( | const RCP< Node > & | node | ) | [inline, explicit] |
Constructor that accepts a Kokkos Node.
This version of the constructor uses MPI_COMM_WORLD as the communicator. It is declared "explicit" to forbid silent type conversions from the Node instance to an MpiPlatform. (A single-argument constructor that is not declared "explicit" defines a type conversion method from the input type to the constructor's class's type.) The "explicit" declaration does not affect typical use of this constructor.
| node | [in/out] The Kokkos Node instance. |
Definition at line 99 of file Tpetra_MpiPlatform.hpp.
| Tpetra::MpiPlatform< Node >::MpiPlatform | ( | const RCP< Node > & | node, |
| const RCP< const Teuchos::OpaqueWrapper< MPI_Comm > > & | rawMpiComm | ||
| ) | [inline] |
Constructor that accepts a Kokkos Node and MPI communicator.
This version of constructor accepts an arbitrary MPI communicator. You first have to wrap the MPI communicator in a Teuchos::OpaqueWrapper, for example as follows:
MPI_Comm myComm;
// ... set myComm to some MPI communicator ...
MpiPlatform<NodeType> platform (node, Teuchos::opaqueWrapper (myComm));
(The lower-case o is correct in Teuchos::opaqueWrapper. That is a templated nonmember constructor that returns a Teuchos::RCP<Teuchos::OpaqueWrapper<MPI_Comm> in this case.)
The reason you need to wrap the MPI communicator in a Teuchos::OpaqueWrapper is because that tells RCP to handle destruction in a special way. MPI_Comm isn't really an object, it's a handle to an object. RCP needs to know this so that it can do the right thing when the reference count goes to zero.
| node | [in/out] The Kokkos Node instance. |
| rawMpiComm | [in] The MPI communicator, wrapped in a Teuchos::OpaqueWrapper. |
Definition at line 129 of file Tpetra_MpiPlatform.hpp.
| virtual Tpetra::MpiPlatform< Node >::~MpiPlatform | ( | ) | [inline, virtual] |
Destructor (virtual for memory safety of derived classes).
Definition at line 136 of file Tpetra_MpiPlatform.hpp.
| RCP<const Comm<int> > Tpetra::MpiPlatform< Node >::getComm | ( | ) | const [inline] |
The Teuchos::Comm instance with which this object was created.
Definition at line 144 of file Tpetra_MpiPlatform.hpp.
| RCP<Node> Tpetra::MpiPlatform< Node >::getNode | ( | ) | const [inline] |
The Kokkos Node instance with which this object was created.
Definition at line 149 of file Tpetra_MpiPlatform.hpp.
RCP<Teuchos::MpiComm<int> > Tpetra::MpiPlatform< Node >::comm_ [protected] |
Teuchos::Comm object instantiated for the platform.
Definition at line 157 of file Tpetra_MpiPlatform.hpp.
RCP<Node> Tpetra::MpiPlatform< Node >::node_ [protected] |
Kokkos Node object instantiated for the platform.
Definition at line 160 of file Tpetra_MpiPlatform.hpp.
1.7.6.1