Thyra::MPIVectorSpaceStd< Scalar > Class Template Reference
[Efficient Generic MPI-based SPMD Concrete Thyra Operator/Vector Subclass Implementations]

Concrete implementation of a MPI-based SPMD vector space subclass which creates MPIMultiVectorStd objects. More...

#include <Thyra_MPIVectorSpaceStdDecl.hpp>

Inheritance diagram for Thyra::MPIVectorSpaceStd< Scalar >:

[legend]
List of all members.

Constructors and initializers

 MPIVectorSpaceStd ()
 Construct to uninitialized (see postconditions from uninitialize()).
 MPIVectorSpaceStd (MPI_Comm mpiComm, const Index localSubDim, const Index globalDim)
 Calls initialize().
void initialize (MPI_Comm mpiComm, const Index localSubDim, const Index globalDim)
 Initialize.
void uninitialize (MPI_Comm *mpiComm=NULL, Index *localSubDim=NULL, Index *globalDim=NULL)
 Set to an uninitialized state.

Overridden form Teuchos::Describable

std::string description () const
 

Public overridden from VectorSpace

Teuchos::RefCountPtr< const
VectorSpaceBase< Scalar > > 
clone () const
 

Public overridden from MPIVectorSpaceBase

MPI_Comm mpiComm () const
 
Index localSubDim () const
 

Protected overridden from VectorSpace

Teuchos::RefCountPtr< VectorBase<
Scalar > > 
createMember () const
 
Teuchos::RefCountPtr< MultiVectorBase<
Scalar > > 
createMembers (int numMembers) const
 
Teuchos::RefCountPtr< VectorBase<
Scalar > > 
createMemberView (const RTOpPack::MutableSubVectorT< Scalar > &raw_v) const
 
Teuchos::RefCountPtr< const
VectorBase< Scalar > > 
createMemberView (const RTOpPack::SubVectorT< Scalar > &raw_v) const
 
Teuchos::RefCountPtr< MultiVectorBase<
Scalar > > 
createMembersView (const RTOpPack::MutableSubMultiVectorT< Scalar > &raw_mv) const
 
Teuchos::RefCountPtr< const
MultiVectorBase< Scalar > > 
createMembersView (const RTOpPack::SubMultiVectorT< Scalar > &raw_mv) const
 

Detailed Description

template<class Scalar>
class Thyra::MPIVectorSpaceStd< Scalar >

Concrete implementation of a MPI-based SPMD vector space subclass which creates MPIMultiVectorStd objects.

This is a simple but yet fully general and functional concrete subclass of MPIVectorSpace that creates MPIMultiVectorStd objects from createMembers() and VectorMultiVector wrapped MPIMulitVectorStd objects from createMember().

See the function initialize() that describes the different kinds of distributions this class can handle.

Examples:

test_composite_linear_ops.cpp.

Definition at line 50 of file Thyra_MPIVectorSpaceStdDecl.hpp.


Constructor & Destructor Documentation

template<class Scalar>
Thyra::MPIVectorSpaceStd< Scalar >::MPIVectorSpaceStd  ) 
 

Construct to uninitialized (see postconditions from uninitialize()).

Definition at line 40 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
Thyra::MPIVectorSpaceStd< Scalar >::MPIVectorSpaceStd MPI_Comm  mpiComm,
const Index  localSubDim,
const Index  globalDim
 

Calls initialize().

Definition at line 47 of file Thyra_MPIVectorSpaceStd.hpp.


Member Function Documentation

template<class Scalar>
void Thyra::MPIVectorSpaceStd< Scalar >::initialize MPI_Comm  mpiComm,
const Index  localSubDim,
const Index  globalDim
 

Initialize.

Parameters:
mpiComm [in] The MPI communicator. This object must be maintained by the client the entire time that this is in use.
localSubDim [in] The number of elements on local processor. This number can be different on every processor.
globalDim [in] Gives the number of global elements in the vector if globalDim > 0. If globalDim < 0 then the global dimension is determined by the above argument localSubDim but requires a global communication to do so (i.e. MPI_Allreduce()).
Preconditions:
  • localSubDim > 0
  • globalDim != 0
  • [mpiComm != MPI_COMM_NULL && globalDim > 0] globalDim >= localSubDim

Postconditions:

  • this->mpiComm() == mpiComm
  • this->localSubDim() == localSubDim
  • [mpiComm == MPI_COMM_NULL] this->dim() == localSubDim
  • [mpiComm != MPI_COMM_NULL && globalDim > 0] this->dim() == globalDim
  • [mpiComm != MPI_COMM_NULL && globalDim < 0] this->dim() == sum(localSubDim[i],i=0...numProc-1)

