diff --git a/source/adios2/engine/bp4/BP4Reader.cpp b/source/adios2/engine/bp4/BP4Reader.cpp index 2886a54a59..43ded93e36 100644 --- a/source/adios2/engine/bp4/BP4Reader.cpp +++ b/source/adios2/engine/bp4/BP4Reader.cpp @@ -14,6 +14,8 @@ #include "adios2/helper/adiosFunctions.h" // MPI BroadcastVector #include "adios2/toolkit/profiling/taustubs/tautimer.hpp" +#include + namespace adios2 { namespace core @@ -24,9 +26,10 @@ namespace engine BP4Reader::BP4Reader(IO &io, const std::string &name, const Mode mode, MPI_Comm mpiComm) : Engine("BP4Reader", io, name, mode, mpiComm), - m_BP4Deserializer(mpiComm, m_DebugMode), m_FileManager(mpiComm, m_DebugMode), - m_SubFileManager(mpiComm, m_DebugMode), - m_FileMetadataIndexManager(mpiComm, m_DebugMode) + m_BP4Deserializer(mpiComm, m_DebugMode), + m_MDFileManager(mpiComm, m_DebugMode), + m_DataFileManager(mpiComm, m_DebugMode), + m_MDIndexFileManager(mpiComm, m_DebugMode) { TAU_SCOPED_TIMER("BP4Reader::Open"); Init(); @@ -65,41 +68,23 @@ StepStatus BP4Reader::BeginStep(StepMode mode, const float timeoutSeconds) // used to inquire for variables in streaming mode m_IO.m_ReadStreaming = true; - m_IO.m_EngineStep = m_CurrentStep; + StepStatus status = StepStatus::OK; if (m_CurrentStep >= m_BP4Deserializer.m_MetadataSet.StepsCount) { - m_IO.m_ReadStreaming = false; - return StepStatus::EndOfStream; + status = CheckForNewSteps(timeoutSeconds); } - /* - const auto &variablesData = m_IO.GetVariablesDataMap(); + // This should be after getting new steps + m_IO.m_EngineStep = m_CurrentStep; - for (const auto &variableData : variablesData) + if (status == StepStatus::OK) { - const std::string name = variableData.first; - const std::string type = m_IO.InquireVariableType(name); - - if (type == "compound") - { - } -#define declare_type(T) \ - else if (type == helper::GetType()) \ - { \ - Variable *variable = m_IO.InquireVariable(name); \ - if (mode == StepMode::NextAvailable) \ - { \ - variable->SetStepSelection({m_CurrentStep, 1}); \ - } \ - } - ADIOS2_FOREACH_STDTYPE_1ARG(declare_type) -#undef declare_type + m_IO.ResetVariablesStepSelection(false, + "in call to BP4 Reader BeginStep"); } - */ - m_IO.ResetVariablesStepSelection(false, "in call to BP4 Reader BeginStep"); - return StepStatus::OK; + return status; } size_t BP4Reader::CurrentStep() const { return m_CurrentStep; } @@ -151,9 +136,9 @@ void BP4Reader::Init() { if (m_OpenMode != Mode::Read) { - throw std::invalid_argument( - "ERROR: BPFileReader only supports OpenMode::Read from" + - m_Name + " " + m_EndMessage); + throw std::invalid_argument("ERROR: BPFileReader only " + "supports OpenMode::Read from" + + m_Name + " " + m_EndMessage); } } @@ -177,15 +162,14 @@ void BP4Reader::InitTransports() m_BP4Deserializer.GetBPMetadataFileName(m_Name)); const bool profile = m_BP4Deserializer.m_Profiler.IsActive; - m_FileManager.OpenFiles({metadataFile}, adios2::Mode::Read, - m_IO.m_TransportsParameters, profile); + m_MDFileManager.OpenFiles({metadataFile}, adios2::Mode::Read, + m_IO.m_TransportsParameters, profile); /* Open file to save the metadata index table */ const std::string metadataIndexFile( m_BP4Deserializer.GetBPMetadataIndexFileName(m_Name)); - m_FileMetadataIndexManager.OpenFiles( - {metadataIndexFile}, adios2::Mode::Read, - m_IO.m_TransportsParameters, profile); + m_MDIndexFileManager.OpenFiles({metadataIndexFile}, adios2::Mode::Read, + m_IO.m_TransportsParameters, profile); } } @@ -194,21 +178,27 @@ void BP4Reader::InitBuffer() // Put all metadata in buffer if (m_BP4Deserializer.m_RankMPI == 0) { - const size_t fileSize = m_FileManager.GetFileSize(0); - m_BP4Deserializer.m_Metadata.Resize( - fileSize, "allocating metadata buffer, in call to BP4Reader Open"); - - m_FileManager.ReadFile(m_BP4Deserializer.m_Metadata.m_Buffer.data(), - fileSize); - + /* Read metadata index table into memory */ const size_t metadataIndexFileSize = - m_FileMetadataIndexManager.GetFileSize(0); + m_MDIndexFileManager.GetFileSize(0); m_BP4Deserializer.m_MetadataIndex.Resize( - metadataIndexFileSize, - "allocating metadata index buffer, in call to BPFileReader Open"); - m_FileMetadataIndexManager.ReadFile( + metadataIndexFileSize, "allocating metadata index buffer, " + "in call to BPFileReader Open"); + m_MDIndexFileManager.ReadFile( m_BP4Deserializer.m_MetadataIndex.m_Buffer.data(), metadataIndexFileSize); + + m_MDIndexFileProcessedSize = metadataIndexFileSize; + + /* Read metadata file into memory */ + const size_t fileSize = m_MDFileManager.GetFileSize(0); + m_BP4Deserializer.m_Metadata.Resize( + fileSize, "allocating metadata buffer, in call to BP4Reader Open"); + + m_MDFileManager.ReadFile(m_BP4Deserializer.m_Metadata.m_Buffer.data(), + fileSize); + + m_MDFileProcessedSize = fileSize; } // broadcast buffer to all ranks from zero helper::BroadcastVector(m_BP4Deserializer.m_Metadata.m_Buffer, m_MPIComm); @@ -224,6 +214,187 @@ void BP4Reader::InitBuffer() m_BP4Deserializer.ParseMetadata(m_BP4Deserializer.m_Metadata, *this); } +std::pair BP4Reader::UpdateBuffer() +{ + std::vector sizes(3, 0); + if (m_BP4Deserializer.m_RankMPI == 0) + { + const size_t idxFileSize = m_MDIndexFileManager.GetFileSize(0); + if (idxFileSize > m_MDIndexFileProcessedSize) + { + const size_t newIdxSize = idxFileSize - m_MDIndexFileProcessedSize; + if (m_BP4Deserializer.m_MetadataIndex.m_Buffer.size() < newIdxSize) + { + m_BP4Deserializer.m_MetadataIndex.Resize( + newIdxSize, "re-allocating metadata index buffer, in " + "call to BP4Reader::BeginStep/UpdateBuffer"); + } + m_BP4Deserializer.m_MetadataIndex.m_Position = 0; + m_MDIndexFileManager.ReadFile( + m_BP4Deserializer.m_MetadataIndex.m_Buffer.data(), newIdxSize, + m_MDIndexFileProcessedSize); + + sizes[0] = newIdxSize; + + /* Read corresponding new metadata (throwing away the old) + */ + const size_t fileSize = m_MDFileManager.GetFileSize(0); + const size_t newMDSize = fileSize - m_MDFileProcessedSize; + if (m_BP4Deserializer.m_Metadata.m_Buffer.size() < newMDSize) + { + m_BP4Deserializer.m_Metadata.Resize( + newMDSize, "allocating metadata buffer, in call to " + "BP4Reader Open"); + } + m_BP4Deserializer.m_Metadata.m_Position = 0; + m_MDFileManager.ReadFile( + m_BP4Deserializer.m_Metadata.m_Buffer.data(), newMDSize, + m_MDFileProcessedSize); + + sizes[1] = newMDSize; + sizes[2] = m_MDFileProcessedSize; + } + } + + helper::BroadcastVector(sizes, m_MPIComm, 0); + size_t newIdxSize = sizes[0]; + size_t newMDSize = sizes[1]; + + if (newIdxSize > 0) + { + // broadcast buffer to all ranks from zero + helper::BroadcastVector(m_BP4Deserializer.m_Metadata.m_Buffer, + m_MPIComm); + + // broadcast metadata index buffer to all ranks from zero + helper::BroadcastVector(m_BP4Deserializer.m_MetadataIndex.m_Buffer, + m_MPIComm); + + if (m_BP4Deserializer.m_RankMPI != 0) + { + m_MDFileProcessedSize = sizes[2]; + // we need this pointer in Metadata buffer on all processes + // for parsing it correctly in ProcessMetadataForNewSteps() + } + } + return std::make_pair(newIdxSize, newMDSize); +} +void BP4Reader::ProcessMetadataForNewSteps(const size_t newIdxSize, + const size_t newMDSize) +{ + /* Remove all existing variables from previous steps + It seems easier than trying to update them */ + m_IO.RemoveAllVariables(); + + /* Parse metadata index table (without header) */ + /* We need to skew the index table pointers with the + size of the already-processed metadata because the memory buffer of + new metadata starts from 0 */ + m_BP4Deserializer.ParseMetadataIndex(m_BP4Deserializer.m_MetadataIndex, + m_MDFileProcessedSize); + + // fills IO with Variables and Attributes (not first step) + m_BP4Deserializer.ParseMetadata(m_BP4Deserializer.m_Metadata, *this, false); + + // remember current end position in metadata and index table for next round + if (m_BP4Deserializer.m_RankMPI == 0) + { + m_MDIndexFileProcessedSize += newIdxSize; + m_MDFileProcessedSize += newMDSize; + } +} + +bool BP4Reader::CheckWriterActive() +{ + size_t flag = 0; + if (m_BP4Deserializer.m_RankMPI == 0) + { + std::vector header(64, '\0'); + m_MDIndexFileManager.ReadFile(header.data(), 64, 0, 0); + bool active = m_BP4Deserializer.ReadActiveFlag(header); + flag = (active ? 1 : 0); + } + flag = helper::BroadcastValue(flag, m_BP4Deserializer.m_MPIComm, 0); + m_BP4Deserializer.m_WriterIsActive = (flag > 0); + return m_BP4Deserializer.m_WriterIsActive; +} + +StepStatus BP4Reader::CheckForNewSteps(float timeoutSeconds) +{ + /* Do a collective wait for a step within timeout. + Make sure every writer comes to the same conclusion */ + StepStatus retval = StepStatus::OK; + bool haveNewStep = false; + float TO = timeoutSeconds; + if (TO < 0.0) + { + TO = std::numeric_limits::max() / 10000; + } + uint64_t milliTO = static_cast(TO * 1000.0); + if (milliTO < 1) + { + milliTO = 1; // avoid 0 + } + uint64_t pollTime = milliTO / 100; // TO/100 seconds polling time + if (pollTime < 1000) + { + pollTime = 1000; // min 1 second polling time + } + if (pollTime > 10000) + { + pollTime = 10000; // max 10 seconds polling time + } + + /* Poll */ + double waited = 0.0; + double startTime, endTime; + + // Hack: processing metadata for multiple new steps only works + // when pretending not to be in streaming mode + const bool saveReadStreaming = m_IO.m_ReadStreaming; + + m_IO.m_ReadStreaming = false; + while (waited < TO && m_BP4Deserializer.m_WriterIsActive) + { + startTime = MPI_Wtime(); + std::pair sizes = UpdateBuffer(); + if (sizes.first > 0) + { + haveNewStep = true; + /* we have new metadata in memory. Need to parse it now */ + ProcessMetadataForNewSteps(sizes.first, sizes.second); + break; + } + if (!CheckWriterActive()) + { + break; + } + std::this_thread::sleep_for(std::chrono::milliseconds(pollTime)); + endTime = MPI_Wtime(); + waited += endTime - startTime; + } + + if (!haveNewStep) + { + m_IO.m_ReadStreaming = false; + if (m_BP4Deserializer.m_WriterIsActive) + { + retval = StepStatus::NotReady; + } + else + { + retval = StepStatus::EndOfStream; + } + } + else + { + retval = StepStatus::OK; + } + m_IO.m_ReadStreaming = saveReadStreaming; + + return retval; +} + #define declare_type(T) \ void BP4Reader::DoGetSync(Variable &variable, T *data) \ { \ @@ -242,8 +413,8 @@ void BP4Reader::DoClose(const int transportIndex) { TAU_SCOPED_TIMER("BP4Reader::Close"); PerformGets(); - m_SubFileManager.CloseFiles(); - m_FileManager.CloseFiles(); + m_DataFileManager.CloseFiles(); + m_MDFileManager.CloseFiles(); } #define declare_type(T) \ diff --git a/source/adios2/engine/bp4/BP4Reader.h b/source/adios2/engine/bp4/BP4Reader.h index 7eb64cdfc8..c01ec0f213 100644 --- a/source/adios2/engine/bp4/BP4Reader.h +++ b/source/adios2/engine/bp4/BP4Reader.h @@ -50,10 +50,16 @@ class BP4Reader : public Engine private: format::BP4Deserializer m_BP4Deserializer; - transportman::TransportMan m_FileManager; - transportman::TransportMan m_SubFileManager; + /* transport manager for metadata file */ + transportman::TransportMan m_MDFileManager; + size_t m_MDFileProcessedSize = 0; + + /* transport manager for managing data file(s) */ + transportman::TransportMan m_DataFileManager; + /* transport manager for managing the metadata index file */ - transportman::TransportMan m_FileMetadataIndexManager; + transportman::TransportMan m_MDIndexFileManager; + size_t m_MDIndexFileProcessedSize = 0; /** used for per-step reads, TODO: to be moved to BP4Deserializer */ size_t m_CurrentStep = 0; @@ -63,6 +69,34 @@ class BP4Reader : public Engine void InitTransports(); void InitBuffer(); + /** Read in more metadata if exist (throwing away old). + * For streaming only. + * @return pair of sizes if new metadata was read in + * sizes.first = size of new content from Index Table + * sizes.second = size of new content from Metadata File + */ + std::pair UpdateBuffer(); + + /** Process the new metadata coming in (in UpdateBuffer) + * @param newIdxSize: the size of the new content from Index Table + * @param neMDSize: the size of new content from Metadata File + */ + void ProcessMetadataForNewSteps(const size_t newIdxSize, + const size_t newMDSize); + + /** Check the active status flag in index file. + * @return true if writer is still active + * it sets BP4Deserialized.m_WriterIsActive + */ + bool CheckWriterActive(); + + /** Check for new steps withing timeout and only if writer is active. + * @return the status flag + * Used by BeginStep() to get new steps from file when it reaches the + * end of steps in memory. + */ + StepStatus CheckForNewSteps(float timeoutSeconds); + #define declare_type(T) \ void DoGetSync(Variable &, T *) final; \ void DoGetDeferred(Variable &, T *) final; diff --git a/source/adios2/engine/bp4/BP4Reader.tcc b/source/adios2/engine/bp4/BP4Reader.tcc index be26819ba7..a0f1159483 100644 --- a/source/adios2/engine/bp4/BP4Reader.tcc +++ b/source/adios2/engine/bp4/BP4Reader.tcc @@ -80,7 +80,7 @@ void BP4Reader::ReadVariableBlocks(Variable &variable) } // check if subfile is already opened - if (m_SubFileManager.m_Transports.count( + if (m_DataFileManager.m_Transports.count( subStreamBoxInfo.SubStreamID) == 0) { const std::string subFileName = @@ -88,7 +88,7 @@ void BP4Reader::ReadVariableBlocks(Variable &variable) m_Name, subStreamBoxInfo.SubStreamID, m_BP4Deserializer.m_Minifooter.HasSubFiles); - m_SubFileManager.OpenFileID( + m_DataFileManager.OpenFileID( subFileName, subStreamBoxInfo.SubStreamID, Mode::Read, {{"transport", "File"}}, profile); } @@ -100,8 +100,8 @@ void BP4Reader::ReadVariableBlocks(Variable &variable) subStreamBoxInfo, buffer, payloadSize, payloadStart, 0); - m_SubFileManager.ReadFile(buffer, payloadSize, payloadStart, - subStreamBoxInfo.SubStreamID); + m_DataFileManager.ReadFile(buffer, payloadSize, payloadStart, + subStreamBoxInfo.SubStreamID); m_BP4Deserializer.PostDataRead( variable, blockInfo, subStreamBoxInfo, diff --git a/source/adios2/helper/adiosMPIFunctions.tcc b/source/adios2/helper/adiosMPIFunctions.tcc index d8f3b770da..df8236fcb3 100644 --- a/source/adios2/helper/adiosMPIFunctions.tcc +++ b/source/adios2/helper/adiosMPIFunctions.tcc @@ -141,6 +141,42 @@ void BroadcastVector(std::vector &vector, MPI_Comm mpiComm, } } +// BroadcastVector specializations +template <> +void BroadcastVector(std::vector &vector, MPI_Comm mpiComm, + const int rankSource) +{ + int size; + SMPI_Comm_size(mpiComm, &size); + + if (size == 1) + { + return; + } + + // First Broadcast the size, then the contents + size_t inputSize = BroadcastValue(vector.size(), mpiComm, rankSource); + int rank; + SMPI_Comm_rank(mpiComm, &rank); + + if (rank != rankSource) + { + vector.resize(inputSize); + } + + const int MAXBCASTSIZE = 1073741824 / sizeof(size_t); + size_t blockSize = (inputSize > MAXBCASTSIZE ? MAXBCASTSIZE : inputSize); + size_t *buffer = vector.data(); + while (inputSize > 0) + { + SMPI_Bcast(buffer, static_cast(blockSize), ADIOS2_MPI_SIZE_T, + rankSource, mpiComm); + buffer += blockSize; + inputSize -= blockSize; + blockSize = (inputSize > MAXBCASTSIZE ? MAXBCASTSIZE : inputSize); + } +} + // GatherArrays specializations template <> void GatherArrays(const char *source, const size_t sourceCount, diff --git a/source/adios2/toolkit/format/bp4/BP4Deserializer.cpp b/source/adios2/toolkit/format/bp4/BP4Deserializer.cpp index 983d1bc210..313db4c48a 100644 --- a/source/adios2/toolkit/format/bp4/BP4Deserializer.cpp +++ b/source/adios2/toolkit/format/bp4/BP4Deserializer.cpp @@ -36,19 +36,15 @@ BP4Deserializer::BP4Deserializer(MPI_Comm mpiComm, const bool debugMode) } void BP4Deserializer::ParseMetadata(const BufferSTL &bufferSTL, - core::Engine &engine) + core::Engine &engine, const bool firstStep) { - // ParseMinifooter(bufferSTL); - // ParsePGIndex(bufferSTL, io); - // ParseVariablesIndex(bufferSTL, io); - // ParseAttributesIndex(bufferSTL, io); - size_t steps; - steps = m_MetadataIndexTable[0].size(); - m_MetadataSet.StepsCount = steps; - m_MetadataSet.CurrentStep = steps - 1; + const size_t oldSteps = (firstStep ? 0 : m_MetadataSet.StepsCount); + size_t allSteps = m_MetadataIndexTable[0].size(); + m_MetadataSet.StepsCount = allSteps; + m_MetadataSet.CurrentStep = allSteps - 1; /* parse the metadata step by step using the pointers saved in the metadata index table */ - for (int i = 0; i < steps; i++) + for (size_t i = oldSteps; i < allSteps; i++) { ParsePGIndexPerStep(bufferSTL, engine.m_IO.m_HostLanguage, 0, i + 1); ParseVariablesIndexPerStep(bufferSTL, engine, 0, i + 1); @@ -56,56 +52,63 @@ void BP4Deserializer::ParseMetadata(const BufferSTL &bufferSTL, } } -void BP4Deserializer::ParseMetadataIndex(const BufferSTL &bufferSTL) +void BP4Deserializer::ParseMetadataIndex(const BufferSTL &bufferSTL, + const size_t absoluteStartPos) { const auto &buffer = bufferSTL.m_Buffer; const size_t bufferSize = buffer.size(); + size_t position = 0; - // Read header (64 bytes) + if (absoluteStartPos == 0) + { + // Read header (64 bytes) + // long version string + position = m_VersionTagPosition; + m_Minifooter.VersionTag.assign(&buffer[position], m_VersionTagLength); + + position = m_EndianFlagPosition; + const uint8_t endianness = helper::ReadValue(buffer, position); + m_Minifooter.IsLittleEndian = (endianness == 0) ? true : false; +#ifndef ADIOS2_HAVE_ENDIAN_REVERSE + if (m_DebugMode) + { + if (helper::IsLittleEndian() != m_Minifooter.IsLittleEndian) + { + throw std::runtime_error( + "ERROR: reader found BigEndian bp file, " + "this version of ADIOS2 wasn't compiled " + "with the cmake flag -DADIOS2_USE_Endian_Reverse=ON " + "explicitly, in call to Open\n"); + } + } +#endif - // long version string - size_t position = m_VersionTagPosition; - m_Minifooter.VersionTag.assign(&buffer[position], m_VersionTagLength); + // This has no flag in BP4 header. Always true + m_Minifooter.HasSubFiles = true; - position = m_EndianFlagPosition; - const uint8_t endianness = helper::ReadValue(buffer, position); - m_Minifooter.IsLittleEndian = (endianness == 0) ? true : false; -#ifndef ADIOS2_HAVE_ENDIAN_REVERSE - if (m_DebugMode) - { - if (helper::IsLittleEndian() != m_Minifooter.IsLittleEndian) + // BP version + position = m_BPVersionPosition; + m_Minifooter.Version = helper::ReadValue( + buffer, position, m_Minifooter.IsLittleEndian); + if (m_Minifooter.Version != 4) { throw std::runtime_error( - "ERROR: reader found BigEndian bp file, " - "this version of ADIOS2 wasn't compiled " - "with the cmake flag -DADIOS2_USE_Endian_Reverse=ON " - "explicitly, in call to Open\n"); + "ERROR: ADIOS2 BP4 Engine only supports bp format " + "version 4, found " + + std::to_string(m_Minifooter.Version) + " version \n"); } - } -#endif - // This has no flag in BP4 header. Always true - m_Minifooter.HasSubFiles = true; + // Writer active flag + position = m_ActiveFlagPosition; + const char activeChar = helper::ReadValue( + buffer, position, m_Minifooter.IsLittleEndian); + m_WriterIsActive = (activeChar == '\1' ? true : false); - // BP version - position = m_BPVersionPosition; - m_Minifooter.Version = helper::ReadValue( - buffer, position, m_Minifooter.IsLittleEndian); - if (m_Minifooter.Version != 4) - { - throw std::runtime_error( - "ERROR: ADIOS2 BP4 Engine only supports bp format " - "version 4, found " + - std::to_string(m_Minifooter.Version) + " version \n"); + // move position to first row + position = 64; } - // active flag, not used yet in the reader - position = m_ActiveFlagPosition; - const uint8_t activeFlag = helper::ReadValue( - buffer, position, m_Minifooter.IsLittleEndian); - // Read each record now - position = 64; while (position < bufferSize) { std::vector ptrs; @@ -115,16 +118,16 @@ void BP4Deserializer::ParseMetadataIndex(const BufferSTL &bufferSTL) buffer, position, m_Minifooter.IsLittleEndian); const uint64_t pgIndexStart = helper::ReadValue( buffer, position, m_Minifooter.IsLittleEndian); - ptrs.push_back(pgIndexStart); + ptrs.push_back(pgIndexStart - absoluteStartPos); const uint64_t variablesIndexStart = helper::ReadValue( buffer, position, m_Minifooter.IsLittleEndian); - ptrs.push_back(variablesIndexStart); + ptrs.push_back(variablesIndexStart - absoluteStartPos); const uint64_t attributesIndexStart = helper::ReadValue( buffer, position, m_Minifooter.IsLittleEndian); - ptrs.push_back(attributesIndexStart); + ptrs.push_back(attributesIndexStart - absoluteStartPos); const uint64_t currentStepEndPos = helper::ReadValue( buffer, position, m_Minifooter.IsLittleEndian); - ptrs.push_back(currentStepEndPos); + ptrs.push_back(currentStepEndPos - absoluteStartPos); const uint64_t currentTimeStamp = helper::ReadValue( buffer, position, m_Minifooter.IsLittleEndian); ptrs.push_back(currentTimeStamp); @@ -621,6 +624,21 @@ void BP4Deserializer::ClipMemory(const std::string &variableName, core::IO &io, #undef declare_type } +bool BP4Deserializer::ReadActiveFlag(std::vector &buffer) +{ + if (buffer.size() < m_ActiveFlagPosition) + { + throw std::runtime_error("BP4Deserializer::CheckActiveFlag() is called " + "with a buffer smaller than required"); + } + // Writer active flag + size_t position = m_ActiveFlagPosition; + const char activeChar = helper::ReadValue( + buffer, position, m_Minifooter.IsLittleEndian); + m_WriterIsActive = (activeChar == '\1' ? true : false); + return m_WriterIsActive; +} + #define declare_template_instantiation(T) \ template void BP4Deserializer::GetSyncVariableDataFromStream( \ core::Variable &, BufferSTL &) const; \ diff --git a/source/adios2/toolkit/format/bp4/BP4Deserializer.h b/source/adios2/toolkit/format/bp4/BP4Deserializer.h index 046911c4a8..f67248e28a 100644 --- a/source/adios2/toolkit/format/bp4/BP4Deserializer.h +++ b/source/adios2/toolkit/format/bp4/BP4Deserializer.h @@ -40,6 +40,8 @@ class BP4Deserializer : public BP4Base // BufferSTL m_MetadataIndex; + bool m_WriterIsActive = false; + /** * Unique constructor * @param mpiComm @@ -49,9 +51,11 @@ class BP4Deserializer : public BP4Base ~BP4Deserializer() = default; - void ParseMetadataIndex(const BufferSTL &bufferSTL); + void ParseMetadataIndex(const BufferSTL &bufferSTL, + const size_t absoluteStartPos = 0); - void ParseMetadata(const BufferSTL &bufferSTL, core::Engine &engine); + void ParseMetadata(const BufferSTL &bufferSTL, core::Engine &engine, + const bool firstStep = true); /** * Used to get the variable payload data for the current selection (dims and @@ -148,6 +152,12 @@ class BP4Deserializer : public BP4Base std::vector::Info> BlocksInfo(const core::Variable &variable, const size_t step) const; + /** Parse active flag in index table header (64 bytes). + * Header must be read by caller into a vector of 64 characters. + * It sets m_WriterIsActive and returns the same value + */ + bool ReadActiveFlag(std::vector &buffer); + // TODO : Will deprecate all function below std::map PerformGetsVariablesSubFileInfo(core::IO &io); diff --git a/source/utils/CMakeLists.txt b/source/utils/CMakeLists.txt index a14dfefda1..396ead7091 100644 --- a/source/utils/CMakeLists.txt +++ b/source/utils/CMakeLists.txt @@ -42,3 +42,5 @@ endif() install(PROGRAMS bp4dbg/bp4dbg.py bp4dbg/bp4dbg_data.py bp4dbg/bp4dbg_utils.py bp4dbg/bp4dbg_metadata.py bp4dbg/bp4dbg_idxtable.py DESTINATION ${CMAKE_INSTALL_BINDIR}/bp4dbg) + +install(PROGRAMS adios_deactivate_bp.sh DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/source/utils/adios_deactivate_bp.sh b/source/utils/adios_deactivate_bp.sh new file mode 100755 index 0000000000..99c04ad604 --- /dev/null +++ b/source/utils/adios_deactivate_bp.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +FNAME=$1 +if [ "x$FNAME" == "x" ]; then + echo "Missing BP data set name" + exit 1 +fi + +if [ ! -d $FNAME ]; then + echo "Not a valid BP4 output: $FNAME" + echo "BP4 data set should be a directory" + exit 2 +fi + +if [ ! -f $FNAME/md.idx ]; then + echo "Not a valid BP4 output: $FNAME" + echo "Missing $FNAME/md.idx file" + exit 3 +fi + +printf '\x00' | dd of=$FNAME/md.idx bs=1 seek=38 conv=notrunc + diff --git a/source/utils/adios_iotest/iotest-config/manyvars.txt b/source/utils/adios_iotest/iotest-config/manyvars.txt new file mode 100644 index 0000000000..a807ddd566 --- /dev/null +++ b/source/utils/adios_iotest/iotest-config/manyvars.txt @@ -0,0 +1,528 @@ +# Config file for Task 1 in a pipeline +# - Produce variables a b c +# - Write variables a b c to stream_T1.bp + +# Config file for Task 2 in a pipeline +# - Read in variables a b from Task 1 (ignore c) from stream_T1.bp +# using a different decomposition + + +group io_T1 + # item type varname N [dim1 dim2 ... dimN decomp1 decomp2 ... decompN] +array double a001 2 100 200 X Y +array double a002 2 100 200 X Y +array double a003 2 100 200 X Y +array double a004 2 100 200 X Y +array double a005 2 100 200 X Y +array double a006 2 100 200 X Y +array double a007 2 100 200 X Y +array double a008 2 100 200 X Y +array double a009 2 100 200 X Y +array double a010 2 100 200 X Y +array double a011 2 100 200 X Y +array double a012 2 100 200 X Y +array double a013 2 100 200 X Y +array double a014 2 100 200 X Y +array double a015 2 100 200 X Y +array double a016 2 100 200 X Y +array double a017 2 100 200 X Y +array double a018 2 100 200 X Y +array double a019 2 100 200 X Y +array double a020 2 100 200 X Y +array double a021 2 100 200 X Y +array double a022 2 100 200 X Y +array double a023 2 100 200 X Y +array double a024 2 100 200 X Y +array double a025 2 100 200 X Y +array double a026 2 100 200 X Y +array double a027 2 100 200 X Y +array double a028 2 100 200 X Y +array double a029 2 100 200 X Y +array double a030 2 100 200 X Y +array double a031 2 100 200 X Y +array double a032 2 100 200 X Y +array double a033 2 100 200 X Y +array double a034 2 100 200 X Y +array double a035 2 100 200 X Y +array double a036 2 100 200 X Y +array double a037 2 100 200 X Y +array double a038 2 100 200 X Y +array double a039 2 100 200 X Y +array double a040 2 100 200 X Y +array double a041 2 100 200 X Y +array double a042 2 100 200 X Y +array double a043 2 100 200 X Y +array double a044 2 100 200 X Y +array double a045 2 100 200 X Y +array double a046 2 100 200 X Y +array double a047 2 100 200 X Y +array double a048 2 100 200 X Y +array double a049 2 100 200 X Y +array double a050 2 100 200 X Y +array double a051 2 100 200 X Y +array double a052 2 100 200 X Y +array double a053 2 100 200 X Y +array double a054 2 100 200 X Y +array double a055 2 100 200 X Y +array double a056 2 100 200 X Y +array double a057 2 100 200 X Y +array double a058 2 100 200 X Y +array double a059 2 100 200 X Y +array double a060 2 100 200 X Y +array double a061 2 100 200 X Y +array double a062 2 100 200 X Y +array double a063 2 100 200 X Y +array double a064 2 100 200 X Y +array double a065 2 100 200 X Y +array double a066 2 100 200 X Y +array double a067 2 100 200 X Y +array double a068 2 100 200 X Y +array double a069 2 100 200 X Y +array double a070 2 100 200 X Y +array double a071 2 100 200 X Y +array double a072 2 100 200 X Y +array double a073 2 100 200 X Y +array double a074 2 100 200 X Y +array double a075 2 100 200 X Y +array double a076 2 100 200 X Y +array double a077 2 100 200 X Y +array double a078 2 100 200 X Y +array double a079 2 100 200 X Y +array double a080 2 100 200 X Y +array double a081 2 100 200 X Y +array double a082 2 100 200 X Y +array double a083 2 100 200 X Y +array double a084 2 100 200 X Y +array double a085 2 100 200 X Y +array double a086 2 100 200 X Y +array double a087 2 100 200 X Y +array double a088 2 100 200 X Y +array double a089 2 100 200 X Y +array double a090 2 100 200 X Y +array double a091 2 100 200 X Y +array double a092 2 100 200 X Y +array double a093 2 100 200 X Y +array double a094 2 100 200 X Y +array double a095 2 100 200 X Y +array double a096 2 100 200 X Y +array double a097 2 100 200 X Y +array double a098 2 100 200 X Y +array double a099 2 100 200 X Y +array double a100 2 100 200 X Y +array double a101 2 100 200 X Y +array double a102 2 100 200 X Y +array double a103 2 100 200 X Y +array double a104 2 100 200 X Y +array double a105 2 100 200 X Y +array double a106 2 100 200 X Y +array double a107 2 100 200 X Y +array double a108 2 100 200 X Y +array double a109 2 100 200 X Y +array double a110 2 100 200 X Y +array double a111 2 100 200 X Y +array double a112 2 100 200 X Y +array double a113 2 100 200 X Y +array double a114 2 100 200 X Y +array double a115 2 100 200 X Y +array double a116 2 100 200 X Y +array double a117 2 100 200 X Y +array double a118 2 100 200 X Y +array double a119 2 100 200 X Y +array double a120 2 100 200 X Y +array double a121 2 100 200 X Y +array double a122 2 100 200 X Y +array double a123 2 100 200 X Y +array double a124 2 100 200 X Y +array double a125 2 100 200 X Y +array double a126 2 100 200 X Y +array double a127 2 100 200 X Y +array double a128 2 100 200 X Y +array double a129 2 100 200 X Y +array double a130 2 100 200 X Y +array double a131 2 100 200 X Y +array double a132 2 100 200 X Y +array double a133 2 100 200 X Y +array double a134 2 100 200 X Y +array double a135 2 100 200 X Y +array double a136 2 100 200 X Y +array double a137 2 100 200 X Y +array double a138 2 100 200 X Y +array double a139 2 100 200 X Y +array double a140 2 100 200 X Y +array double a141 2 100 200 X Y +array double a142 2 100 200 X Y +array double a143 2 100 200 X Y +array double a144 2 100 200 X Y +array double a145 2 100 200 X Y +array double a146 2 100 200 X Y +array double a147 2 100 200 X Y +array double a148 2 100 200 X Y +array double a149 2 100 200 X Y +array double a150 2 100 200 X Y +array double a151 2 100 200 X Y +array double a152 2 100 200 X Y +array double a153 2 100 200 X Y +array double a154 2 100 200 X Y +array double a155 2 100 200 X Y +array double a156 2 100 200 X Y +array double a157 2 100 200 X Y +array double a158 2 100 200 X Y +array double a159 2 100 200 X Y +array double a160 2 100 200 X Y +array double a161 2 100 200 X Y +array double a162 2 100 200 X Y +array double a163 2 100 200 X Y +array double a164 2 100 200 X Y +array double a165 2 100 200 X Y +array double a166 2 100 200 X Y +array double a167 2 100 200 X Y +array double a168 2 100 200 X Y +array double a169 2 100 200 X Y +array double a170 2 100 200 X Y +array double a171 2 100 200 X Y +array double a172 2 100 200 X Y +array double a173 2 100 200 X Y +array double a174 2 100 200 X Y +array double a175 2 100 200 X Y +array double a176 2 100 200 X Y +array double a177 2 100 200 X Y +array double a178 2 100 200 X Y +array double a179 2 100 200 X Y +array double a180 2 100 200 X Y +array double a181 2 100 200 X Y +array double a182 2 100 200 X Y +array double a183 2 100 200 X Y +array double a184 2 100 200 X Y +array double a185 2 100 200 X Y +array double a186 2 100 200 X Y +array double a187 2 100 200 X Y +array double a188 2 100 200 X Y +array double a189 2 100 200 X Y +array double a190 2 100 200 X Y +array double a191 2 100 200 X Y +array double a192 2 100 200 X Y +array double a193 2 100 200 X Y +array double a194 2 100 200 X Y +array double a195 2 100 200 X Y +array double a196 2 100 200 X Y +array double a197 2 100 200 X Y +array double a198 2 100 200 X Y +array double a199 2 100 200 X Y +array double a200 2 100 200 X Y +array double a201 2 100 200 X Y +array double a202 2 100 200 X Y +array double a203 2 100 200 X Y +array double a204 2 100 200 X Y +array double a205 2 100 200 X Y +array double a206 2 100 200 X Y +array double a207 2 100 200 X Y +array double a208 2 100 200 X Y +array double a209 2 100 200 X Y +array double a210 2 100 200 X Y +array double a211 2 100 200 X Y +array double a212 2 100 200 X Y +array double a213 2 100 200 X Y +array double a214 2 100 200 X Y +array double a215 2 100 200 X Y +array double a216 2 100 200 X Y +array double a217 2 100 200 X Y +array double a218 2 100 200 X Y +array double a219 2 100 200 X Y +array double a220 2 100 200 X Y +array double a221 2 100 200 X Y +array double a222 2 100 200 X Y +array double a223 2 100 200 X Y +array double a224 2 100 200 X Y +array double a225 2 100 200 X Y +array double a226 2 100 200 X Y +array double a227 2 100 200 X Y +array double a228 2 100 200 X Y +array double a229 2 100 200 X Y +array double a230 2 100 200 X Y +array double a231 2 100 200 X Y +array double a232 2 100 200 X Y +array double a233 2 100 200 X Y +array double a234 2 100 200 X Y +array double a235 2 100 200 X Y +array double a236 2 100 200 X Y +array double a237 2 100 200 X Y +array double a238 2 100 200 X Y +array double a239 2 100 200 X Y +array double a240 2 100 200 X Y +array double a241 2 100 200 X Y +array double a242 2 100 200 X Y +array double a243 2 100 200 X Y +array double a244 2 100 200 X Y +array double a245 2 100 200 X Y +array double a246 2 100 200 X Y +array double a247 2 100 200 X Y +array double a248 2 100 200 X Y +array double a249 2 100 200 X Y +array double a250 2 100 200 X Y +array double a251 2 100 200 X Y +array double a252 2 100 200 X Y +array double a253 2 100 200 X Y +array double a254 2 100 200 X Y +array double a255 2 100 200 X Y +array double a256 2 100 200 X Y +array double a257 2 100 200 X Y +array double a258 2 100 200 X Y +array double a259 2 100 200 X Y +array double a260 2 100 200 X Y +array double a261 2 100 200 X Y +array double a262 2 100 200 X Y +array double a263 2 100 200 X Y +array double a264 2 100 200 X Y +array double a265 2 100 200 X Y +array double a266 2 100 200 X Y +array double a267 2 100 200 X Y +array double a268 2 100 200 X Y +array double a269 2 100 200 X Y +array double a270 2 100 200 X Y +array double a271 2 100 200 X Y +array double a272 2 100 200 X Y +array double a273 2 100 200 X Y +array double a274 2 100 200 X Y +array double a275 2 100 200 X Y +array double a276 2 100 200 X Y +array double a277 2 100 200 X Y +array double a278 2 100 200 X Y +array double a279 2 100 200 X Y +array double a280 2 100 200 X Y +array double a281 2 100 200 X Y +array double a282 2 100 200 X Y +array double a283 2 100 200 X Y +array double a284 2 100 200 X Y +array double a285 2 100 200 X Y +array double a286 2 100 200 X Y +array double a287 2 100 200 X Y +array double a288 2 100 200 X Y +array double a289 2 100 200 X Y +array double a290 2 100 200 X Y +array double a291 2 100 200 X Y +array double a292 2 100 200 X Y +array double a293 2 100 200 X Y +array double a294 2 100 200 X Y +array double a295 2 100 200 X Y +array double a296 2 100 200 X Y +array double a297 2 100 200 X Y +array double a298 2 100 200 X Y +array double a299 2 100 200 X Y +array double a300 2 100 200 X Y +array double a301 2 100 200 X Y +array double a302 2 100 200 X Y +array double a303 2 100 200 X Y +array double a304 2 100 200 X Y +array double a305 2 100 200 X Y +array double a306 2 100 200 X Y +array double a307 2 100 200 X Y +array double a308 2 100 200 X Y +array double a309 2 100 200 X Y +array double a310 2 100 200 X Y +array double a311 2 100 200 X Y +array double a312 2 100 200 X Y +array double a313 2 100 200 X Y +array double a314 2 100 200 X Y +array double a315 2 100 200 X Y +array double a316 2 100 200 X Y +array double a317 2 100 200 X Y +array double a318 2 100 200 X Y +array double a319 2 100 200 X Y +array double a320 2 100 200 X Y +array double a321 2 100 200 X Y +array double a322 2 100 200 X Y +array double a323 2 100 200 X Y +array double a324 2 100 200 X Y +array double a325 2 100 200 X Y +array double a326 2 100 200 X Y +array double a327 2 100 200 X Y +array double a328 2 100 200 X Y +array double a329 2 100 200 X Y +array double a330 2 100 200 X Y +array double a331 2 100 200 X Y +array double a332 2 100 200 X Y +array double a333 2 100 200 X Y +array double a334 2 100 200 X Y +array double a335 2 100 200 X Y +array double a336 2 100 200 X Y +array double a337 2 100 200 X Y +array double a338 2 100 200 X Y +array double a339 2 100 200 X Y +array double a340 2 100 200 X Y +array double a341 2 100 200 X Y +array double a342 2 100 200 X Y +array double a343 2 100 200 X Y +array double a344 2 100 200 X Y +array double a345 2 100 200 X Y +array double a346 2 100 200 X Y +array double a347 2 100 200 X Y +array double a348 2 100 200 X Y +array double a349 2 100 200 X Y +array double a350 2 100 200 X Y +array double a351 2 100 200 X Y +array double a352 2 100 200 X Y +array double a353 2 100 200 X Y +array double a354 2 100 200 X Y +array double a355 2 100 200 X Y +array double a356 2 100 200 X Y +array double a357 2 100 200 X Y +array double a358 2 100 200 X Y +array double a359 2 100 200 X Y +array double a360 2 100 200 X Y +array double a361 2 100 200 X Y +array double a362 2 100 200 X Y +array double a363 2 100 200 X Y +array double a364 2 100 200 X Y +array double a365 2 100 200 X Y +array double a366 2 100 200 X Y +array double a367 2 100 200 X Y +array double a368 2 100 200 X Y +array double a369 2 100 200 X Y +array double a370 2 100 200 X Y +array double a371 2 100 200 X Y +array double a372 2 100 200 X Y +array double a373 2 100 200 X Y +array double a374 2 100 200 X Y +array double a375 2 100 200 X Y +array double a376 2 100 200 X Y +array double a377 2 100 200 X Y +array double a378 2 100 200 X Y +array double a379 2 100 200 X Y +array double a380 2 100 200 X Y +array double a381 2 100 200 X Y +array double a382 2 100 200 X Y +array double a383 2 100 200 X Y +array double a384 2 100 200 X Y +array double a385 2 100 200 X Y +array double a386 2 100 200 X Y +array double a387 2 100 200 X Y +array double a388 2 100 200 X Y +array double a389 2 100 200 X Y +array double a390 2 100 200 X Y +array double a391 2 100 200 X Y +array double a392 2 100 200 X Y +array double a393 2 100 200 X Y +array double a394 2 100 200 X Y +array double a395 2 100 200 X Y +array double a396 2 100 200 X Y +array double a397 2 100 200 X Y +array double a398 2 100 200 X Y +array double a399 2 100 200 X Y +array double a400 2 100 200 X Y +array double a401 2 100 200 X Y +array double a402 2 100 200 X Y +array double a403 2 100 200 X Y +array double a404 2 100 200 X Y +array double a405 2 100 200 X Y +array double a406 2 100 200 X Y +array double a407 2 100 200 X Y +array double a408 2 100 200 X Y +array double a409 2 100 200 X Y +array double a410 2 100 200 X Y +array double a411 2 100 200 X Y +array double a412 2 100 200 X Y +array double a413 2 100 200 X Y +array double a414 2 100 200 X Y +array double a415 2 100 200 X Y +array double a416 2 100 200 X Y +array double a417 2 100 200 X Y +array double a418 2 100 200 X Y +array double a419 2 100 200 X Y +array double a420 2 100 200 X Y +array double a421 2 100 200 X Y +array double a422 2 100 200 X Y +array double a423 2 100 200 X Y +array double a424 2 100 200 X Y +array double a425 2 100 200 X Y +array double a426 2 100 200 X Y +array double a427 2 100 200 X Y +array double a428 2 100 200 X Y +array double a429 2 100 200 X Y +array double a430 2 100 200 X Y +array double a431 2 100 200 X Y +array double a432 2 100 200 X Y +array double a433 2 100 200 X Y +array double a434 2 100 200 X Y +array double a435 2 100 200 X Y +array double a436 2 100 200 X Y +array double a437 2 100 200 X Y +array double a438 2 100 200 X Y +array double a439 2 100 200 X Y +array double a440 2 100 200 X Y +array double a441 2 100 200 X Y +array double a442 2 100 200 X Y +array double a443 2 100 200 X Y +array double a444 2 100 200 X Y +array double a445 2 100 200 X Y +array double a446 2 100 200 X Y +array double a447 2 100 200 X Y +array double a448 2 100 200 X Y +array double a449 2 100 200 X Y +array double a450 2 100 200 X Y +array double a451 2 100 200 X Y +array double a452 2 100 200 X Y +array double a453 2 100 200 X Y +array double a454 2 100 200 X Y +array double a455 2 100 200 X Y +array double a456 2 100 200 X Y +array double a457 2 100 200 X Y +array double a458 2 100 200 X Y +array double a459 2 100 200 X Y +array double a460 2 100 200 X Y +array double a461 2 100 200 X Y +array double a462 2 100 200 X Y +array double a463 2 100 200 X Y +array double a464 2 100 200 X Y +array double a465 2 100 200 X Y +array double a466 2 100 200 X Y +array double a467 2 100 200 X Y +array double a468 2 100 200 X Y +array double a469 2 100 200 X Y +array double a470 2 100 200 X Y +array double a471 2 100 200 X Y +array double a472 2 100 200 X Y +array double a473 2 100 200 X Y +array double a474 2 100 200 X Y +array double a475 2 100 200 X Y +array double a476 2 100 200 X Y +array double a477 2 100 200 X Y +array double a478 2 100 200 X Y +array double a479 2 100 200 X Y +array double a480 2 100 200 X Y +array double a481 2 100 200 X Y +array double a482 2 100 200 X Y +array double a483 2 100 200 X Y +array double a484 2 100 200 X Y +array double a485 2 100 200 X Y +array double a486 2 100 200 X Y +array double a487 2 100 200 X Y +array double a488 2 100 200 X Y +array double a489 2 100 200 X Y +array double a490 2 100 200 X Y +array double a491 2 100 200 X Y +array double a492 2 100 200 X Y +array double a493 2 100 200 X Y +array double a494 2 100 200 X Y +array double a495 2 100 200 X Y +array double a496 2 100 200 X Y +array double a497 2 100 200 X Y +array double a498 2 100 200 X Y +array double a499 2 100 200 X Y + +# Task 1 actions +app 1 + steps 3 + sleep 5.0 + # write all of io_T1 into stream_T1.bp + write manyvars.bp io_T1 + +# Task 2 actions +app 2 + steps over manyvars.bp + # read a & b from stream_T1.bp using io_T2_in definition with blocking wait + read next manyvars.bp io_T1 -1 + sleep 2.0 + + + + diff --git a/source/utils/adios_reorganize/Reorganize.cpp b/source/utils/adios_reorganize/Reorganize.cpp index be1f897b75..1e00dbb8e7 100644 --- a/source/utils/adios_reorganize/Reorganize.cpp +++ b/source/utils/adios_reorganize/Reorganize.cpp @@ -140,8 +140,17 @@ void Reorganize::Run() int curr_step = -1; while (true) { - adios2::StepStatus status = rStream.BeginStep(adios2::StepMode::Read); - if (status != adios2::StepStatus::OK) + adios2::StepStatus status = + rStream.BeginStep(adios2::StepMode::Read, 10.0); + if (status == adios2::StepStatus::NotReady) + { + if (!rank) + { + std::cout << " No new steps arrived in a while " << std::endl; + } + continue; + } + else if (status != adios2::StepStatus::OK) { break; } diff --git a/testing/adios2/engine/bp/TestBPWriteFlushRead.cpp b/testing/adios2/engine/bp/TestBPWriteFlushRead.cpp index 8bf791acdc..864e4ab7f1 100644 --- a/testing/adios2/engine/bp/TestBPWriteFlushRead.cpp +++ b/testing/adios2/engine/bp/TestBPWriteFlushRead.cpp @@ -276,7 +276,8 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2D) unsigned int t = 0; - while (bpReader.BeginStep() == adios2::StepStatus::OK) + while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == + adios2::StepStatus::OK) { const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t)); @@ -438,7 +439,8 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2D) unsigned int t = 0; - while (bpReader.BeginStep() == adios2::StepStatus::OK) + while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == + adios2::StepStatus::OK) { const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t)); @@ -743,7 +745,8 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2Dstdio) unsigned int t = 0; - while (bpReader.BeginStep() == adios2::StepStatus::OK) + while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == + adios2::StepStatus::OK) { const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t)); @@ -906,7 +909,8 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2Dstdio) unsigned int t = 0; - while (bpReader.BeginStep() == adios2::StepStatus::OK) + while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == + adios2::StepStatus::OK) { const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t)); @@ -1211,7 +1215,8 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2Dfstream) unsigned int t = 0; - while (bpReader.BeginStep() == adios2::StepStatus::OK) + while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == + adios2::StepStatus::OK) { const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t)); @@ -1374,7 +1379,8 @@ TEST_F(BPWriteFlushRead, ADIOS2BPWrite1D2Dfstream) unsigned int t = 0; - while (bpReader.BeginStep() == adios2::StepStatus::OK) + while (bpReader.BeginStep(adios2::StepMode::Read, 0.0) == + adios2::StepStatus::OK) { const size_t currentStep = bpReader.CurrentStep(); EXPECT_EQ(currentStep, static_cast(t));