Add helpful note about changed default behaviour
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 8 Jan 2014 15:35:44 +0000 (16:35 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 8 Jan 2014 23:13:40 +0000 (00:13 +0100)
The kind of short .mdp file that might historically have been used for
tests, tutorials or benchmarks used to trigger the group cut-off
scheme up to and including 4.6, because it was either the only
behaviour or the default. Only one year later, the default has changed
to be the Verlet scheme, which might lead to confusion and/or invalid
comparisons. This note will hopefully help people start to understand
any differences.

Refs #1414

Change-Id: I34a2f1c17d4b58e14f81a95c1df3659f13a6cf24

src/gromacs/gmxlib/readinp.c
src/gromacs/gmxpreprocess/readir.c
src/gromacs/legacyheaders/readinp.h

index 514e28d8e179931ec1b47d844cedca30a03c8300..a8a46d66b00aa32e0b7735f4f322668ea1e6e226 100644 (file)
 #include "warninp.h"
 #include "gmx_fatal.h"
 
-/* find an entry; return index, or -1 if not found */
-static int search_einp(int ninp, const t_inpfile *inp, const char *name);
-
-
 t_inpfile *read_inpfile(const char *fn, int *ninp,
                         warninp_t wi)
 {
@@ -312,7 +308,7 @@ void replace_inp_entry(int ninp, t_inpfile *inp, const char *old_entry, const ch
     }
 }
 
-static int search_einp(int ninp, const t_inpfile *inp, const char *name)
+int search_einp(int ninp, const t_inpfile *inp, const char *name)
 {
     int i;
 
index becdc4eca5c9240b44fbbde64d565fc7eda74b1f..c908679bdaaeffc70b6e55700b37bf561dab6978 100644 (file)
@@ -1699,6 +1699,18 @@ void get_ir(const char *mdparin, const char *mdparout,
     snew(dumstr[0], STRLEN);
     snew(dumstr[1], STRLEN);
 
+    if (-1 == search_einp(ninp, inp, "cutoff-scheme"))
+    {
+        sprintf(warn_buf,
+                "%s did not specify a value for the .mdp option "
+                "\"cutoff-scheme\". Probably it was first intended for use "
+                "with GROMACS before 4.6. In 4.6, the Verlet scheme was "
+                "introduced, but the group scheme was still the default. "
+                "The default is now the Verlet scheme, so you will observe "
+                "different behaviour.", mdparin);
+        warning_note(wi, warn_buf);
+    }
+
     /* remove the following deprecated commands */
     REM_TYPE("title");
     REM_TYPE("cpp");
index 538da4e2f7e01284660e2775bb46e15662ac3e72..2031e1502818e28feee8b1ea2bae5fe8f2c57207 100644 (file)
@@ -72,6 +72,10 @@ void write_inpfile(const char *fn, int ninp, t_inpfile inp[],
 void replace_inp_entry(int ninp, t_inpfile *inp,
                        const char *old_entry, const char *new_entry);
 
+int search_einp(int ninp, const t_inpfile *inp, const char *name);
+/* Return the index of an .mdp field with the given name within the
+ * inp array, if it exists. Return -1 if it does not exist. */
+
 int get_eint(int *ninp, t_inpfile **inp, const char *name, int def,
              warninp_t wi);