From 3a9f8f76ea899d37c9367d9c95b0df0a8f9addfa Mon Sep 17 00:00:00 2001 From: Willem Deconinck Date: Mon, 6 May 2024 14:11:50 +0200 Subject: [PATCH] Add more verbosity to eckit_test_mpi to diagnose intermittent failures (#47) --- tests/mpi/eckit_test_mpi.cc | 39 ++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/tests/mpi/eckit_test_mpi.cc b/tests/mpi/eckit_test_mpi.cc index cb900e2d6..7469316ad 100644 --- a/tests/mpi/eckit_test_mpi.cc +++ b/tests/mpi/eckit_test_mpi.cc @@ -942,6 +942,9 @@ CASE("test_probe") { comm.barrier(); + std::stringstream errstr; + bool error = false; + auto count = nproc; while (count > 0) { auto status = comm.probe(comm.anySource(), comm.anyTag()); @@ -952,11 +955,20 @@ CASE("test_probe") { EXPECT(sz == 1); comm.receive(&data[status.source()], sz, status.source(), status.tag()); + errstr << "[test_probe:" << irank << "] receive data["< sts = comm.waitAll(requests); @@ -964,6 +976,9 @@ CASE("test_probe") { for (auto& st : sts) { EXPECT(st.error() == 0); } + + comm.barrier(); + EXPECT(!error); } CASE("test_iProbe") { @@ -982,6 +997,9 @@ CASE("test_iProbe") { comm.barrier(); + std::stringstream errstr; + bool error = false; + auto count = nproc; while (count > 0) { auto status = comm.iProbe(comm.anySource(), comm.anyTag()); @@ -996,12 +1014,20 @@ CASE("test_iProbe") { EXPECT(sz == 1); comm.receive(&data[status.source()], sz, status.source(), status.tag()); - + errstr << "[test_iProbe:" << irank << "] receive data["< sts = comm.waitAll(requests); @@ -1009,6 +1035,9 @@ CASE("test_iProbe") { for (auto& st : sts) { EXPECT(st.error() == 0); } + + comm.barrier(); + EXPECT(!error); } //----------------------------------------------------------------------------------------------------------------------