Fix #3694
authorPascal Merz <pascal.merz@me.com>
Wed, 30 Sep 2020 03:26:19 +0000 (21:26 -0600)
committerPaul Bauer <paul.bauer.q@gmail.com>
Wed, 30 Sep 2020 07:03:59 +0000 (07:03 +0000)
This fixes #3694 by moving the initialization of the `isInputCompatible`
boolean to its first use in modularsimulator.cpp.

Closes #3694

src/gromacs/modularsimulator/modularsimulator.cpp

index bc49d4665cb1145941880b23a426d2c988f728c5..2b31b9f11eee7a81cf79026c5d164e555f9cd751 100644 (file)
@@ -185,8 +185,6 @@ bool ModularSimulator::isInputCompatible(bool                             exitOn
         return condition;
     };
 
-    bool isInputCompatible = true;
-
     // GMX_USE_MODULAR_SIMULATOR allows to use modular simulator also for non-standard uses,
     // such as the leap-frog integrator
     const auto modularSimulatorExplicitlyTurnedOn = (getenv("GMX_USE_MODULAR_SIMULATOR") != nullptr);
@@ -209,11 +207,9 @@ bool ModularSimulator::isInputCompatible(bool                             exitOn
             "as the Parrinello-Rahman barostat is not implemented in the legacy simulator. Unset "
             "GMX_DISABLE_MODULAR_SIMULATOR or use a different pressure control algorithm.");
 
-    isInputCompatible =
-            isInputCompatible
-            && conditionalAssert(
-                       inputrec->eI == eiMD || inputrec->eI == eiVV,
-                       "Only integrators md and md-vv are supported by the modular simulator.");
+    bool isInputCompatible = conditionalAssert(
+            inputrec->eI == eiMD || inputrec->eI == eiVV,
+            "Only integrators md and md-vv are supported by the modular simulator.");
     isInputCompatible = isInputCompatible
                         && conditionalAssert(inputrec->eI != eiMD || modularSimulatorExplicitlyTurnedOn,
                                              "Set GMX_USE_MODULAR_SIMULATOR=ON to use the modular "