Tpetra parallel linear algebra  Version of the Day
Protected Attributes | List of all members
Tpetra::MpiPlatform< Tpetra::Details::DefaultTypes::node_type > Class Template Reference

MpiPlatform specialization for the default Node type. More...

#include <Tpetra_MpiPlatform.hpp>

Inherits Describable.

Public Types

Typedefs
typedef Tpetra::Details::DefaultTypes::node_type 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 (int *argc, char ***argv)
 Constructor that accepts the same arguments as MPI_Init(). More...
 
 MpiPlatform (const Teuchos::RCP< NodeType > &node)
 Constructor that accepts a Kokkos Node. More...
 
 MpiPlatform (int *argc, char ***argv, const Teuchos::RCP< NodeType > &node)
 Constructor that accepts the same arguments as MPI_Init(), plus a Kokkos Node. More...
 
 MpiPlatform (const Teuchos::RCP< NodeType > &node, 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 > &node, 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 > &node, 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

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

Detailed Description

template<>
class Tpetra::MpiPlatform< Tpetra::Details::DefaultTypes::node_type >

MpiPlatform specialization for the default Node type.

Note
Tpetra::Details::DefaultTypes::node_type is a typedef, and may have a different type, depending on Trilinos' build options.

Definition at line 371 of file Tpetra_MpiPlatform.hpp.

Member Typedef Documentation

Kokkos Node type; the template parameter of this class.

Definition at line 378 of file Tpetra_MpiPlatform.hpp.

Constructor & Destructor Documentation

Default constructor: uses Kokkos default node and MPI_COMM_WORLD.

Constructor that accepts the same arguments as MPI_Init().

Parameters
argc[in/out] First argument of MPI_Init().
argv[in/out] Second argument of MPI_Init().
Tpetra::MpiPlatform< Tpetra::Details::DefaultTypes::node_type >::MpiPlatform ( const Teuchos::RCP< NodeType > &  node)
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.

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. If null, this class will create a Node with default parameters, at some time no later than during the first call to getNode().
Tpetra::MpiPlatform< Tpetra::Details::DefaultTypes::node_type >::MpiPlatform ( int *  argc,
char ***  argv,
const Teuchos::RCP< NodeType > &  node 
)

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. If null, this class will create a Node with default parameters, at some time no later than during the first call to getNode().
Tpetra::MpiPlatform< Tpetra::Details::DefaultTypes::node_type >::MpiPlatform ( const Teuchos::RCP< NodeType > &  node,
const Teuchos::RCP< const Teuchos::OpaqueWrapper< MPI_Comm > > &  rawMpiComm 
)

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. If null, this class will create a Node with default parameters, at some time no later than during the first call to getNode().
rawMpiComm[in] The MPI communicator, wrapped in a Teuchos::OpaqueWrapper.
Tpetra::MpiPlatform< Tpetra::Details::DefaultTypes::node_type >::MpiPlatform ( int *  argc,
char ***  argv,
const Teuchos::RCP< NodeType > &  node,
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.

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. If null, this class will create a Node with default parameters, at some time no later than during the first call to getNode().
rawMpiComm[in] The MPI communicator, wrapped in a Teuchos::OpaqueWrapper.
Tpetra::MpiPlatform< Tpetra::Details::DefaultTypes::node_type >::MpiPlatform ( const Teuchos::RCP< NodeType > &  node,
MPI_Comm  rawMpiComm 
)

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. If null, this class will create a Node with default parameters, at some time no later than during the first call to getNode().
rawMpiComm[in] The "raw" (not wrapped) MPI communicator.
Tpetra::MpiPlatform< Tpetra::Details::DefaultTypes::node_type >::MpiPlatform ( int *  argc,
char ***  argv,
const Teuchos::RCP< NodeType > &  node,
MPI_Comm  rawMpiComm 
)

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. If null, this class will create a Node with default parameters, at some time no later than during the first call to getNode().
rawMpiComm[in] The "raw" (not wrapped) MPI communicator.

Destructor (virtual for memory safety of derived classes).

Member Function Documentation

Teuchos::RCP<const Teuchos::Comm<int> > Tpetra::MpiPlatform< Tpetra::Details::DefaultTypes::node_type >::getComm ( ) const

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

The default Kokkos Node instance.

If a constructor was called with a nonnull Node instance, this just returns that instance. Otherwise, this method returns a Node set up with default parameters. It only initializes that Node once, no matter how many times this method is called.

Member Data Documentation

RCP<const Teuchos::Comm<int> > Tpetra::MpiPlatform< Tpetra::Details::DefaultTypes::node_type >::comm_
protected

Teuchos::Comm object instantiated for the platform.

Definition at line 538 of file Tpetra_MpiPlatform.hpp.

Kokkos Node object instantiated for the platform.

Definition at line 541 of file Tpetra_MpiPlatform.hpp.


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