From df5479404d0025d40c6edc89138545c2906b18e4 Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Tue, 8 Aug 2017 02:15:54 +0200 Subject: [PATCH] Remove duplicate GPU non-usage hint 5bef33832c removed the behaviour where mdrun would hint to the user that compatible GPUs were found, even though the simulation would not use them (for various possible reasons). That was unintended and wrong, however, that report was already duplicated for both rerun with energy groups, and the group scheme, by logic called earlier from runner(). So we can just remove this hint. Minor cleanup to the way local variables are created and used. Change-Id: I7a5f61c3384dba5eec9f049169f3c32f3d00f4f8 --- src/gromacs/hardware/printhardware.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/gromacs/hardware/printhardware.cpp b/src/gromacs/hardware/printhardware.cpp index 6cdc812651..d9291f6aea 100644 --- a/src/gromacs/hardware/printhardware.cpp +++ b/src/gromacs/hardware/printhardware.cpp @@ -130,30 +130,11 @@ void reportGpuUsage(const gmx::MDLogger &mdlog, size_t numPpRanks, bool bPrintHostName) { - int ngpu_comp = gpu_info.n_dev_compatible; - char host[STRLEN]; - if (gpuTaskAssignment.empty()) { return; } - if (bPrintHostName) - { - gmx_gethostname(host, STRLEN); - } - - // TODO The logic for gpuTaskAssignment here and just above is faulty - /* Issue a note if GPUs are available but not used */ - if (ngpu_comp > 0 && gpuTaskAssignment.empty()) - { - auto message = gmx::formatString("%d compatible GPU%s detected in the system, but none will be used.\n" - "Consider trying GPU acceleration with the Verlet scheme!\n", - ngpu_comp, (ngpu_comp > 1) ? "s" : ""); - GMX_LOG(mdlog.warning).appendText(message); - return; - } - std::string output; { std::string gpuIdsString = @@ -163,6 +144,8 @@ void reportGpuUsage(const gmx::MDLogger &mdlog, if (bPrintHostName) { + char host[STRLEN]; + gmx_gethostname(host, STRLEN); output += gmx::formatString("On host %s", host); } output += gmx::formatString("%zu GPU%s %sselected for this run.\n" @@ -183,7 +166,7 @@ void reportGpuUsage(const gmx::MDLogger &mdlog, same_count > 1 ? "GPU IDs" : "a GPU ID"); } - if (static_cast(ngpu_comp) > numPpRanks) + if (static_cast(gpu_info.n_dev_compatible) > numPpRanks) { /* TODO In principle, this warning could be warranted only on * ranks on some nodes, but we lack the infrastructure to do a -- 2.11.4.GIT