openPMD-api
 
Loading...
Searching...
No Matches
openPMD::internal::SeriesData Class Referencefinal

Data members for Series. More...

#include <Series.hpp>

Inheritance diagram for openPMD::internal::SeriesData:
openPMD::internal::AttributableData

Classes

struct  NoSourceSpecified
 
struct  RankTableData
 
struct  SourceSpecifiedManually
 
struct  SourceSpecifiedViaJSON
 

Public Types

using IterationIndex_t = Iteration::IterationIndex_t
 
using IterationsContainer_t = Container<Iteration, IterationIndex_t>
 

Public Member Functions

 SeriesData (SeriesData const &)=delete
 
 SeriesData (SeriesData &&)=delete
 
SeriesDataoperator= (SeriesData const &)=delete
 
SeriesDataoperator= (SeriesData &&)=delete
 
void close ()
 
- Public Member Functions inherited from openPMD::internal::AttributableData
 AttributableData (SharedAttributableData *)
 
 AttributableData (AttributableData const &)=delete
 
 AttributableData (AttributableData &&)=delete
 
AttributableDataoperator= (AttributableData const &)=delete
 
AttributableDataoperator= (AttributableData &&)=delete
 
void cloneFrom (AttributableData const &other)
 
template<typename T>
T asInternalCopyOf ()
 
auto attributes () -> A_MAP &
 
auto attributes () const -> A_MAP const &
 
auto readAttribute (std::string const &name) const -> Attribute const &
 

Public Attributes

IterationsContainer_t iterations {}
 
std::unique_ptr< StatefulIteratorm_sharedStatefulIterator
 Series::readIterations() returns an iterator type that modifies the state of the Series (by proceeding through IO steps).
 
std::set< IterationIndex_t > m_currentlyActiveIterations
 For writing: Remember which iterations have been written in the currently active output step.
 
std::unordered_map< IterationIndex_t, size_t > m_snapshotToStep
 For reading: In which IO step do I need to look for an Iteration?
 
std::unordered_map< IterationIndex_t, std::string > m_iterationFilenames
 This map contains the filenames of those Iterations which were found on the file system upon opening the Series for reading in file-based encoding.
 
std::optional< std::string > m_overrideFilebasedFilename
 Needed if reading a single iteration of a file-based series.
 
std::string m_name
 Name of the iteration without filename suffix.
 
std::string m_filenamePrefix
 Filename leading up to the expansion pattern.
 
std::string m_filenamePostfix
 Filename after the expansion pattern without filename extension.
 
std::string m_filenameExtension
 Filename extension as specified by the user.
 
int m_filenamePadding = -1
 The padding in file-based iteration encoding.
 
IterationEncoding m_iterationEncoding {}
 The iteration encoding used in this series.
 
default_or_explicit m_iterationEncodingSetExplicitly
 
Format m_format
 Detected IO format (backend).
 
StepStatus m_stepStatus = StepStatus::NoStep
 Whether a step is currently active for this iteration.
 
bool m_parseLazily = false
 True if a user opts into lazy parsing.
 
uint64_t m_hintLazyParsingAfterTimeout = 20
 
bool m_wroteAtLeastOneIOStep = false
 In variable-based encoding, all backends except ADIOS2 can only write one single iteration.
 
std::optional< ParsePreference > m_parsePreference
 Remember the preference that the backend specified for parsing.
 
std::optional< std::function< AbstractIOHandler *(Series &)> > m_deferred_initialization = std::nullopt
 
std::optional< MPI_Comm > m_communicator
 
RankTableData m_rankTable
 

Detailed Description

Data members for Series.

Pinned at one memory location.

(Not movable or copyable)

Class is final since our std::shared_ptr<Data_t> pattern has the little disadvantage that child constructors overwrite the parent constructors. Since the SeriesData constructor does some initialization, making this class final avoids stumbling over this pitfall.

Member Data Documentation

◆ m_currentlyActiveIterations

std::set<IterationIndex_t> openPMD::internal::SeriesData::m_currentlyActiveIterations

