From 76d6c7303e950f2838b2764d06ff4ebee52658d0 Mon Sep 17 00:00:00 2001 From: Roland Schulz Date: Fri, 15 Apr 2016 13:16:37 -0700 Subject: [PATCH] Tune nstlist increase for KNL Change-Id: If4162c307fd9b31f7a76a18ee8a1fa45830559e1 --- src/programs/mdrun/runner.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/programs/mdrun/runner.cpp b/src/programs/mdrun/runner.cpp index 3f3ebf803b..c567e546d8 100644 --- a/src/programs/mdrun/runner.cpp +++ b/src/programs/mdrun/runner.cpp @@ -65,6 +65,7 @@ #include "gromacs/gmxlib/md_logging.h" #include "gromacs/gmxlib/network.h" #include "gromacs/gpu_utils/gpu_utils.h" +#include "gromacs/hardware/cpuinfo.h" #include "gromacs/hardware/detecthardware.h" #include "gromacs/listed-forces/disre.h" #include "gromacs/listed-forces/orires.h" @@ -316,6 +317,11 @@ const int nstlist_try[] = { 20, 25, 40 }; static const float nbnxn_cpu_listfac_ok = 1.05; //! Too high performance ratio beween force calc and neighbor searching static const float nbnxn_cpu_listfac_max = 1.09; +/* CPU: pair-search is about a factor 2-3 slower than the non-bonded kernel */ +//! Max OK performance ratio beween force calc and neighbor searching +static const float nbnxn_knl_listfac_ok = 1.22; +//! Too high performance ratio beween force calc and neighbor searching +static const float nbnxn_knl_listfac_max = 1.3; /* GPU: pair-search is a factor 1.5-3 slower than the non-bonded kernel */ //! Max OK performance ratio beween force calc and neighbor searching static const float nbnxn_gpu_listfac_ok = 1.20; @@ -326,7 +332,7 @@ static const float nbnxn_gpu_listfac_max = 1.30; static void increase_nstlist(FILE *fp, t_commrec *cr, t_inputrec *ir, int nstlist_cmdline, const gmx_mtop_t *mtop, matrix box, - gmx_bool bGPU) + gmx_bool bGPU, const gmx::CpuInfo &cpuinfo) { float listfac_ok, listfac_max; int nstlist_orig, nstlist_prev; @@ -407,6 +413,11 @@ static void increase_nstlist(FILE *fp, t_commrec *cr, listfac_ok = nbnxn_gpu_listfac_ok; listfac_max = nbnxn_gpu_listfac_max; } + else if (cpuinfo.feature(gmx::CpuInfo::Feature::X86_Avx512ER)) + { + listfac_ok = nbnxn_knl_listfac_ok; + listfac_max = nbnxn_knl_listfac_max; + } else { listfac_ok = nbnxn_cpu_listfac_ok; @@ -536,7 +547,8 @@ static void prepare_verlet_scheme(FILE *fplog, int nstlist_cmdline, const gmx_mtop_t *mtop, matrix box, - gmx_bool bUseGPU) + gmx_bool bUseGPU, + const gmx::CpuInfo &cpuinfo) { /* For NVE simulations, we will retain the initial list buffer */ if (EI_DYNAMICS(ir->eI) && @@ -576,7 +588,7 @@ static void prepare_verlet_scheme(FILE *fplog, if (EI_DYNAMICS(ir->eI)) { /* Set or try nstlist values */ - increase_nstlist(fplog, cr, ir, nstlist_cmdline, mtop, box, bUseGPU); + increase_nstlist(fplog, cr, ir, nstlist_cmdline, mtop, box, bUseGPU, cpuinfo); } } @@ -763,7 +775,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt, prepare_verlet_scheme(fplog, cr, inputrec, nstlist_cmdline, mtop, state->box, - bUseGPU); + bUseGPU, *hwinfo->cpuInfo); } else { -- 2.11.4.GIT