From 34eddd6ea939ddd18266c28ead863a1d7c8077e7 Mon Sep 17 00:00:00 2001 From: David van der Spoel Date: Sun, 22 Jun 2014 22:30:51 +0200 Subject: [PATCH] Implemented fatal error for nstcalcenergy!=1 with shells. The combination of using shell particles with a value for nstcalcenergy that is different from 1 leads to energies not being communicated around on a parallel machine and hence a meaningless shell relaxation procedure. This patch will just bail out with a fatal error if the combination is detected. Fixes #1376. Change-Id: Ia54f1480b2358355438acb5de31dfa56b7f8d603 --- src/kernel/md.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kernel/md.c b/src/kernel/md.c index 8909fb8ed7..c9415eee96 100644 --- a/src/kernel/md.c +++ b/src/kernel/md.c @@ -347,7 +347,10 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[], (ir->bContinuation || (DOMAINDECOMP(cr) && !MASTER(cr))) ? NULL : state_global->x); - + if (shellfc && ir->nstcalcenergy != 1) + { + gmx_fatal(FARGS, "You have nstcalcenergy set to a value (%d) that is different from 1.\nThis is not supported in combinations with shell particles.\nPlease make a new tpr file.", ir->nstcalcenergy); + } if (shellfc && ir->eI == eiNM) { /* Currently shells don't work with Normal Modes */ -- 2.22.0