Thyra::DefaultSpmdVectorSpace< Scalar > Class Template Reference
[Efficient Generic SPMD Concrete Thyra Operator/Vector Subclass Implementations]

Concrete implementation of an SPMD vector space subclass which creates DefaultSpmdVector and DefaultSpmdMultiVector objects. More...

#include <Thyra_DefaultSpmdVectorSpaceDecl.hpp>

Inheritance diagram for Thyra::DefaultSpmdVectorSpace< Scalar >:

[legend]
List of all members.

Constructors and initializers

 DefaultSpmdVectorSpace ()
 Construct to uninitialized (see postconditions from uninitialize()).
 DefaultSpmdVectorSpace (const Index dim)
 Calls initialize() to construct a serial space.
 DefaultSpmdVectorSpace (const Teuchos::RefCountPtr< const Teuchos::Comm< Index > > &comm, const Index localSubDim, const Index globalDim)
 Calls initialize() to construct an SPMD space.
void initialize (const Index dim)
 Initialize a serial space.
void initialize (const Teuchos::RefCountPtr< const Teuchos::Comm< Index > > &comm, const Index localSubDim, const Index globalDim)
 Initialize an SPMD space.
void uninitialize ()
 Set to an uninitialized state.

Overridden form Teuchos::Describable

std::string description () const
 

Public overridden from VectorSpaceBase

bool hasInCoreView (const Range1D &rng, const EViewType viewType, const EStrideType strideType) const
 Returns true if all the elements in rng are in this process.
Teuchos::RefCountPtr< const
VectorSpaceBase< Scalar > > 
clone () const
 

Public overridden from SpmdVectorSpaceDefaultBase

Teuchos::RefCountPtr< const
Teuchos::Comm< Index > > 
getComm () const
 
Index localSubDim () const
 

Protected overridden from VectorSpaceBase

Teuchos::RefCountPtr< VectorBase<
Scalar > > 
createMember () const
 
Teuchos::RefCountPtr< MultiVectorBase<
Scalar > > 
createMembers (int numMembers) const
 
Teuchos::RefCountPtr< VectorBase<
Scalar > > 
createMemberView (const RTOpPack::SubVectorView< Scalar > &raw_v) const
 
Teuchos::RefCountPtr< const
VectorBase< Scalar > > 
createMemberView (const RTOpPack::ConstSubVectorView< Scalar > &raw_v) const
 
Teuchos::RefCountPtr< MultiVectorBase<
Scalar > > 
createMembersView (const RTOpPack::SubMultiVectorView< Scalar > &raw_mv) const
 
Teuchos::RefCountPtr< const
MultiVectorBase< Scalar > > 
createMembersView (const RTOpPack::ConstSubMultiVectorView< Scalar > &raw_mv) const
 

Detailed Description

template<class Scalar>
class Thyra::DefaultSpmdVectorSpace< Scalar >

Concrete implementation of an SPMD vector space subclass which creates DefaultSpmdVector and DefaultSpmdMultiVector objects.

This is a simple but yet fully general and functional concrete subclass of SpmdVectorSpaceBase that returns DefaultSpmdMultiVector objects from createMembers() and DefaultSpmdVector objects from createMember().

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

Examples:

test_composite_linear_ops.cpp, test_product_space.cpp, test_scalar_product.cpp, and test_std_ops.cpp.

Definition at line 52 of file Thyra_DefaultSpmdVectorSpaceDecl.hpp.


Constructor & Destructor Documentation

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

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

Definition at line 40 of file Thyra_DefaultSpmdVectorSpace.hpp.

template<class Scalar>
Thyra::DefaultSpmdVectorSpace< Scalar >::DefaultSpmdVectorSpace const Index  dim  ) 
 

Calls initialize() to construct a serial space.

Definition at line 47 of file Thyra_DefaultSpmdVectorSpace.hpp.

template<class Scalar>
Thyra::DefaultSpmdVectorSpace< Scalar >::DefaultSpmdVectorSpace const Teuchos::RefCountPtr< const Teuchos::Comm< Index > > &  comm,
const Index  localSubDim,
const Index  globalDim
 

Calls initialize() to construct an SPMD space.

