message: revised for set_selection() then put_deferred() sequence
diff: @@ -137,10 +137,13 @@ void HDF5ReaderP::UseHDFRead(Variable<T> &variable, T *data, hid_t h5Type)
  int ts = 0;
  // T *values = data;
  size_t variableStart = variable.m_StepsStart;
  + /*
  + // looks like m_StepsStart is defaulted to be 0 now.
  if (!m_InStreamMode && (variableStart == 1))
  { // variableBase::m_StepsStart min=1
  variableStart = 0;
  }
  + */
  while (ts < variable.m_StepsCount)
  {
  @@ -361,6 +364,35 @@ void HDF5ReaderP::PerformGets()
  ADIOS2_FOREACH_TYPE_1ARG(declare_type)
  #undef declare_type
  -void HDF5ReaderP::DoClose(const int transportIndex) { m_H5File.Close(); }
  +void HDF5ReaderP::DoClose(const int transportIndex)
  +{
  + // printf("ReaderP::DoClose() %lu\n", m_DeferredStack.size());
  + if (m_DeferredStack.size() > 0)
  + {
  + if (m_InStreamMode)
  + {
  + PerformGets();
  + }
  + else
  + {
  +#define declare_type(T) \
  + for (std::string variableName : m_DeferredStack) \
  + { \
  + Variable<T> *var = m_IO.InquireVariable<T>(variableName); \
  + if (var != nullptr) \
  + { \
  + hid_t h5Type = m_H5File.GetHDF5Type<T>(); \
  + UseHDFRead(*var, var->GetData(), h5Type); \
  + break; \
  + } \
  + }
  + ADIOS2_FOREACH_TYPE_1ARG(declare_type)
  +#undef declare_type
  + m_DeferredStack.clear();
  + }
  + }
  +
  + m_H5File.Close();
  +}
  } // end namespace adios2
  