Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
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]

Constructors/initializers/accessors

 DefaultSpmdMultiVectorFileIO (const std::string &extensionTagName="", const int numProcs=-1, const int procRank=-1)
 Construct with file extension information (calls setFileNameExtension()). More...
 
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. More...
 
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
 

Additional Inherited Members

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 36 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 109 of file Thyra_DefaultSpmdMultiVectorFileIO.hpp.

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 121 of file Thyra_DefaultSpmdMultiVectorFileIO.hpp.

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 137 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

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