message: still trying to fix the bp4 bug that fails test BPWriteReadAsStreamTestADIOS2.ADIOS2BPWriteRead1D8_BP4, not fixed yet
diff: @@ -53,19 +53,42 @@ typename core::Variable<T>::Info &
  BP4Deserializer::InitVariableBlockInfo(core::Variable<T> &variable, T *data)
  {
  const size_t stepsStart = variable.m_StepsStart;
  - const auto &indices = variable.m_AvailableStepBlockIndexOffsets;
  - // bp4 starts at step "1"
  - auto itStep = indices.find(stepsStart + 1);
  + const size_t stepsCount = variable.m_StepsCount;
  +
  if (m_DebugMode)
  + {
  + const auto &indices = variable.m_AvailableStepBlockIndexOffsets;
  + const size_t maxStep = indices.rbegin()->first;
  + if (stepsStart + 1 > maxStep)
  + {
  + throw std::invalid_argument(
  + "ERROR: steps start " + std::to_string(stepsStart) +
  + " from SetStepsSelection or BeginStep is larger than "
  + "the maximum available step " +
  + std::to_string(maxStep - 1) + " for variable " +
  + variable.m_Name + ", in call to Get\n");
  + }
  +
  + auto itStep = std::next(indices.begin(), stepsStart);
  +
  + for (auto i = 0; i < stepsCount; ++i)
  {
  if (itStep == indices.end())
  {
  - throw std::invalid_argument("ERROR: step start in Variable " +
  - variable.m_Name +
  - " is invalid, in call to Get\n");
  + throw std::invalid_argument(
  + "ERROR: offset " + std::to_string(i) +
  + " from steps start " + std::to_string(stepsStart) +
  + " in variable " + variable.m_Name +
  + " is beyond the largest available step = " +
  + std::to_string(maxStep - 1) +
  + ", check Variable SetStepSelection argument stepsCount "
  + "(random access), or "
  + "number of BeginStep calls (streaming), in call to Get");
  }
  + ++itStep;
  }
  - const size_t stepsCount = variable.m_StepsCount;
  + }
  +
  // create block info
  return variable.SetBlockInfo(data, stepsStart, stepsCount);
  }
  