From e071d94ff496acb76d0df11dc6a72e2b385453b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Szil=C3=A1rd=20P=C3=A1ll?= Date: Tue, 2 Feb 2021 13:09:58 +0000 Subject: [PATCH] Improve DLB recommendation Do not recommend turning on DLB when it was turned off due to a condition known to make it unsuitable to use in the run. Fixes #3879 --- src/gromacs/domdec/partition.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gromacs/domdec/partition.cpp b/src/gromacs/domdec/partition.cpp index b295040db7..67a79d8e85 100644 --- a/src/gromacs/domdec/partition.cpp +++ b/src/gromacs/domdec/partition.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -1082,7 +1082,7 @@ static void print_dd_load_av(FILE* fplog, gmx_domdec_t* dd) fprintf(fplog, "\n"); fprintf(stderr, "\n"); - if (lossFraction >= DD_PERF_LOSS_WARN) + if ((lossFraction >= DD_PERF_LOSS_WARN) && (dd->comm->dlbState != DlbState::offTemporarilyLocked)) { std::string message = gmx::formatString( "NOTE: %.1f %% of the available CPU time was lost due to load imbalance\n" @@ -1090,9 +1090,16 @@ static void print_dd_load_av(FILE* fplog, gmx_domdec_t* dd) lossFraction * 100); bool hadSuggestion = false; - if (!isDlbOn(comm)) + if (dd->comm->dlbState == DlbState::offUser) { - message += " You might want to use dynamic load balancing (option -dlb.)\n"; + message += " You might want to allow dynamic load balancing (option -dlb auto.)\n"; + hadSuggestion = true; + } + else if (dd->comm->dlbState == DlbState::offCanTurnOn) + { + message += + " Dynamic load balancing was automatically disabled, but it might be " + "beneficial to manually tuning it on (option -dlb on.)\n"; hadSuggestion = true; } else if (dlbWasLimited) @@ -1108,7 +1115,6 @@ static void print_dd_load_av(FILE* fplog, gmx_domdec_t* dd) " considerable inhomogeneity in the simulated system.", hadSuggestion ? "also " : ""); - fprintf(fplog, "%s\n", message.c_str()); fprintf(stderr, "%s\n", message.c_str()); } -- 2.22.0