Loading source/adios2/core/Stream.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ namespace core Stream::Stream(const std::string &name, const Mode mode, MPI_Comm comm, const std::string engineType, const std::string hostLanguage) : m_Name(name), m_ADIOS(std::make_shared<ADIOS>(comm, DebugON, hostLanguage)), m_IO(&m_ADIOS->DeclareIO(name)), m_Mode(mode) m_IO(&m_ADIOS->DeclareIO(name)), m_Mode(mode), m_EngineType(engineType) { if (mode == adios2::Mode::Read) { Loading Loading @@ -105,10 +105,12 @@ void Stream::CheckOpen() { if (m_Engine == nullptr) { m_IO->SetEngine(m_EngineType); m_Engine = &m_IO->Open(m_Name, m_Mode); if (m_Mode == adios2::Mode::Write) { m_Engine->BeginStep(); m_StepStatus = true; } } } Loading source/adios2/core/Stream.h +5 −0 Original line number Diff line number Diff line Loading @@ -108,9 +108,14 @@ private: /** mode to open engine at first read/write */ Mode m_Mode; /** Sets engine type to be opened at first read/write */ std::string m_EngineType = "BPFile"; /** internal flag to check if getstep was called */ bool m_FirstStep = true; bool m_StepStatus = false; template <class T> std::vector<T> GetCommon(Variable<T> &variable); Loading source/adios2/core/Stream.tcc +6 −1 Original line number Diff line number Diff line Loading @@ -44,13 +44,18 @@ void Stream::Write(const std::string &name, const T *data, const Dims &shape, } CheckOpen(); if (!m_StepStatus) { m_Engine->BeginStep(); m_StepStatus = true; } m_Engine->Put(*variable, data, adios2::Mode::Sync); if (endStep) { m_Engine->EndStep(); m_Engine->BeginStep(); m_StepStatus = false; } } Loading source/adios2/engine/hdf5/HDF5ReaderP.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -255,14 +255,18 @@ void HDF5ReaderP::UseHDFRead(Variable<T> &variable, T *data, hid_t h5Type) StepStatus HDF5ReaderP::BeginStep(StepMode mode, const float timeoutSeconds) { // printf(".... in begin step: \n"); m_InStreamMode = true; int ts = m_H5File.GetNumAdiosSteps(); if (m_StreamAt >= ts) { return StepStatus::EndOfStream; } m_IO.RemoveAllVariables(); m_IO.RemoveAllAttributes(); m_H5File.ReadVariables(m_StreamAt, m_IO); return StepStatus::OK; } Loading source/adios2/engine/hdf5/HDF5ReaderP.tcc +5 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,11 @@ void HDF5ReaderP::GetSyncCommon(Variable<T> &variable, T *data) */ hid_t h5Type = m_H5File.GetHDF5Type<T>(); // UseHDFRead(variable.m_Name, data, h5Type); if (m_InStreamMode) { variable.m_StepsStart = m_StreamAt; variable.m_StepsCount = 1; } UseHDFRead(variable, data, h5Type); } Loading Loading
source/adios2/core/Stream.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ namespace core Stream::Stream(const std::string &name, const Mode mode, MPI_Comm comm, const std::string engineType, const std::string hostLanguage) : m_Name(name), m_ADIOS(std::make_shared<ADIOS>(comm, DebugON, hostLanguage)), m_IO(&m_ADIOS->DeclareIO(name)), m_Mode(mode) m_IO(&m_ADIOS->DeclareIO(name)), m_Mode(mode), m_EngineType(engineType) { if (mode == adios2::Mode::Read) { Loading Loading @@ -105,10 +105,12 @@ void Stream::CheckOpen() { if (m_Engine == nullptr) { m_IO->SetEngine(m_EngineType); m_Engine = &m_IO->Open(m_Name, m_Mode); if (m_Mode == adios2::Mode::Write) { m_Engine->BeginStep(); m_StepStatus = true; } } } Loading
source/adios2/core/Stream.h +5 −0 Original line number Diff line number Diff line Loading @@ -108,9 +108,14 @@ private: /** mode to open engine at first read/write */ Mode m_Mode; /** Sets engine type to be opened at first read/write */ std::string m_EngineType = "BPFile"; /** internal flag to check if getstep was called */ bool m_FirstStep = true; bool m_StepStatus = false; template <class T> std::vector<T> GetCommon(Variable<T> &variable); Loading
source/adios2/core/Stream.tcc +6 −1 Original line number Diff line number Diff line Loading @@ -44,13 +44,18 @@ void Stream::Write(const std::string &name, const T *data, const Dims &shape, } CheckOpen(); if (!m_StepStatus) { m_Engine->BeginStep(); m_StepStatus = true; } m_Engine->Put(*variable, data, adios2::Mode::Sync); if (endStep) { m_Engine->EndStep(); m_Engine->BeginStep(); m_StepStatus = false; } } Loading
source/adios2/engine/hdf5/HDF5ReaderP.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -255,14 +255,18 @@ void HDF5ReaderP::UseHDFRead(Variable<T> &variable, T *data, hid_t h5Type) StepStatus HDF5ReaderP::BeginStep(StepMode mode, const float timeoutSeconds) { // printf(".... in begin step: \n"); m_InStreamMode = true; int ts = m_H5File.GetNumAdiosSteps(); if (m_StreamAt >= ts) { return StepStatus::EndOfStream; } m_IO.RemoveAllVariables(); m_IO.RemoveAllAttributes(); m_H5File.ReadVariables(m_StreamAt, m_IO); return StepStatus::OK; } Loading
source/adios2/engine/hdf5/HDF5ReaderP.tcc +5 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,11 @@ void HDF5ReaderP::GetSyncCommon(Variable<T> &variable, T *data) */ hid_t h5Type = m_H5File.GetHDF5Type<T>(); // UseHDFRead(variable.m_Name, data, h5Type); if (m_InStreamMode) { variable.m_StepsStart = m_StreamAt; variable.m_StepsCount = 1; } UseHDFRead(variable, data, h5Type); } Loading