Made mdrun warn when generic kernels are used
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 17 Jun 2014 14:33:49 +0000 (16:33 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 18 Jun 2014 06:26:14 +0000 (08:26 +0200)
mdrun now issues a warning if the generic group-scheme, or plain-C
Verlet-scheme kernels actually did some work. Such kernels should not
be called during routine use of mdrun.

It would be possible to do the check for the use of the generic
group-scheme kernel earlier in mdrun, but it's not easy to ensure we
only write the output at the first such step. Given that the group
scheme is deprecated, warning only at the end is sufficiently nice
behaviour.

Change-Id: Ib9b15165e53510f537687a4b448aaa01f1418522

src/gromacs/gmxlib/nrnb.c
src/gromacs/mdlib/forcerec.c

index d0d118d8d93297a9a932ae62f8e498b8b6b56c1c..2fc17779590a6a28ad22ce86429eae99e3a50348 100644 (file)
@@ -425,6 +425,15 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
         fprintf(out, " %-32s %16s %15.3f  %6.1f\n",
                 "Total", "", *mflop, tfrac);
         fprintf(out, "%s\n\n", myline);
+
+        if (nrnb->n[eNR_NBKERNEL_GENERIC] > 0)
+        {
+            fprintf(out,
+                    "WARNING: Using the slow generic C kernel. This is fine if you are\n"
+                    "comparing different implementations or MD software. Routine\n"
+                    "simulations should use a different non-bonded setup for much better\n"
+                    "performance.\n\n");
+        }
     }
 }
 
index 8db62ab92d8cc649abe64b7c8ae31f4cefd44611..165a1243d27201af1d4efbcb463b2a6848e07185 100644 (file)
@@ -1775,6 +1775,15 @@ static void pick_nbnxn_kernel(FILE                *fp,
                 lookup_nbnxn_kernel_name(*kernel_type),
                 nbnxn_kernel_pairlist_simple(*kernel_type) ? NBNXN_CPU_CLUSTER_I_SIZE : NBNXN_GPU_CLUSTER_SIZE,
                 nbnxn_kernel_to_cj_size(*kernel_type));
+
+        if (nbnxnk4x4_PlainC == *kernel_type ||
+            nbnxnk8x8x8_PlainC == *kernel_type)
+        {
+            md_print_warn(cr, fp,
+                          "WARNING: Using the slow %s kernels. This should\n"
+                          "not happen during routine usage on supported platforms.\n\n",
+                          lookup_nbnxn_kernel_name(*kernel_type));
+        }
     }
 }