message: simplified the copy logic
diff: @@ -41,8 +41,6 @@ void SscWriter::PutDeferredCommon(Variable<T> &variable, const T *data)
  variable.m_Shape.push_back(1);
  }
  - if (m_CurrentStep == 0)
  - {
  bool found = false;
  for (const auto &b : m_GlobalWritePattern[m_StreamRank])
  {
  @@ -51,10 +49,14 @@ void SscWriter::PutDeferredCommon(Variable<T> &variable, const T *data)
  ssc::AreSameDims(variable.m_Count, b.count) and
  ssc::AreSameDims(variable.m_Shape, b.shape))
  {
  + std::memcpy(m_Buffer.data() + b.bufferStart, data, b.bufferCount);
  found = true;
  }
  }
  +
  if (not found)
  + {
  + if (m_CurrentStep == 0)
  {
  m_GlobalWritePattern[m_StreamRank].emplace_back();
  auto &b = m_GlobalWritePattern[m_StreamRank].back();
  @@ -66,26 +68,14 @@ void SscWriter::PutDeferredCommon(Variable<T> &variable, const T *data)
  b.bufferStart = m_Buffer.size();
  b.bufferCount = ssc::TotalDataSize(b.count, b.type);
  m_Buffer.resize(b.bufferStart + b.bufferCount);
  - }
  - }
  -
  - bool found = false;
  - for (const auto &b : m_GlobalWritePattern[m_StreamRank])
  - {
  - if (b.name == variable.m_Name and
  - ssc::AreSameDims(variable.m_Start, b.start) and
  - ssc::AreSameDims(variable.m_Count, b.count) and
  - ssc::AreSameDims(variable.m_Shape, b.shape))
  - {
  std::memcpy(m_Buffer.data() + b.bufferStart, data, b.bufferCount);
  - found = true;
  - }
  }
  - if (not found)
  + else
  {
  throw std::runtime_error("ssc only accepts fixed IO pattern");
  }
  }
  +}
  } // end namespace engine
  } // end namespace core
  