Clarify checkpoint mismatch error, and enable in release
authorPascal Merz <pascal.merz@me.com>
Sat, 5 Dec 2020 01:07:13 +0000 (18:07 -0700)
committerPascal Merz <pascal.merz@me.com>
Sat, 5 Dec 2020 01:07:13 +0000 (18:07 -0700)
As of GROMACS 2021, checkpoint files written with the modular and the
legacy codepath need to be continued with the same code path. The
respective check was not executed in release mode, which would lead
to less descriptive errors.

Also reworded the error to guide users how they can solve the problem.

src/gromacs/fileio/checkpoint.cpp

index abd957f09a5fe1a30a48f7f5f2fb9a3d63784942..d6a4239647596194ae3ce1ceeb6f1f1cf0c28aae 100644 (file)
@@ -2591,12 +2591,24 @@ static void read_checkpoint(const char*                    fn,
                   fn);
     }
 
-    GMX_ASSERT(!(headerContents->isModularSimulatorCheckpoint && !useModularSimulator),
-               "Checkpoint file was written by modular simulator, but the current simulation uses "
-               "the legacy simulator.");
-    GMX_ASSERT(!(!headerContents->isModularSimulatorCheckpoint && useModularSimulator),
-               "Checkpoint file was written by legacy simulator, but the current simulation uses "
-               "the modular simulator.");
+    GMX_RELEASE_ASSERT(!(headerContents->isModularSimulatorCheckpoint && !useModularSimulator),
+                       "Checkpoint file was written by modular simulator, but the current "
+                       "simulation uses the legacy simulator.\n\n"
+                       "Try the following steps:\n"
+                       "1. Make sure the GMX_DISABLE_MODULAR_SIMULATOR environment variable is not "
+                       "set to return to the default behavior. Retry running the simulation.\n"
+                       "2. If the problem persists, set the environment variable "
+                       "GMX_USE_MODULAR_SIMULATOR=ON to overwrite the default behavior and use "
+                       "modular simulator for all implemented use cases.");
+    GMX_RELEASE_ASSERT(!(!headerContents->isModularSimulatorCheckpoint && useModularSimulator),
+                       "Checkpoint file was written by legacy simulator, but the current "
+                       "simulation uses the modular simulator.\n\n"
+                       "Try the following steps:\n"
+                       "1. Make sure the GMX_USE_MODULAR_SIMULATOR environment variable is not set "
+                       "to return to the default behavior. Retry running the simulation.\n"
+                       "2. If the problem persists, set the environment variable "
+                       "GMX_DISABLE_MODULAR_SIMULATOR=ON to overwrite the default behavior and use "
+                       "legacy simulator for all implemented use cases.");
 
     if (MASTER(cr))
     {