![]() |
Chaste Commit::333233612e3dcc941d260418acd7b5ccdc30390e
|
#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< ELEMENT_DIM, SPACE_DIM >::load(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::LoadBoundaryConditions(), Electrodes< DIM >::save(), AbstractCardiacTissue< ELEMENT_DIM, SPACE_DIM >::save(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::SaveBoundaryConditions(), ExtendedBidomainTissue< SPACE_DIM >::SaveExtendedBidomainCells(), ExtendedBidomainTissue< SPACE_DIM >::SaveExtracellularStimulus(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::serialize(), and ProcessSpecificArchive< Archive >::Set().
|
inlinestatic |
Set the secondary archive for this process.
pArchive | the archive to use. |
Definition at line 86 of file ProcessSpecificArchive.hpp.
References ProcessSpecificArchive< Archive >::Get(), and ProcessSpecificArchive< Archive >::mpArchive.
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(), and ProcessSpecificArchive< Archive >::Set().