Chaste Release::3.1
ProcessSpecificArchive< Archive > Class Template Reference

#include <ProcessSpecificArchive.hpp>

Collaboration diagram for ProcessSpecificArchive< Archive >:

List of all members.

Static Public Member Functions

static Archive * Get (void)
static void Set (Archive *pArchive)

Private Member Functions

template<>
boost::archive::text_oarchive * mpArchive
template<>
boost::archive::text_iarchive * mpArchive

Static Private Attributes

static Archive * mpArchive

Detailed Description

template<class Archive>
class ProcessSpecificArchive< Archive >

When checkpointing a parallel simulation, there are two kinds of data that need to be saved: replicated (same for every process) and distributed (different on each process). We wish to write these to separate locations, so that the replicated data is only written to disk once, and to make it easier to re-load on a different number of processes (in which case the distributed data will need to be re-distributed). However, the Boost Serialization library expects to be writing to just one archive.

This class provides access to a secondary archive in which to store the distributed data. When opening an archive in a (potentially) parallel setting, using either the ArchiveOpener or CardiacSimulationArchiver, the Set method will be called to specify the archive. Classes which need to save distributed data can then use the Get method to access and write to/read from this archive.

Note that because this class stores just a pointer to the archive, whatever object owns the archive must ensure it exists for the duration of the serialization process, and call Set(NULL) prior to closing the archive for safety.

Note also that implementations of this templated class only exist for text archives, i.e. Archive = boost::archive::text_iarchive or Archive = boost::archive::text_oarchive.

Definition at line 68 of file ProcessSpecificArchive.hpp.


Member Function Documentation

template<class Archive >
static Archive* ProcessSpecificArchive< Archive >::Get ( void  ) [inline, static]

Retrieve the stored secondary archive for this process.

Definition at line 78 of file ProcessSpecificArchive.hpp.

References EXCEPTION, and ProcessSpecificArchive< Archive >::mpArchive().

template<>
boost::archive::text_iarchive * ProcessSpecificArchive< boost::archive::text_iarchive >::mpArchive ( ) [private]

The process-specific input archive

Definition at line 48 of file ProcessSpecificArchive.cpp.

template<>
boost::archive::text_oarchive * ProcessSpecificArchive< boost::archive::text_oarchive >::mpArchive ( ) [private]

The process-specific output archive

Definition at line 44 of file ProcessSpecificArchive.cpp.

Referenced by ProcessSpecificArchive< Archive >::Get(), and ProcessSpecificArchive< Archive >::Set().

template<class Archive >
static void ProcessSpecificArchive< Archive >::Set ( Archive *  pArchive) [inline, static]

Set the secondary archive for this process.

Parameters:
pArchivethe archive to use.

Definition at line 92 of file ProcessSpecificArchive.hpp.

References ProcessSpecificArchive< Archive >::mpArchive().


Member Data Documentation

template<class Archive >
Archive* ProcessSpecificArchive< Archive >::mpArchive [static, private]

The secondary archive for this process.

Definition at line 73 of file ProcessSpecificArchive.hpp.


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