Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Protected Attributes | List of all members
Tpetra::MpiPlatform< Node > Class Template Reference

Implementation of the Platform concept for MPI-based platforms. More...

#include <Tpetra_MpiPlatform.hpp>

Inherits Describable.

Public Types

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

Public Member Functions

Constructors and destructor
 MpiPlatform (const Teuchos::RCP< NodeType > &node)
 Constructor that accepts a Kokkos Node. More...
 
 MpiPlatform (int *argc, char ***argv, const Teuchos::RCP< NodeType > &)
 Constructor that accepts the same arguments as MPI_Init(), plus a Kokkos Node. More...
 
 MpiPlatform (const Teuchos::RCP< NodeType > &, const Teuchos::RCP< const Teuchos::OpaqueWrapper< MPI_Comm > > &rawMpiComm)
 Constructor that accepts a Kokkos Node and a wrapped MPI communicator. More...
 
 MpiPlatform (int *argc, char ***argv, const Teuchos::RCP< NodeType > &, const Teuchos::RCP< const Teuchos::OpaqueWrapper< MPI_Comm > > &rawMpiComm)
 Constructor that accepts the same arguments as MPI_Init(), plus a Kokkos Node and a wrapped MPI communicator. More...
 
 MpiPlatform (const Teuchos::RCP< NodeType > &node, MPI_Comm rawMpiComm)
 Constructor that accepts a Kokkos Node and a raw MPI communicator. More...
 
 MpiPlatform (int *argc, char ***argv, const Teuchos::RCP< NodeType > &, MPI_Comm rawMpiComm)
 Constructor that accepts the same arguments as MPI_Init(), plus 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.
Teuchos::RCP< const
Teuchos::Comm< int > > 
getComm () const
 The Teuchos::Comm instance with which this object was created. More...
 
Teuchos::RCP< NodeTypegetNode () const
 The default Kokkos Node instance. More...
 

Protected Attributes

Teuchos::RCP< const
Teuchos::Comm< int > > 
comm_
 Teuchos::Comm object instantiated for the platform. More...
 

Detailed Description

template<class Node>
class Tpetra::MpiPlatform< Node >

Implementation of the Platform concept for MPI-based platforms.

Warning
This class is DEPRECATED and will be REMOVED SOON. Do not use *Platform classes any more. To initialize Tpetra, include Tpetra_Core.hpp and use Tpetra::ScopeGuard, or Tpetra::initialize and Tpetra::finalize. To get Tpetra's default Comm instance, include Tpetra_Core.hpp and call Tpetra::getDefaultComm(). For the default Node type, use Tpetra::Map<>::node_type. Do not create Node instances yourself. It is OK for Node instances to be null.

Definition at line 67 of file Tpetra_MpiPlatform.hpp.

Member Typedef Documentation

template<class Node>
typedef Node Tpetra::MpiPlatform< Node >::NodeType

Kokkos Node type; the template parameter of this class.

Definition at line 73 of file Tpetra_MpiPlatform.hpp.

Constructor & Destructor Documentation

template<class Node>
Tpetra::MpiPlatform< Node >::MpiPlatform ( const Teuchos::RCP< NodeType > &  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 conversions via assignment from the Node instance to an MpiPlatform.

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

Node will be deprecated and removed in favor of Kokkos::Device, so the Node can and should always be Teuchos::null.

Definition at line 91 of file Tpetra_MpiPlatform.hpp.

template<class Node>
Tpetra::MpiPlatform< Node >::MpiPlatform ( int *  argc,
char ***  argv,
const Teuchos::RCP< NodeType > &   
)
inline

Constructor that accepts the same arguments as MPI_Init(), plus a Kokkos Node.

This version of the constructor uses MPI_COMM_WORLD as the default communicator.

Parameters
argc[in/out] First argument of MPI_Init().
argv[in/out] Second argument of MPI_Init().
node[in/out] The Kokkos Node instance.

Node will be deprecated and removed in favor of Kokkos::Device, so the Node can and should always be Teuchos::null.

Definition at line 108 of file Tpetra_MpiPlatform.hpp.

template<class Node>
Tpetra::MpiPlatform< Node >::MpiPlatform ( const Teuchos::RCP< NodeType > &  ,
const Teuchos::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.

Node will be deprecated and removed in favor of Kokkos::Device, so the Node can and should always be Teuchos::null.

Definition at line 139 of file Tpetra_MpiPlatform.hpp.

template<class Node>
Tpetra::MpiPlatform< Node >::MpiPlatform ( int *  argc,
char ***  argv,
const Teuchos::RCP< NodeType > &  ,
const Teuchos::RCP< const Teuchos::OpaqueWrapper< MPI_Comm > > &  rawMpiComm 
)
inline

Constructor that accepts the same arguments as MPI_Init(), plus 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
argc[in/out] First argument of MPI_Init().
argv[in/out] Second argument of MPI_Init().
node[in/out] The Kokkos Node instance.
rawMpiComm[in] The MPI communicator, wrapped in a Teuchos::OpaqueWrapper.

Node will be deprecated and removed in favor of Kokkos::Device, so the Node can and should always be Teuchos::null.

Definition at line 178 of file Tpetra_MpiPlatform.hpp.

template<class Node>
Tpetra::MpiPlatform< Node >::MpiPlatform ( const Teuchos::RCP< NodeType > &  node,
MPI_Comm  rawMpiComm 
)
inline

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

This version of the 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.

Node will be deprecated and removed in favor of Kokkos::Device, so the Node can and should always be Teuchos::null.

Definition at line 219 of file Tpetra_MpiPlatform.hpp.

template<class Node>
Tpetra::MpiPlatform< Node >::MpiPlatform ( int *  argc,
char ***  argv,
const Teuchos::RCP< NodeType > &  ,
MPI_Comm  rawMpiComm 
)
inline

Constructor that accepts the same arguments as MPI_Init(), plus a Kokkos Node and a raw MPI communicator.

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

Parameters
argc[in/out] First argument of MPI_Init().
argv[in/out] Second argument of MPI_Init().
node[in/out] The Kokkos Node instance.
rawMpiComm[in] The "raw" (not wrapped) MPI communicator.

Node will be deprecated and removed in favor of Kokkos::Device, so the Node can and should always be Teuchos::null.

Definition at line 239 of file Tpetra_MpiPlatform.hpp.

template<class Node>
virtual Tpetra::MpiPlatform< Node >::~MpiPlatform ( )
inlinevirtual

Destructor (virtual for memory safety of derived classes).

Definition at line 250 of file Tpetra_MpiPlatform.hpp.

Member Function Documentation

template<class Node>
Teuchos::RCP<const Teuchos::Comm<int> > Tpetra::MpiPlatform< Node >::getComm ( ) const
inline

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

Definition at line 257 of file Tpetra_MpiPlatform.hpp.

template<class Node>
Teuchos::RCP<NodeType> Tpetra::MpiPlatform< Node >::getNode ( ) const
inline

The default Kokkos Node instance.

Node will be deprecated and removed in favor of Kokkos::Device. Thus, the Node may be Teuchos::null, and users should not depend on getNode.get().

Definition at line 270 of file Tpetra_MpiPlatform.hpp.

Member Data Documentation

template<class Node>
Teuchos::RCP<const Teuchos::Comm<int> > Tpetra::MpiPlatform< Node >::comm_
protected

Teuchos::Comm object instantiated for the platform.

Definition at line 277 of file Tpetra_MpiPlatform.hpp.


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