ParallelColumnDataWriter Class Reference

#include <ParallelColumnDataWriter.hpp>

Inheritance diagram for ParallelColumnDataWriter:

Inheritance graph
[legend]
Collaboration diagram for ParallelColumnDataWriter:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ParallelColumnDataWriter (const std::string &rDirectory, const std::string &rBaseName, bool cleanDirectory=true)
virtual ~ParallelColumnDataWriter ()
void PutVector (int variableID, Vec petscVector)
void PutVectorStripe (int variableId, DistributedVector::Stripe &rStripe)
void PutVariable (int variableID, double variableValue, long dimensionPosition=-1)
void EndDefineMode ()
void AdvanceAlongUnlimitedDimension ()
void Close ()

Private Attributes

bool mIsParallel
bool mAmMaster
Vec mConcentrated
VecScatter mToMaster


Detailed Description

A parallelised column data writer class.

Definition at line 41 of file ParallelColumnDataWriter.hpp.


Constructor & Destructor Documentation

ParallelColumnDataWriter::ParallelColumnDataWriter ( const std::string &  rDirectory,
const std::string &  rBaseName,
bool  cleanDirectory = true 
)

Constructor.

Parameters:
rDirectory the directory in which to write the data to file
rBaseName the name of the file in which to write the data
cleanDirectory whether to clean the directory (defaults to true)

Definition at line 33 of file ParallelColumnDataWriter.cpp.

References mAmMaster, and mIsParallel.

ParallelColumnDataWriter::~ParallelColumnDataWriter (  )  [virtual]

Destructor.

Definition at line 151 of file ParallelColumnDataWriter.cpp.

References Close(), mConcentrated, and mToMaster.


Member Function Documentation

void ParallelColumnDataWriter::PutVector ( int  variableID,
Vec  petscVector 
)

Get whether it is the master process or not.

Todo:
Where is this implemented? (#991)
Write data for a given variable from a Petsc vector to the dataset.

Parameters:
variableID the variable
petscVector the data

Definition at line 61 of file ParallelColumnDataWriter.cpp.

References mAmMaster, mConcentrated, ColumnDataWriter::mFixedDimensionSize, mToMaster, and ColumnDataWriter::PutVariable().

Referenced by PutVectorStripe().

void ParallelColumnDataWriter::PutVectorStripe ( int  variableId,
DistributedVector::Stripe rStripe 
)

Write data for a given variable from a stripe to the dataset.

Parameters:
variableId the variable
rStripe the data
Todo:
allow this to be a const-reference

Definition at line 104 of file ParallelColumnDataWriter.cpp.

References DistributedVector::Begin(), DistributedVectorFactory::CreateDistributedVector(), DistributedVectorFactory::CreateVec(), DistributedVector::End(), DistributedVector::Stripe::GetFactory(), and PutVector().

void ParallelColumnDataWriter::PutVariable ( int  variableID,
double  variableValue,
long  dimensionPosition = -1 
) [virtual]

Input the variable value to the output file or ancillary file

Parameters:
variableID 
variableValue 
dimensionPosition The position in column (defaults to -1). This is required if there is a fixed dimension, and will be the position along that dimension
There are two ways of calling PutVariable: 1) All processes call it as a collective operation from the user's code. This only makes sense if they are writing the unlimited dimension (time) variable. It is actually a no-op if any non-master process attempts to write anything at all. 2) The master calls the equivalent method in the parent class after concentrating the data into a single Vec (ie. from the method PutVector() above).

Reimplemented from ColumnDataWriter.

Definition at line 142 of file ParallelColumnDataWriter.cpp.

References mAmMaster, and ColumnDataWriter::PutVariable().

void ParallelColumnDataWriter::EndDefineMode (  )  [virtual]

End the define mode of the DataWriter.

Reimplemented from ColumnDataWriter.

Definition at line 122 of file ParallelColumnDataWriter.cpp.

References ColumnDataWriter::EndDefineMode(), mAmMaster, and ColumnDataWriter::mIsInDefineMode.

void ParallelColumnDataWriter::AdvanceAlongUnlimitedDimension (  )  [virtual]

Advance along the unlimited dimension. Normally this will be called when all variables in a row have been input.

Todo:
This is where the master is going to take messages from the slaves and write them.

Reimplemented from ColumnDataWriter.

Definition at line 161 of file ParallelColumnDataWriter.cpp.

References ColumnDataWriter::DoAdvanceAlongUnlimitedDimension(), and mAmMaster.

void ParallelColumnDataWriter::Close (  )  [virtual]

Close any open files.

Todo:
we may still have queued messages at this point - force their output.

Reimplemented from ColumnDataWriter.

Definition at line 173 of file ParallelColumnDataWriter.cpp.

References ColumnDataWriter::Close(), and mAmMaster.

Referenced by ~ParallelColumnDataWriter().


Member Data Documentation

Set to true in constructor if running in parallel

Definition at line 45 of file ParallelColumnDataWriter.hpp.

Referenced by ParallelColumnDataWriter().

Set to true in constructor for process is the rank 0 process

Definition at line 46 of file ParallelColumnDataWriter.hpp.

Referenced by AdvanceAlongUnlimitedDimension(), Close(), EndDefineMode(), ParallelColumnDataWriter(), PutVariable(), and PutVector().

Vector to hold concentrated copy of distributed vector on the master process

Definition at line 47 of file ParallelColumnDataWriter.hpp.

Referenced by PutVector(), and ~ParallelColumnDataWriter().

variable holding information for concentrating a vector

Definition at line 48 of file ParallelColumnDataWriter.hpp.

Referenced by PutVector(), and ~ParallelColumnDataWriter().


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

Generated on Tue Aug 4 16:11:37 2009 for Chaste by  doxygen 1.5.5