From 467c7e88c350ced4e75a259da8b691b29cb1aec7 Mon Sep 17 00:00:00 2001 From: Szilard Pall Date: Wed, 28 Nov 2012 01:44:52 +0100 Subject: [PATCH] don't print nonbonded kernel info with GMX_NO_NONBONDED Also moves all group kernel details from log to debug. We should put back a one line group kernel message in log. Change-Id: I2a90554b9efa75fd4fb2df9c1ba17fd5f626e390 --- src/gmxlib/nonbonded/nb_kernel.c | 5 +++-- src/gmxlib/nonbonded/nonbonded.c | 4 ++-- src/mdlib/forcerec.c | 18 ++++++++++++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/gmxlib/nonbonded/nb_kernel.c b/src/gmxlib/nonbonded/nb_kernel.c index c210e21046..350f6834c0 100644 --- a/src/gmxlib/nonbonded/nb_kernel.c +++ b/src/gmxlib/nonbonded/nb_kernel.c @@ -28,6 +28,7 @@ #include "nb_kernel.h" #include "smalloc.h" #include "string2.h" +#include "gmx_fatal.h" /* Static data structures to find kernels */ @@ -161,9 +162,9 @@ nb_kernel_list_findkernel(FILE * log, index = (index+1) % kernel_list_hash_size; } - if(log && kernelinfo_ptr!=NULL) + if(debug && kernelinfo_ptr!=NULL) { - fprintf(log, + fprintf(debug, "NB kernel %s() with architecture '%s' used for neighborlist with\n" " Elec: '%s', Modifier: '%s'\n" " Vdw: '%s', Modifier: '%s'\n" diff --git a/src/gmxlib/nonbonded/nonbonded.c b/src/gmxlib/nonbonded/nonbonded.c index d9434f0cfd..28b6981254 100644 --- a/src/gmxlib/nonbonded/nonbonded.c +++ b/src/gmxlib/nonbonded/nonbonded.c @@ -260,9 +260,9 @@ gmx_nonbonded_set_kernel_pointers(FILE *log, t_nblist *nl) nl->kernelptr_vf = gmx_nb_generic_kernel; nl->kernelptr_f = gmx_nb_generic_kernel; nl->simd_padding_width = 1; - if(log) + if(debug) { - fprintf(log, + fprintf(debug, "WARNING - Slow generic NB kernel used for neighborlist with\n" " Elec: '%s', Modifier: '%s'\n" " Vdw: '%s', Modifier: '%s'\n" diff --git a/src/mdlib/forcerec.c b/src/mdlib/forcerec.c index 61e008ff65..af40936dfb 100644 --- a/src/mdlib/forcerec.c +++ b/src/mdlib/forcerec.c @@ -1465,7 +1465,8 @@ static void pick_nbnxn_kernel(FILE *fp, gmx_bool use_cpu_acceleration, gmx_bool *bUseGPU, int *kernel_type, - int *ewald_excl) + int *ewald_excl, + gmx_bool bDoNonbonded) { gmx_bool bEmulateGPU, bGPU, bEmulateGPUEnvVarSet; char gpu_err_str[STRLEN]; @@ -1484,7 +1485,7 @@ static void pick_nbnxn_kernel(FILE *fp, * automatically switch to emulation if non-bonded calculations are * turned off via GMX_NO_NONBONDED - this is the simple and elegant * way to turn off GPU initialization, data movement, and cleanup. */ - bEmulateGPU = (bEmulateGPUEnvVarSet || (getenv("GMX_NO_NONBONDED") != NULL && bGPU)); + bEmulateGPU = (bEmulateGPUEnvVarSet || (!bDoNonbonded && bGPU)); /* Enable GPU mode when GPUs are available or GPU emulation is requested. * The latter is useful to assess the performance one can expect by adding @@ -1520,7 +1521,10 @@ static void pick_nbnxn_kernel(FILE *fp, { *kernel_type = nbk8x8x8_PlainC; - md_print_warn(cr, fp, "Emulating a GPU run on the CPU (slow)"); + if (bDoNonbonded) + { + md_print_warn(cr, fp, "Emulating a GPU run on the CPU (slow)"); + } } else if (bGPU) { @@ -1540,7 +1544,7 @@ static void pick_nbnxn_kernel(FILE *fp, } } - if (fp != NULL) + if (bDoNonbonded && fp != NULL) { if (MASTER(cr)) { @@ -1755,7 +1759,8 @@ static void init_nb_verlet(FILE *fp, pick_nbnxn_kernel(fp, cr, fr->hwinfo, fr->use_cpu_acceleration, &nbv->bUseGPU, &nbv->grp[i].kernel_type, - &nbv->grp[i].ewald_excl); + &nbv->grp[i].ewald_excl, + fr->bNonbonded); } else /* non-local */ { @@ -1765,7 +1770,8 @@ static void init_nb_verlet(FILE *fp, pick_nbnxn_kernel(fp, cr, fr->hwinfo, fr->use_cpu_acceleration, NULL, &nbv->grp[i].kernel_type, - &nbv->grp[i].ewald_excl); + &nbv->grp[i].ewald_excl, + fr->bNonbonded); bHybridGPURun = TRUE; } -- 2.22.0