8 #include "CheckpointEntryDataStore.hpp" 9 #include "structures/Buffer.hpp" 10 #include "utils/BufferUtilsMPI.hpp" 11 #include "utils/BufferUtilsPvp.hpp" 12 #include "utils/PVAssert.hpp" 19 void CheckpointEntryDataStore::read(std::string
const &checkpointDirectory,
double *simTimePtr)
21 CheckpointEntryPvp::read(checkpointDirectory, simTimePtr);
22 for (
int bufferId = 0; bufferId < mDataStore->getNumBuffers(); bufferId++) {
23 for (
int levelId = 0; levelId < mDataStore->getNumLevels(); levelId++) {
24 mDataStore->markActiveIndicesOutOfSync(bufferId, levelId);
29 int CheckpointEntryDataStore::getNumFrames()
const {
30 int const numBuffers = getDataStore()->getNumBuffers();
31 int const numLevels = getDataStore()->getNumLevels();
34 return numLevels * numBuffers * mpiBatchDim;
37 float *CheckpointEntryDataStore::calcBatchElementStart(
int frame)
const {
38 int const numBuffers = getDataStore()->getNumBuffers();
39 int const numLevels = getDataStore()->getNumLevels();
40 int const level = frame % numLevels;
41 int const buffer = (frame / numLevels) % numBuffers;
42 return getDataStore()->buffer(buffer, level);
45 int CheckpointEntryDataStore::calcMPIBatchIndex(
int frame)
const {
46 return frame / (getDataStore()->getNumLevels() * getDataStore()->getNumBuffers());
49 void CheckpointEntryDataStore::setLastUpdateTimes(std::vector<double>
const ×tamps)
const {
50 int const numBuffers = getDataStore()->getNumBuffers();
51 int const numLevels = getDataStore()->getNumLevels();
53 double const *updateTimesBatchElement = ×tamps[numBuffers * numLevels * mpiBatchIndex];
54 for (
int b = 0; b < numBuffers; b++) {
55 for (
int l = 0; l < numLevels; l++) {
56 getDataStore()->setLastUpdateTime(b, l, updateTimesBatchElement[b * numLevels + l]);
int getBatchDimension() const
int getBatchIndex() const