Chaste
Release::2017.1
|
#include <ProcessSpecificArchive.hpp>
Static Public Member Functions | |
static Archive * | Get (void) |
static void | Set (Archive *pArchive) |
Static Private Attributes | |
static Archive * | mpArchive |
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 62 of file ProcessSpecificArchive.hpp.
|
inlinestatic |
Definition at line 72 of file ProcessSpecificArchive.hpp.
References EXCEPTION, and ProcessSpecificArchive< Archive >::mpArchive.
Referenced by Electrodes< DIM >::load(), AbstractCardiacTissue< SPACE_DIM >::load(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, 2 >::LoadBoundaryConditions(), AbstractCardiacTissue< SPACE_DIM >::save(), Electrodes< DIM >::save(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, 2 >::SaveBoundaryConditions(), ExtendedBidomainTissue< DIM >::SaveExtendedBidomainCells(), ExtendedBidomainTissue< DIM >::SaveExtracellularStimulus(), and AbstractMesh< SPACE_DIM, SPACE_DIM >::serialize().
|
inlinestatic |
Set the secondary archive for this process.
pArchive | the archive to use. |
Definition at line 86 of file ProcessSpecificArchive.hpp.
Referenced by ArchiveOpener< Archive, Stream >::ArchiveOpener().
|
staticprivate |
The secondary archive for this process.
Definition at line 67 of file ProcessSpecificArchive.hpp.
Referenced by ProcessSpecificArchive< Archive >::Get().