For writing: Remember which iterations have been written in the currently active output step.

Use this later when writing the snapshot attribute.

◆ m_filenameExtension

std::string openPMD::internal::SeriesData::m_filenameExtension

Filename extension as specified by the user.

(Not necessarily the backend's default suffix)

◆ m_filenamePadding

int openPMD::internal::SeriesData::m_filenamePadding = -1

The padding in file-based iteration encoding.

0 if no padding is given (T pattern). -1 if no expansion pattern has been parsed.

◆ m_filenamePrefix

std::string openPMD::internal::SeriesData::m_filenamePrefix

Filename leading up to the expansion pattern.

Only used for file-based iteration encoding.

◆ m_iterationEncodingSetExplicitly

default_or_explicit openPMD::internal::SeriesData::m_iterationEncodingSetExplicitly
Initial value:
=
default_or_explicit::default_

◆ m_iterationFilenames

std::unordered_map<IterationIndex_t, std::string> openPMD::internal::SeriesData::m_iterationFilenames

This map contains the filenames of those Iterations which were found on the file system upon opening the Series for reading in file-based encoding.

It is only written to by readFileBased(). Other files that we create anew have names generated live by iterationFilename(), but files that existed previously might have different padding. This information is required for re-opening Iterations after closing. Since ADIOS2 has no read-write mode, this is important in our own READ_WRITE mode when re-opening a closed file in file-based encoding: A file that existed previously is re-opened in Read mode and will not support updating its contents. (Note that this is NOT a restriction of re-opening, this is fundamentally a restriction of R/W in ADIOS2. Files can be written XOR read.) A file that we created anew is re-opened in Append mode to continue writing data to it. Using adios2.engine.parameters.FlattenSteps = "ON" is recommended in this case.

◆ m_name

std::string openPMD::internal::SeriesData::m_name

Name of the iteration without filename suffix.

In case of file-based iteration encoding, with expansion pattern. E.g.: simData.bp -> simData simData_%06T.h5 -> simData_%06T

◆ m_overrideFilebasedFilename

std::optional<std::string> openPMD::internal::SeriesData::m_overrideFilebasedFilename

Needed if reading a single iteration of a file-based series.

Users may specify the concrete filename of one iteration instead of the file-based expansion pattern. In that case, the filename must not be constructed from prefix, infix and suffix as usual in file-based iteration encoding. Instead, the user-specified filename should be used directly. Store that filename in the following Option to indicate this situation.

◆ m_parsePreference

std::optional<ParsePreference> openPMD::internal::SeriesData::m_parsePreference

Remember the preference that the backend specified for parsing.

Not used in file-based iteration encoding, empty then. In linear read mode, parsing only starts after calling Series::readIterations(), empty before that point.

◆ m_sharedStatefulIterator

std::unique_ptr<StatefulIterator> openPMD::internal::SeriesData::m_sharedStatefulIterator

Series::readIterations() returns an iterator type that modifies the state of the Series (by proceeding through IO steps).

Hence, we need to make sure that there is only one of them, otherwise they will both make modifications to the Series that the other iterator is not aware of.

Plan: At some point, we should add a second iterator type that does not change the state. Series::readIterations() should then return either this or that iterator depending on read mode (linear or random-access) and backend capabilities.

Due to include order, this member needs to be a pointer instead of an optional.

◆ m_stepStatus

StepStatus openPMD::internal::SeriesData::m_stepStatus = StepStatus::NoStep

Whether a step is currently active for this iteration.

Used for group-based iteration layout, see SeriesData.hpp for iteration-based layout. Access via stepStatus() method to automatically select the correct one among both flags.

◆ m_wroteAtLeastOneIOStep

bool openPMD::internal::SeriesData::m_wroteAtLeastOneIOStep = false

In variable-based encoding, all backends except ADIOS2 can only write one single iteration.

So, we remember if we already had a step, and if yes, Parameter<Operation::ADVANCE>::isThisStepMandatory is set as true in variable-based encoding. The backend will then throw if it has no support for steps.


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