Public Types | Public Member Functions | Protected Attributes | Friends

LibGeoDecomp::ParallelWriter< CELL_TYPE > Class Template Reference

ParallelWriter is the parent class for all parallel IO. More...

#include <parallelwriter.h>

Inherited by LibGeoDecomp::Clonable< ParallelWriter< CELL_TYPE >, BOVWriter< CELL_TYPE > >, LibGeoDecomp::Clonable< ParallelWriter< CELL_TYPE >, CollectingWriter< CELL_TYPE > >, LibGeoDecomp::Clonable< ParallelWriter< CELL_TYPE >, HpxWriterCollector< CELL_TYPE, CONVERTER > >, LibGeoDecomp::Clonable< ParallelWriter< CELL_TYPE >, ParallelMemoryWriter< CELL_TYPE > >, LibGeoDecomp::Clonable< ParallelWriter< CELL_TYPE >, ParallelMPIIOWriter< CELL_TYPE > >, and LibGeoDecomp::Clonable< ParallelWriter< CELL_TYPE >, TracingWriter< CELL_TYPE > >.

Collaboration diagram for LibGeoDecomp::ParallelWriter< CELL_TYPE >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
APITraits::SelectTopology
< CELL_TYPE >::Value 
Topology
typedef DistributedSimulator
< CELL_TYPE >::GridType 
GridType
typedef Region< Topology::DIMRegionType
typedef Coord< Topology::DIMCoordType

Public Member Functions

 ParallelWriter (const std::string &prefix, const unsigned &period)
 is the equivalent to Writer().
virtual ~ParallelWriter ()
virtual ParallelWriterclone () const =0
 "virtual copy constructor".
virtual void setRegion (const Region< Topology::DIM > &newRegion)
 notifies the ParallelWriter that the supplied region is the domain of the current process.
virtual void stepFinished (const GridType &grid, const RegionType &validRegion, const CoordType &globalDimensions, unsigned step, WriterEvent event, std::size_t rank, bool lastCall)=0
 is called back from sim after each simulation step.
const unsignedgetPeriod () const
const std::string & getPrefix () const

Protected Attributes

Region< Topology::DIMregion
std::string prefix
unsigned period

Friends

class Serialization

Detailed Description

template<typename CELL_TYPE>
class LibGeoDecomp::ParallelWriter< CELL_TYPE >

ParallelWriter is the parent class for all parallel IO.

Its being used with ParallelSimulator, which contrasts it from Writer. Just like writer, it defines a number of callbacks which are invoked by the simulator. Also, ParallelWriter registers at the DistributedSimulator, which will delete it upon its destruction. Never allocate a ParallelWriter on the stack!

A conceptual difference from Writer should be noted: multiple ParallelWriter objects of the same type will exists, typically one per MPI process. Thus one either needs to use MPI IO or individual files per instance. For other differences see below.


Member Typedef Documentation

template<typename CELL_TYPE>
typedef Coord<Topology::DIM> LibGeoDecomp::ParallelWriter< CELL_TYPE >::CoordType
template<typename CELL_TYPE>
typedef DistributedSimulator<CELL_TYPE>::GridType LibGeoDecomp::ParallelWriter< CELL_TYPE >::GridType
template<typename CELL_TYPE>
typedef Region<Topology::DIM> LibGeoDecomp::ParallelWriter< CELL_TYPE >::RegionType
template<typename CELL_TYPE>
typedef APITraits::SelectTopology<CELL_TYPE>::Value LibGeoDecomp::ParallelWriter< CELL_TYPE >::Topology

Constructor & Destructor Documentation

template<typename CELL_TYPE>
LibGeoDecomp::ParallelWriter< CELL_TYPE >::ParallelWriter ( const std::string &  prefix,
const unsigned period 
) [inline]

is the equivalent to Writer().

template<typename CELL_TYPE>
virtual LibGeoDecomp::ParallelWriter< CELL_TYPE >::~ParallelWriter (  )  [inline, virtual]

Member Function Documentation

template<typename CELL_TYPE>
virtual ParallelWriter* LibGeoDecomp::ParallelWriter< CELL_TYPE >::clone (  )  const [pure virtual]
template<typename CELL_TYPE>
const unsigned& LibGeoDecomp::ParallelWriter< CELL_TYPE >::getPeriod (  )  const [inline]
template<typename CELL_TYPE>
const std::string& LibGeoDecomp::ParallelWriter< CELL_TYPE >::getPrefix (  )  const [inline]
template<typename CELL_TYPE>
virtual void LibGeoDecomp::ParallelWriter< CELL_TYPE >::setRegion ( const Region< Topology::DIM > &  newRegion  )  [inline, virtual]

notifies the ParallelWriter that the supplied region is the domain of the current process.

This fuction will be called once the domain decomposition has been done. Writers can use this information to decide on the size of buffers to allocate or determine file offsets. validRegion in stepFinished() will always be a subset of newRegion.

template<typename CELL_TYPE>
virtual void LibGeoDecomp::ParallelWriter< CELL_TYPE >::stepFinished ( const GridType grid,
const RegionType validRegion,
const CoordType globalDimensions,
unsigned  step,
WriterEvent  event,
std::size_t  rank,
bool  lastCall 
) [pure virtual]

is called back from sim after each simulation step.

event specifies the phase in which the simulation is currently in. This may be used for instance to open/close files at the beginning/end of the simulation. lastCall is set to true if this is the final invocation for this step -- handy if the simulator needs to call the writer multiple times for different parts of the grid (e.g. for the ghost zones and then again for the interior of the domain).


Friends And Related Function Documentation

template<typename CELL_TYPE>
friend class Serialization [friend]

Member Data Documentation

template<typename CELL_TYPE>
unsigned LibGeoDecomp::ParallelWriter< CELL_TYPE >::period [protected]
template<typename CELL_TYPE>
std::string LibGeoDecomp::ParallelWriter< CELL_TYPE >::prefix [protected]
template<typename CELL_TYPE>
Region<Topology::DIM> LibGeoDecomp::ParallelWriter< CELL_TYPE >::region [protected]

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