Merge branch release-2018
[alexxy/gromacs.git] / src / gromacs / tools / check.cpp
index 691d0b136d8b829d94cdb3b4578891d7fbcba0d0..d7429f6a2c40228e69bdc6b0ffd073e3dbe000b7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, 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.
@@ -831,7 +831,11 @@ int gmx_check(int argc, char *argv[])
         "virtual sites. With these flags, [TT]gmx check[tt] provides a quick check for such problems.[PAR]",
         "The program can compare two run input ([REF].tpr[ref])",
         "files",
-        "when both [TT]-s1[tt] and [TT]-s2[tt] are supplied.",
+        "when both [TT]-s1[tt] and [TT]-s2[tt] are supplied. When comparing",
+        "run input files this way, the default relative tolerance is reduced",
+        "to 0.000001 and the absolute tolerance set to zero to find any differences",
+        "not due to minor compiler optimization differences, although you can",
+        "of course still set any other tolerances through the options."
         "Similarly a pair of trajectory files can be compared (using the [TT]-f2[tt]",
         "option), or a pair of energy files (using the [TT]-e2[tt] option).[PAR]",
         "For free energy simulations the A and B state topology from one",
@@ -915,6 +919,16 @@ int gmx_check(int argc, char *argv[])
             }
             fn2 = nullptr;
         }
+
+        fprintf(stderr, "Note: When comparing run input files, default tolerances are reduced.\n");
+        if (!opt2parg_bSet("-tol", asize(pa), pa))
+        {
+            ftol = 0.000001;
+        }
+        if (!opt2parg_bSet("-abstol", asize(pa), pa))
+        {
+            abstol = 0;
+        }
         comp_tpx(fn1, fn2, bRMSD, ftol, abstol);
     }
     else if (fn1 && tex)