don't print nonbonded kernel info with GMX_NO_NONBONDED
authorSzilard Pall <pszilard@cbr.su.se>
Wed, 28 Nov 2012 00:44:52 +0000 (01:44 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 29 Nov 2012 01:34:07 +0000 (02:34 +0100)
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
src/gmxlib/nonbonded/nonbonded.c
src/mdlib/forcerec.c

index c210e21046a97a8995d0175b6d61f28362e775bb..350f6834c0a486c2375422d6e976795a9e241210 100644 (file)
@@ -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"
index d9434f0cfd75c7bddf3f30899bb5b2dab6b27ded..28b69812547e65415c9ac342e424ec0cbe86b8af 100644 (file)
@@ -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"
index 61e008ff65dfd8e195860c3f830500d0d04c119f..af40936dfb2886d97992a2a375e4d2df14d8c216 100644 (file)
@@ -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;
             }