From 86729b89f16ae9c5bbc1dbe912e225e2f63c16d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Szil=C3=A1rd=20P=C3=A1ll?= Date: Mon, 19 Jun 2017 23:37:44 +0200 Subject: [PATCH] Re-enable lost DD warning + minor code modernization After the message got refactored in 147de64 the dd_warn() call was left out and therefore a DD warning message would get assembled but never printed. Change-Id: I860f52cf7b15e18b8a3533237dcc217b3b844b7e --- src/gromacs/domdec/domdec.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gromacs/domdec/domdec.cpp b/src/gromacs/domdec/domdec.cpp index 33479e98c0..a67795f897 100644 --- a/src/gromacs/domdec/domdec.cpp +++ b/src/gromacs/domdec/domdec.cpp @@ -6724,14 +6724,15 @@ static void turn_on_dlb(FILE *fplog, t_commrec *cr, gmx_int64_t step) cellsize_min = std::min(cellsize_min, comm->cellsize_min[dd->dim[d]]); } + /* Turn off DLB if we're too close to the cell size limit. */ if (cellsize_min < comm->cellsize_limit*1.05) { - char buf[STRLEN]; - sprintf(buf, "step %" GMX_PRId64 " Measured %.1f %% performance load due to load imbalance, but the minimum cell size is smaller than 1.05 times the cell size limit. Will no longer try dynamic load balancing.\n", step, dd_force_imb_perf_loss(dd)*100); + auto str = gmx::formatString("step %" GMX_PRId64 " Measured %.1f %% performance loss due to load imbalance, " + "but the minimum cell size is smaller than 1.05 times the cell size limit." + "Will no longer try dynamic load balancing.\n", step, dd_force_imb_perf_loss(dd)*100); + dd_warning(cr, fplog, str.c_str()); - /* Change DLB from "auto" to "no". */ comm->dlbState = edlbsOffForever; - return; } -- 2.11.4.GIT