Definition at line 56 of file Thyra_DefaultSpmdVectorSpace.hpp.


Member Function Documentation

template<class Scalar>
void Thyra::DefaultSpmdVectorSpace< Scalar >::initialize const Index  dim  ) 
 

Initialize a serial space.

Parameters:
dim [in] Gives the dimension of the vector space.
Equivalent to calling this->initialize(Teuchos::null,dim,dim)

Definition at line 66 of file Thyra_DefaultSpmdVectorSpace.hpp.

template<class Scalar>
void Thyra::DefaultSpmdVectorSpace< Scalar >::initialize const Teuchos::RefCountPtr< const Teuchos::Comm< Index > > &  comm,
const Index  localSubDim,
const Index  globalDim
 

Initialize an SPMD space.

Parameters:
comm [in] The communicator. This object must be maintained by the client the entire time that this is in use.
localSubDim [in] The number of elements in the local process. This number can be different in every process.
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. Spmd_Allreduce()).
Preconditions:
  • localSubDim > 0
  • globalDim != 0
  • [comm.get() != NULL && globalDim > 0] globalDim >= localSubDim

Postconditions:

  • this->getComm().get() == comm.get()
  • this->localSubDim() == localSubDim
  • [comm.get() == NULL] this->dim() == localSubDim
  • [comm.get() != NULL && globalDim > 0] this->dim() == globalDim
  • [comm.get() != NULL && globalDim < 0] this->dim() == sum(localSubDim[i],i=0...numProc-1)

This function supports three different types of use-cases:

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

Definition at line 74 of file Thyra_DefaultSpmdVectorSpace.hpp.

template<class Scalar>
void Thyra::DefaultSpmdVectorSpace< Scalar >::uninitialize  ) 
 

Set to an uninitialized state.

Postconditions:

Definition at line 97 of file Thyra_DefaultSpmdVectorSpace.hpp.

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

Reimplemented from Teuchos::Describable.

Definition at line 106 of file Thyra_DefaultSpmdVectorSpace.hpp.

template<class Scalar>
bool Thyra::DefaultSpmdVectorSpace< Scalar >::hasInCoreView const Range1D rng,
const EViewType  viewType,
const EStrideType  strideType
const [virtual]
 

Returns true if all the elements in rng are in this process.

Reimplemented from Thyra::VectorSpaceBase< Scalar >.

Definition at line 216 of file Thyra_DefaultSpmdVectorSpace.hpp.

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

Reimplemented from Thyra::VectorSpaceBase< Scalar >.

Definition at line 227 of file Thyra_DefaultSpmdVectorSpace.hpp.

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

Implements Thyra::VectorSpaceBase< Scalar >.

Definition at line 116 of file Thyra_DefaultSpmdVectorSpace.hpp.

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

Implements Thyra::VectorSpaceBase< Scalar >.

Definition at line 133 of file Thyra_DefaultSpmdVectorSpace.hpp.

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

Implements Thyra::VectorSpaceBase< Scalar >.

Definition at line 147 of file Thyra_DefaultSpmdVectorSpace.hpp.

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

Implements Thyra::VectorSpaceBase< Scalar >.

Definition at line 165 of file Thyra_DefaultSpmdVectorSpace.hpp.

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

Implements Thyra::VectorSpaceBase< Scalar >.

Definition at line 183 of file Thyra_DefaultSpmdVectorSpace.hpp.

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

Implements Thyra::VectorSpaceBase< Scalar >.

Definition at line 200 of file Thyra_DefaultSpmdVectorSpace.hpp.

template<class Scalar>
Teuchos::RefCountPtr< const Teuchos::Comm< Index > > Thyra::DefaultSpmdVectorSpace< Scalar >::getComm  )  const [virtual]
 

Implements Thyra::SpmdVectorSpaceBase< Scalar >.

Definition at line 238 of file Thyra_DefaultSpmdVectorSpace.hpp.

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

Implements Thyra::SpmdVectorSpaceBase< Scalar >.

Definition at line 244 of file Thyra_DefaultSpmdVectorSpace.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:32:34 2008 for Thyra Operator/Vector Support by doxygen 1.3.9.1