This function supports three different types of use-cases:

  • mpiComm==MPI_COMM_NULL : Serial (i.e. single process) vectors where this->dim() == localSubDim.
  • mpiComm!=MPI_COMM_NULL && globalDim < 0 : Distributed-memory vectors where this->dim() is equal to the sum of the localSubDim arguments on each processor. This will result in a call to MPI_Allreduce() inside of this function.
  • mpiComm!=MPI_COMM_NULL && globalDim > 0 : Distributed-memory vectors where this->dim() returns globalDim. This will not result in a call to MPI_Allreduce() inside this function and therefore the client had better be sure that globalDim is consistent with localSubDim on each processor.
  • mpiComm!=MPI_COMM_NULL && globalDim == localSubDim : Locally-replicated distributed-memory vectors where this->dim() == globalDim == localSubDim.

Definition at line 54 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
void Thyra::MPIVectorSpaceStd< Scalar >::uninitialize MPI_Comm *  mpiComm = NULL,
Index localSubDim = NULL,
Index globalDim = NULL
 

Set to an uninitialized state.

Postconditions:

Definition at line 77 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
std::string Thyra::MPIVectorSpaceStd< Scalar >::description  )  const [virtual]
 

Reimplemented from Teuchos::Describable.

Definition at line 90 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
Teuchos::RefCountPtr< const VectorSpaceBase< Scalar > > Thyra::MPIVectorSpaceStd< Scalar >::clone  )  const [virtual]
 

Reimplemented from Thyra::VectorSpaceBase< Scalar >.

Definition at line 192 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
Teuchos::RefCountPtr< VectorBase< Scalar > > Thyra::MPIVectorSpaceStd< Scalar >::createMember  )  const [protected, virtual]
 

Implements Thyra::VectorSpaceBase< Scalar >.

Definition at line 99 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
Teuchos::RefCountPtr< MultiVectorBase< Scalar > > Thyra::MPIVectorSpaceStd< Scalar >::createMembers int  numMembers  )  const [protected, virtual]
 

Reimplemented from Thyra::VectorSpaceDefaultBase< Scalar >.

Definition at line 112 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
Teuchos::RefCountPtr< VectorBase< Scalar > > Thyra::MPIVectorSpaceStd< Scalar >::createMemberView const RTOpPack::MutableSubVectorT< Scalar > &  raw_v  )  const [protected, virtual]
 

Reimplemented from Thyra::VectorSpaceDefaultBase< Scalar >.

Definition at line 126 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
Teuchos::RefCountPtr< const VectorBase< Scalar > > Thyra::MPIVectorSpaceStd< Scalar >::createMemberView const RTOpPack::SubVectorT< Scalar > &  raw_v  )  const [protected, virtual]
 

Reimplemented from Thyra::VectorSpaceDefaultBase< Scalar >.

Definition at line 142 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
Teuchos::RefCountPtr< MultiVectorBase< Scalar > > Thyra::MPIVectorSpaceStd< Scalar >::createMembersView const RTOpPack::MutableSubMultiVectorT< Scalar > &  raw_mv  )  const [protected, virtual]
 

Reimplemented from Thyra::VectorSpaceDefaultBase< Scalar >.

Definition at line 158 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
Teuchos::RefCountPtr< const MultiVectorBase< Scalar > > Thyra::MPIVectorSpaceStd< Scalar >::createMembersView const RTOpPack::SubMultiVectorT< Scalar > &  raw_mv  )  const [protected, virtual]
 

Reimplemented from Thyra::VectorSpaceDefaultBase< Scalar >.

Definition at line 175 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
MPI_Comm Thyra::MPIVectorSpaceStd< Scalar >::mpiComm  )  const [virtual]
 

Implements Thyra::MPIVectorSpaceBase< Scalar >.

Definition at line 200 of file Thyra_MPIVectorSpaceStd.hpp.

template<class Scalar>
Index Thyra::MPIVectorSpaceStd< Scalar >::localSubDim  )  const [virtual]
 

Implements Thyra::MPIVectorSpaceBase< Scalar >.

Definition at line 206 of file Thyra_MPIVectorSpaceStd.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:39:54 2008 for Thyra ANA Operator/VectorBase Interfaces and Related Software by doxygen 1.3.9.1