Skip to content

Commit

Permalink
Merge pull request #2637 from JasonRuonanWang/dataman
Browse files Browse the repository at this point in the history
removed dataman handshake timeout
  • Loading branch information
JasonRuonanWang authored Feb 22, 2021
2 parents b92a2e8 + 31168e1 commit b04d420
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
28 changes: 5 additions & 23 deletions source/adios2/engine/dataman/DataManReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,14 @@ DataManReader::DataManReader(IO &io, const std::string &name,
timeAfterRequest - timeBeforeRequest)
.count();

auto startTime = std::chrono::system_clock::now();

while (reply == nullptr or reply->empty())
{
timeBeforeRequest = std::chrono::system_clock::now();
reply = m_Requester.Request("Handshake", 9);
auto nowTime = std::chrono::system_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::seconds>(
nowTime - startTime);
roundLatency = duration.count() * 1000;
if (duration.count() > m_Timeout)
{
m_InitFailed = true;
return;
}
timeAfterRequest = std::chrono::system_clock::now();
roundLatency = std::chrono::duration_cast<std::chrono::milliseconds>(
timeAfterRequest - timeBeforeRequest)
.count();
}

nlohmann::json message = nlohmann::json::parse(reply->data());
Expand Down Expand Up @@ -146,18 +140,6 @@ StepStatus DataManReader::BeginStep(StepMode stepMode,
timeout = m_Timeout;
}

if (m_InitFailed)
{
if (m_Verbosity >= 5)
{
std::cout << "DataManReader::BeginStep(), Rank " << m_MpiRank
<< " returned EndOfStream due "
"to initialization failure"
<< std::endl;
}
return StepStatus::EndOfStream;
}

if (m_CurrentStep >= m_FinalStep and m_CurrentStep >= 0)
{
if (m_Verbosity >= 5)
Expand Down
1 change: 0 additions & 1 deletion source/adios2/engine/dataman/DataManReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class DataManReader : public Engine
int m_MpiRank;
int m_MpiSize;
int64_t m_CurrentStep = -1;
bool m_InitFailed = false;
std::atomic<size_t> m_FinalStep;
format::DmvVecPtr m_CurrentStepMetadata;

Expand Down

0 comments on commit b04d420

Please sign in to comment.