From: Timo Heister Date: Fri, 8 Nov 2019 19:25:49 +0000 (-0500) Subject: remove TimerOutput error spam X-Git-Tag: v9.2.0-rc1~887^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9025%2Fhead;p=dealii.git remove TimerOutput error spam TimerOutput produces output on each MPI rank when an exception is thrown. This makes looking at output with 100k MPI ranks somewhat annoying. Fix this by only outputting on rank 0. This assumes that also rank 0 triggers this exception, which might not be true. In that case, we would likely deadlock anyways... --- diff --git a/source/base/timer.cc b/source/base/timer.cc index 1e7cedd05b..f83ba7d1a6 100644 --- a/source/base/timer.cc +++ b/source/base/timer.cc @@ -389,18 +389,18 @@ TimerOutput::~TimerOutput() if (std::uncaught_exception() == true && mpi_communicator != MPI_COMM_SELF) # endif { - std::cerr << "---------------------------------------------------------" - << std::endl - << "TimerOutput objects finalize timed values printed to the" - << std::endl - << "screen by communicating over MPI in their destructors." - << std::endl - << "Since an exception is currently uncaught, this" << std::endl - << "synchronization (and subsequent output) will be skipped to" - << std::endl - << "avoid a possible deadlock." << std::endl - << "---------------------------------------------------------" - << std::endl; + const unsigned int myid = + Utilities::MPI::this_mpi_process(mpi_communicator); + if (myid == 0) + std::cerr + << "---------------------------------------------------------\n" + << "TimerOutput objects finalize timed values printed to the\n" + << "screen by communicating over MPI in their destructors.\n" + << "Since an exception is currently uncaught, this\n" + << "synchronization (and subsequent output) will be skipped\n" + << "to avoid a possible deadlock.\n" + << "---------------------------------------------------------" + << std::endl; } else {