Thyra Package Browser (Single Doxygen Collection) Version of the Day
Private Attributes
Thyra::DefaultSpmdMultiVectorFileIO< Scalar > Class Template Reference

Concrete implementation of MultiVectorFileIO that reads and writes SPMD-based (multi)vectors to and from files. More...

#include <Thyra_DefaultSpmdMultiVectorFileIO.hpp>

Inheritance diagram for Thyra::DefaultSpmdMultiVectorFileIO< Scalar >:
Inheritance graph
[legend]

List of all members.

Private Attributes

std::string localFileNameExtension_
bool useBinaryMode_
SpmdMultiVectorSerializer< Scalar > mvSerializer_

Constructors/initializers/accessors

 DefaultSpmdMultiVectorFileIO (const std::string &extensionTagName="", const int numProcs=-1, const int procRank=-1)
 Construct with file extension information (calls setFileNameExtension()).
void setFileNameExtension (const std::string &extensionTagName="", const int numProcs=-1, const int procRank=-1)
 Set file name extension information to disambiguate files on different processes and from other files.
std::string getLocalFileName (const std::string &fileNameBase) const

Overridden from MultiVectorFileIOBase

bool isCompatible (const MultiVectorBase< Scalar > &mv) const
 
void readMultiVectorFromFile (const std::string &fileNameBase, Thyra::MultiVectorBase< Scalar > *mv) const
 
void writeMultiVectorToFile (const Thyra::MultiVectorBase< Scalar > &mv, const std::string &fileNameBase) const
 

Detailed Description

template<class Scalar>
class Thyra::DefaultSpmdMultiVectorFileIO< Scalar >

Concrete implementation of MultiVectorFileIO that reads and writes SPMD-based (multi)vectors to and from files.

The file accessed by each process process is fileNameBase.extentionTagName.numProcs.procRank. If extentionTagName=="" then the file with the name fileNameBase.numProcs.procRank is accessed in each process. By setting up different file name extension information (see setFileNameExtension()), the client can carefully control how file base names are mapped into actual sets of files.

ToDo: This implementation will have to be refactored once I refactor how SPMD-based vectors and multi-vectors can be accessed in a general way.

Definition at line 54 of file Thyra_DefaultSpmdMultiVectorFileIO.hpp.


Constructor & Destructor Documentation

template<class Scalar >
Thyra::DefaultSpmdMultiVectorFileIO< Scalar >::DefaultSpmdMultiVectorFileIO ( const std::string &  extensionTagName = "",
const int  numProcs = -1,
const int  procRank = -1 
)

Construct with file extension information (calls setFileNameExtension()).

Definition at line 127 of file Thyra_DefaultSpmdMultiVectorFileIO.hpp.

References Thyra::DefaultSpmdMultiVectorFileIO< Scalar >::setFileNameExtension().


Member Function Documentation

template<class Scalar >
void Thyra::DefaultSpmdMultiVectorFileIO< Scalar >::setFileNameExtension ( const std::string &  extensionTagName = "",
const int  numProcs = -1,
const int  procRank = -1 
)

Set file name extension information to disambiguate files on different processes and from other files.

Parameters:
extensionTagName[in] An extension name string that will be appended the beginning of full file extension. Default is "".
numProcs[in] The total number of processes in the communicator. Default value is -1.
procRank[in] The rank of this process. Default value is -1.

If numProcs < 0 then procRank and numProcs will be determined from Teuchos::GlobalMPISession.

Definition at line 139 of file Thyra_DefaultSpmdMultiVectorFileIO.hpp.

Referenced by Thyra::DefaultSpmdMultiVectorFileIO< Scalar >::DefaultSpmdMultiVectorFileIO().

template<class Scalar >
std::string Thyra::DefaultSpmdMultiVectorFileIO< Scalar >::getLocalFileName ( const std::string &  fileNameBase) const

brief Return the file name that is used in this process.

Definition at line 155 of file Thyra_DefaultSpmdMultiVectorFileIO.hpp.

template<class Scalar >
bool Thyra::DefaultSpmdMultiVectorFileIO< Scalar >::isCompatible ( const MultiVectorBase< Scalar > &  mv) const [virtual]
template<class Scalar >
void Thyra::DefaultSpmdMultiVectorFileIO< Scalar >::readMultiVectorFromFile ( const std::string &  fileNameBase,
Thyra::MultiVectorBase< Scalar > *  mv 
) const [virtual]
template<class Scalar >
void Thyra::DefaultSpmdMultiVectorFileIO< Scalar >::writeMultiVectorToFile ( const Thyra::MultiVectorBase< Scalar > &  mv,
const std::string &  fileNameBase 
) const [virtual]

Member Data Documentation

template<class Scalar >
std::string Thyra::DefaultSpmdMultiVectorFileIO< Scalar >::localFileNameExtension_ [private]

Definition at line 116 of file Thyra_DefaultSpmdMultiVectorFileIO.hpp.

template<class Scalar >
bool Thyra::DefaultSpmdMultiVectorFileIO< Scalar >::useBinaryMode_ [private]

Definition at line 117 of file Thyra_DefaultSpmdMultiVectorFileIO.hpp.

template<class Scalar >
SpmdMultiVectorSerializer<Scalar> Thyra::DefaultSpmdMultiVectorFileIO< Scalar >::mvSerializer_ [mutable, private]

Definition at line 119 of file Thyra_DefaultSpmdMultiVectorFileIO.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines