Tpetra Matrix/Vector Services  Version of the Day
Protected Attributes | List of all members
Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType > Class Template Reference

MpiPlatform specialization for Kokkos::DefaultNode::DefaultNodeType. More...

#include <Tpetra_MpiPlatform.hpp>

Inheritance diagram for Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >:
Inheritance graph
[legend]

Public Types

Typedefs
typedef Kokkos::DefaultNode::DefaultNodeType NodeType
 Kokkos Node type; the template parameter of this class. More...
 

Public Member Functions

Constructors and destructor
 MpiPlatform ()
 Default constructor: uses Kokkos default node and MPI_COMM_WORLD. More...
 
 MpiPlatform (const RCP< Kokkos::DefaultNode::DefaultNodeType > &node)
 Constructor that accepts a Kokkos Node. More...
 
 MpiPlatform (const RCP< Kokkos::DefaultNode::DefaultNodeType > &node, const RCP< const Teuchos::OpaqueWrapper< MPI_Comm > > &rawMpiComm)
 Constructor that accepts a Kokkos Node and a wrapped MPI communicator. More...
 
 MpiPlatform (const RCP< Kokkos::DefaultNode::DefaultNodeType > &node, MPI_Comm rawMpiComm)
 Constructor that accepts a Kokkos Node and a raw MPI communicator. More...
 
virtual ~MpiPlatform ()
 Destructor (virtual for memory safety of derived classes). More...
 
Methods to access the communicator and Kokkos Node.
RCP< const Comm< int > > getComm () const
 The Teuchos::Comm instance with which this object was created. More...
 
RCP< Kokkos::DefaultNode::DefaultNodeType > getNode () const
 The Kokkos Node instance for this platform to use. More...
 

Protected Attributes

RCP< Teuchos::MpiComm< int > > comm_
 Teuchos::Comm object instantiated for the platform. More...
 
RCP< Kokkos::DefaultNode::DefaultNodeType > node_
 Kokkos Node object instantiated for the platform. More...
 

Detailed Description

template<>
class Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >

MpiPlatform specialization for Kokkos::DefaultNode::DefaultNodeType.

Warning
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.
Note
In the past (up to and including the 10.8 Trilinos release), the specialization of MpiPlatform for the default Node type delayed instantiation of the default Node instance until getNode() was called. We have changed this behavior to simplify the code and make the specialization of MpiPlatform conform more closely to the generic version of MpiPlatform.

Definition at line 187 of file Tpetra_MpiPlatform.hpp.

Member Typedef Documentation

typedef Kokkos::DefaultNode::DefaultNodeType Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >::NodeType

Kokkos Node type; the template parameter of this class.

Definition at line 194 of file Tpetra_MpiPlatform.hpp.

Constructor & Destructor Documentation

Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >::MpiPlatform ( )
inline

Default constructor: uses Kokkos default node and MPI_COMM_WORLD.

The specialization of MpiPlatform for the default node type includes a default constructor. It instantiates a default Node instance using Kokkos::DefaultNode::getDefaultNode(), and uses MPI_COMM_WORLD as the communicator.

Definition at line 206 of file Tpetra_MpiPlatform.hpp.

Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >::MpiPlatform ( const RCP< Kokkos::DefaultNode::DefaultNodeType > &  node)
inlineexplicit

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.

This specialization of MpiPlatform for the default node type will instantiate a default Node if node.is_null().

Parameters
node[in/out] The Kokkos Node instance.

Definition at line 225 of file Tpetra_MpiPlatform.hpp.

Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >::MpiPlatform ( const RCP< Kokkos::DefaultNode::DefaultNodeType > &  node,
const RCP< const Teuchos::OpaqueWrapper< MPI_Comm > > &  rawMpiComm 
)
inline

Constructor that accepts a Kokkos Node and a wrapped MPI communicator.

This version of the constructor accepts an arbitrary MPI communicator. It requires that you first wrap the MPI communicator in a Teuchos::OpaqueWrapper. This is helpful if you want to "free" the communicator automatically after use.

If you just have a raw MPI_Comm and you want to be responsible for freeing it after use, use the constructor version that takes a raw MPI_Comm. Otherwise, see the documentation of Teuchos::OpaqueWrapper to learn how to wrap an MPI_Comm and how to set the wrapper to free the communicator automatically after use.

Parameters
node[in/out] The Kokkos Node instance.
rawMpiComm[in] The MPI communicator, wrapped in a Teuchos::OpaqueWrapper.

Definition at line 247 of file Tpetra_MpiPlatform.hpp.

Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >::MpiPlatform ( const RCP< Kokkos::DefaultNode::DefaultNodeType > &  node,
MPI_Comm  rawMpiComm 
)
inline

Constructor that accepts a Kokkos Node and a raw MPI communicator.

This version of constructor accepts an arbitrary "raw" (not wrapped) MPI communicator. You are responsible for freeing the MPI communicator after use, if necessary.

Parameters
node[in/out] The Kokkos Node instance.
rawMpiComm[in] The "raw" (not wrapped) MPI communicator.

Definition at line 262 of file Tpetra_MpiPlatform.hpp.

virtual Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >::~MpiPlatform ( )
inlinevirtual

Destructor (virtual for memory safety of derived classes).

Definition at line 269 of file Tpetra_MpiPlatform.hpp.

Member Function Documentation

RCP<const Comm<int> > Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >::getComm ( ) const
inline

The Teuchos::Comm instance with which this object was created.

Definition at line 276 of file Tpetra_MpiPlatform.hpp.

RCP<Kokkos::DefaultNode::DefaultNodeType> Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >::getNode ( ) const
inline

The Kokkos Node instance for this platform to use.

Definition at line 281 of file Tpetra_MpiPlatform.hpp.

Member Data Documentation

RCP<Teuchos::MpiComm<int> > Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >::comm_
protected

Teuchos::Comm object instantiated for the platform.

Definition at line 295 of file Tpetra_MpiPlatform.hpp.

RCP<Kokkos::DefaultNode::DefaultNodeType> Tpetra::MpiPlatform< Kokkos::DefaultNode::DefaultNodeType >::node_
protected

Kokkos Node object instantiated for the platform.

Definition at line 298 of file Tpetra_MpiPlatform.hpp.


The documentation for this class was generated from the following file: