Document required position restraint files
authorErik Lindahl <erik@kth.se>
Tue, 2 Jan 2018 23:41:17 +0000 (00:41 +0100)
committerErik Lindahl <erik@kth.se>
Tue, 2 Jan 2018 23:41:17 +0000 (00:41 +0100)
Explain properly to users why the files are
suddenly required when it has worked fine without
them for a decade.

Fixes #2237.

Change-Id: I7990994d2da1f1af95b07bb0110b9bfdd89f3e25

src/gromacs/gmxpreprocess/grompp.cpp

index 001650d494176a853b54876f092c5f2f431dd081..30cbe16288dbf5f2a5a459d4fe059e73d5011887 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -2003,9 +2003,26 @@ int gmx_grompp(int argc, char *argv[])
         const char *fn = opt2fn("-r", NFILE, fnm);
         const char *fnB;
 
+        if (!gmx_fexist(fn))
+        {
+            gmx_fatal(FARGS,
+                      "Cannot find position restraint file %s (option -r).\n"
+                      "From GROMACS-2018, you need to specify the position restraint "
+                      "coordinate files explicitly to avoid mistakes, although you can "
+                      "still use the same file as you specify for the -c option.", fn);
+        }
+
         if (opt2bSet("-rb", NFILE, fnm))
         {
             fnB = opt2fn("-rb", NFILE, fnm);
+            if (!gmx_fexist(fnB))
+            {
+                gmx_fatal(FARGS,
+                          "Cannot find B-state position restraint file %s (option -rb).\n"
+                          "From GROMACS-2018, you need to specify the position restraint "
+                          "coordinate files explicitly to avoid mistakes, although you can "
+                          "still use the same file as you specify for the -c option.", fn);
+            }
         }
         else
         {