message: added conditions for the four types of variables
diff: @@ -32,34 +32,45 @@ void SscWriter::PutDeferredCommon(Variable<T> &variable, const T *data)
  Dims vStart = variable.m_Start;
  Dims vCount = variable.m_Count;
  Dims vShape = variable.m_Shape;
  - if (!helper::IsRowMajor(m_IO.m_HostLanguage))
  +
  + if (vStart.empty() && vCount.empty() && !vShape.empty() &&
  + vShape[0] == LocalValueDim)
  {
  - std::reverse(vStart.begin(), vStart.end());
  - std::reverse(vCount.begin(), vCount.end());
  - std::reverse(vShape.begin(), vShape.end());
  + // local single value
  + throw(std::runtime_error(
  + "local single value is not yet supported in SSC"));
  }
  -
  - if (vStart.empty())
  + else if (vStart.empty() && !vCount.empty() && vShape.empty())
  {
  - vStart.push_back(0);
  + // local array
  + throw(std::runtime_error("local array is not yet supported in SSC"));
  }
  - if (vCount.empty())
  + else if (vStart.empty() && vCount.empty() && vShape.empty())
  {
  - vCount.push_back(1);
  + // global single value
  + throw(std::runtime_error(
  + "global single value is not yet supported in SSC"));
  }
  - if (vShape.empty())
  + else if (!vStart.empty() && !vCount.empty() && !vShape.empty())
  {
  - vShape.push_back(1);
  + // global array
  + if (!helper::IsRowMajor(m_IO.m_HostLanguage))
  + {
  + std::reverse(vStart.begin(), vStart.end());
  + std::reverse(vCount.begin(), vCount.end());
  + std::reverse(vShape.begin(), vShape.end());
  }
  bool found = false;
  for (const auto &b : m_GlobalWritePattern[m_StreamRank])
  {
  - if (b.name == variable.m_Name and ssc::AreSameDims(vStart, b.start) and
  + if (b.name == variable.m_Name and
  + ssc::AreSameDims(vStart, b.start) and
  ssc::AreSameDims(vCount, b.count) and
  ssc::AreSameDims(vShape, b.shape))
  {
  - std::memcpy(m_Buffer.data() + b.bufferStart, data, b.bufferCount);
  + std::memcpy(m_Buffer.data() + b.bufferStart, data,
  + b.bufferCount);
  found = true;
  }
  }
  @@ -78,7 +89,8 @@ 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);
  - std::memcpy(m_Buffer.data() + b.bufferStart, data, b.bufferCount);
  + std::memcpy(m_Buffer.data() + b.bufferStart, data,
  + b.bufferCount);
  }
  else
  {
  @@ -86,6 +98,7 @@ void SscWriter::PutDeferredCommon(Variable<T> &variable, const T *data)
  }
  }
  }
  +}
  } // end namespace engine
  } // end namespace core
  