From f59f6ec6e04f4a3732876c2c76250b8444fdcb69 Mon Sep 17 00:00:00 2001 From: Andrey Alekseenko Date: Wed, 13 Oct 2021 19:30:13 +0200 Subject: [PATCH] Improve stability of ContinuationIsExact tests The default nstlist value in tests is set to 8. This is appropriate for NormalIntegrators/MdrunNoAppendContinuationIsExact tests, which do the restart after 8 steps, so the "full" trajectory and the "restarted" trajectory update their lists at the same time. However, pairlist tuning often increases the nstlist value, which might affect the "full" run. Here, we force the nstlist to be half the nsteps for the "full" run by setting it via CLI option. --- src/programs/mdrun/tests/exactcontinuation.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/programs/mdrun/tests/exactcontinuation.cpp b/src/programs/mdrun/tests/exactcontinuation.cpp index efd2e80645..8b4b8f051f 100644 --- a/src/programs/mdrun/tests/exactcontinuation.cpp +++ b/src/programs/mdrun/tests/exactcontinuation.cpp @@ -252,6 +252,8 @@ void runTest(TestFileManager* fileManager, EXPECT_EQ(0, runner->callGrompp(caller)); } + const std::string splitPoint = std::to_string(std::stoi(mdpFieldValues.at("nsteps")) / 2); + // prepare the .tpr file for the first part of the two-part run { // TODO evolve grompp to report the number of warnings issued, so @@ -261,7 +263,7 @@ void runTest(TestFileManager* fileManager, caller.addOption("-maxwarn", maxWarningsTolerated); runner->useTopGroAndNdxFromDatabase(simulationName); auto firstPartMdpFieldValues = mdpFieldValues; - firstPartMdpFieldValues["nsteps"] = std::to_string(std::stoi(mdpFieldValues.at("nsteps")) / 2); + firstPartMdpFieldValues["nsteps"] = splitPoint; runner->useStringAsMdpFile(prepareMdpFileContents(firstPartMdpFieldValues)); runner->tprFileName_ = firstPartRunTprFileName; EXPECT_EQ(0, runner->callGrompp(caller)); @@ -273,6 +275,9 @@ void runTest(TestFileManager* fileManager, runner->edrFileName_ = fullRunEdrFileName; CommandLine fullRunCaller; fullRunCaller.append("mdrun"); + /* Force neighborlist update at the beginning of the second half of the trajectory. + * Doing so through CLI options prevents pairlist tuning from changing it. */ + fullRunCaller.addOption("-nstlist", splitPoint); ASSERT_EQ(0, runner->callMdrun(fullRunCaller)); } -- 2.22.0