From dac0b201852b113052de62232948a8e147b7b929 Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Fri, 1 Apr 2016 12:30:32 +0200 Subject: [PATCH] Revert to treating -1 as "generate a seed" in .mdp Commit 2d0247f6 changed the grompp behaviour while refactoring the rng seed setup, without mentioning it in the docs or commit message. Several of the tools also had their functionality changed, but in most cases there was no previous documentation and now there is some. However, we can't change grompp behaviour without catering for all the scripts whose behaviour would change. This change restores the previous functionality for grompp. Change-Id: Id77098e1f03ebf96207f8c9908b2dada28c59e6a --- src/gromacs/gmxpreprocess/grompp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gromacs/gmxpreprocess/grompp.cpp b/src/gromacs/gmxpreprocess/grompp.cpp index ff9613d636..fdfa16c950 100644 --- a/src/gromacs/gmxpreprocess/grompp.cpp +++ b/src/gromacs/gmxpreprocess/grompp.cpp @@ -656,7 +656,7 @@ new_status(const char *topfile, const char *topppfile, const char *confin, mass[i] = atom->m; } - if (opts->seed == 0) + if (opts->seed == -1) { opts->seed = static_cast(gmx::makeRandomSeed()); fprintf(stderr, "Setting gen_seed to %d\n", opts->seed); @@ -1585,13 +1585,13 @@ int gmx_grompp(int argc, char *argv[]) } check_ir(mdparin, ir, opts, wi); - if (ir->ld_seed == 0) + if (ir->ld_seed == -1) { ir->ld_seed = static_cast(gmx::makeRandomSeed()); fprintf(stderr, "Setting the LD random seed to %" GMX_PRId64 "\n", ir->ld_seed); } - if (ir->expandedvals->lmc_seed == 0) + if (ir->expandedvals->lmc_seed == -1) { ir->expandedvals->lmc_seed = static_cast(gmx::makeRandomSeed()); fprintf(stderr, "Setting the lambda MC random seed to %d\n", ir->expandedvals->lmc_seed); -- 2.11.4.GIT