Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added more explicit error messages for MpiHandsake #2346

Merged
merged 1 commit into from
Jun 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions source/adios2/helper/adiosMpiHandshake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,16 @@ void MpiHandshake::Test()
}
}

bool MpiHandshake::Check(const std::string &filename)
bool MpiHandshake::Check(const std::string &filename, const bool verbose)
{
int m_Verbosity = 1;

Test();

// check if RendezvousAppCount reached

if (m_WritersMap[filename].size() + m_ReadersMap[filename].size() !=
m_RendezvousAppCounts[filename])
{
if (m_Verbosity >= 10)
if (verbose)
{
std::cout << "MpiHandshake Rank " << m_WorldRank << " Stream "
<< filename << ": " << m_WritersMap[filename].size()
Expand Down Expand Up @@ -212,14 +210,15 @@ void MpiHandshake::Handshake(const std::string &filename, const char mode,
// wait and check if required RendezvousAppCount reached

auto startTime = std::chrono::system_clock::now();
while (!Check(filename))
while (!Check(filename, false))
{
std::this_thread::sleep_for(std::chrono::microseconds(100));
auto nowTime = std::chrono::system_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::seconds>(
nowTime - startTime);
if (duration.count() > timeoutSeconds)
{
Check(filename, true);
throw(std::runtime_error("Mpi handshake timeout on Rank" +
std::to_string(m_WorldRank) +
" for Stream " + filename));
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/helper/adiosMpiHandshake.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class MpiHandshake

private:
static void Test();
static bool Check(const std::string &filename);
static bool Check(const std::string &filename, const bool verbose);
static size_t PlaceInBuffer(const size_t stream, const int rank);
static void PrintMaps();
static void PrintMaps(const int printRank, const std::string &filename);
Expand Down