Having both environment variables GMX_USE_MODULAR_SIMULATOR=ON and
GMX_DISABLE_MODULAR_SIMULATOR=ON set has no defined behavior and
should therefore yield an error. This change adds a release assert
to ensure this.
Change-Id: I1df0d94da7312d6c31e7e520db6c0186707b3cac
const auto modularSimulatorExplicitlyTurnedOff =
(getenv("GMX_DISABLE_MODULAR_SIMULATOR") != nullptr);
+ GMX_RELEASE_ASSERT(
+ !(modularSimulatorExplicitlyTurnedOn && modularSimulatorExplicitlyTurnedOff),
+ "Cannot have both GMX_USE_MODULAR_SIMULATOR=ON and GMX_DISABLE_MODULAR_SIMULATOR=ON. "
+ "Unset one of the two environment variables to explicitly chose which simulator to use, "
+ "or unset both to recover default behavior.");
+
GMX_RELEASE_ASSERT(
!(modularSimulatorExplicitlyTurnedOff && inputrec->eI == eiVV && inputrec->epc == epcPARRINELLORAHMAN),
"Cannot use a Parrinello-Rahman barostat with md-vv and GMX_DISABLE_MODULAR_SIMULATOR=ON, "