From 6c3552025eca5078c501879488640f44cd57bef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20H=C3=A9nin?= Date: Mon, 11 May 2026 16:45:04 +0200 Subject: [PATCH 1/2] Fix: better test for MTS eABF compare time step factor to proxy instead of 1 to enable again eABF with globalMasterFrequency Fixes #931 --- src/colvarbias_abf.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/colvarbias_abf.cpp b/src/colvarbias_abf.cpp index f5278bb9f..c91acdc8d 100644 --- a/src/colvarbias_abf.cpp +++ b/src/colvarbias_abf.cpp @@ -126,8 +126,12 @@ int colvarbias_abf::init(std::string const &conf) // If any colvar does not have current-step total force, then // we can't do step 0 data provide(f_cvb_step_zero_data, false); - // And we cannot do MTS either - if (time_step_factor > 1) { + // This ABF implementation assumes that the total force available at one time step (where ABF runs) + // is that from the previous timestep where ABF ran + // So we cannot do MTS with a larger factor than the global proxy MTS factor + // (That would require the colvar to update its total force at a time step where it doesn't run + // or to remember its value from the timestep when the total force is collected) + if (time_step_factor != cvmodule->proxy->time_step_factor()) { return cvmodule->error("Error: ABF cannot use timeStepFactor > 1 because " + colvars[i]->description + " does not provide total force estimates for the current timestep.\n"); From 5c998a557cc00a797cd7ddb700ad36f90e1c5253 Mon Sep 17 00:00:00 2001 From: Giacomo Fiorin Date: Wed, 20 May 2026 10:31:11 -0400 Subject: [PATCH 2/2] doc: More informative error message --- src/colvarbias_abf.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/colvarbias_abf.cpp b/src/colvarbias_abf.cpp index c91acdc8d..48e7fe29b 100644 --- a/src/colvarbias_abf.cpp +++ b/src/colvarbias_abf.cpp @@ -126,15 +126,18 @@ int colvarbias_abf::init(std::string const &conf) // If any colvar does not have current-step total force, then // we can't do step 0 data provide(f_cvb_step_zero_data, false); - // This ABF implementation assumes that the total force available at one time step (where ABF runs) - // is that from the previous timestep where ABF ran - // So we cannot do MTS with a larger factor than the global proxy MTS factor - // (That would require the colvar to update its total force at a time step where it doesn't run - // or to remember its value from the timestep when the total force is collected) + // This ABF implementation assumes that the total force available at one time step (where ABF + // runs) is that from the previous timestep where ABF ran So we cannot do MTS with a different + // factor than the global proxy MTS factor (That would require the colvar to update its total + // force at a time step where it doesn't run or to remember its value from the timestep when + // the total force is collected) if (time_step_factor != cvmodule->proxy->time_step_factor()) { - return cvmodule->error("Error: ABF cannot use timeStepFactor > 1 because " + - colvars[i]->description + - " does not provide total force estimates for the current timestep.\n"); + return cvmodule->error( + "ABF cannot use timeStepFactor == " + cvm::to_str(time_step_factor) + + " because the MD engine is sharing total forces every " + + cvm::to_str(cvmodule->proxy->time_step_factor()) + " steps; therefore, the colvar " + + colvars[i]->description + + " cannot provide total-force estimates for the timestep when ABF runs"); } }