From cbab5cd824cd0df312b9bf6d3808a3fc959a945a Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Tue, 17 Jun 2014 16:33:49 +0200 Subject: [PATCH] Made mdrun warn when generic kernels are used 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 | 9 +++++++++ src/gromacs/mdlib/forcerec.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/gromacs/gmxlib/nrnb.c b/src/gromacs/gmxlib/nrnb.c index d0d118d8d9..2fc1777959 100644 --- a/src/gromacs/gmxlib/nrnb.c +++ b/src/gromacs/gmxlib/nrnb.c @@ -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"); + } } } diff --git a/src/gromacs/mdlib/forcerec.c b/src/gromacs/mdlib/forcerec.c index 8db62ab92d..165a1243d2 100644 --- a/src/gromacs/mdlib/forcerec.c +++ b/src/gromacs/mdlib/forcerec.c @@ -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)); + } } } -- 2.22.0