Commit df9e12e7 authored by Ruonan Wang's avatar Ruonan Wang Committed by Wang, Ruonan
Browse files

removed HasBlock

parent 46b917b7
......@@ -82,9 +82,6 @@ private:
template <class T>
void PutDeferredCommon(Variable<T> &variable, const T *values);
template <class T>
bool HasBlock(const Variable<T> &variable);
void CalculatePosition(ssc::BlockVecVec &writerMapVec,
ssc::BlockVecVec &readerMapVec, const int writerRank,
ssc::RankPosMap &allOverlapRanks);
......
......@@ -21,27 +21,13 @@ namespace core
namespace engine
{
template <class T>
bool SscWriter::HasBlock(const Variable<T> &variable)
{
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))
{
return true;
}
}
return false;
}
template <class T>
void SscWriter::PutDeferredCommon(Variable<T> &variable, const T *data)
{
TAU_SCOPED_TIMER_FUNC();
variable.SetData(data);
if (variable.m_Start.empty())
{
variable.m_Start.push_back(0);
......@@ -57,7 +43,18 @@ void SscWriter::PutDeferredCommon(Variable<T> &variable, const T *data)
if (m_CurrentStep == 0)
{
if (not HasBlock(variable))
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))
{
found = true;
}
}
if (not found)
{
m_GlobalWritePattern[m_StreamRank].emplace_back();
auto &b = m_GlobalWritePattern[m_StreamRank].back();
......@@ -72,8 +69,6 @@ void SscWriter::PutDeferredCommon(Variable<T> &variable, const T *data)
}
}
variable.SetData(data);
bool found = false;
for (const auto &b : m_GlobalWritePattern[m_StreamRank])
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment