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

#include <ProcessSpecificArchive.hpp>

+ Collaboration diagram for ProcessSpecificArchive< Archive >:

Static Public Member Functions

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

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 void ProcessSpecificArchive< Archive >::Set ( Archive *  pArchive)
inlinestatic

Set the secondary archive for this process.

Parameters
pArchivethe archive to use.

Definition at line 92 of file ProcessSpecificArchive.hpp.

References ProcessSpecificArchive< Archive >::mpArchive.

Referenced by ArchiveOpener< Archive, Stream >::ArchiveOpener().

Member Data Documentation

template<class Archive >
Archive* ProcessSpecificArchive< Archive >::mpArchive
staticprivate

The secondary archive for this process.

Definition at line 73 of file ProcessSpecificArchive.hpp.

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


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