fixed incorrect virial and pressure averages
authorBerk Hess <hess@hess.theophys.kth.se>
Wed, 23 Feb 2011 12:51:24 +0000 (13:51 +0100)
committerBerk Hess <hess@hess.theophys.kth.se>
Wed, 23 Feb 2011 12:51:24 +0000 (13:51 +0100)
Removed a second, incorrect setting of flags for storage of energy averages
in mdrun.
This would cause incorrect averages of the virial and pressure to be stored
in the energy file and printed at the end of the log file when the lowest
common denominator of nstcomm, nsttcouple and/or nstpcouple was less than
nstcalcenergy. Note that the instantaneous values and the actual simulation
results were all correct.
Additionally there was a potential issue with parallel checkpoint signalling
with -gcom larger than nstlist which could lead to hanging of mdrun.
This fixes #696

src/kernel/md.c

index b476249a207907c063a24854b4893ff308d553bb..a967f6b24a98ef8940f1f5b537ed8ff6861a0220 100644 (file)
@@ -2235,27 +2235,6 @@ double do_md(FILE *fplog,t_commrec *cr,int nfile,const t_filenm fnm[],
         }
         /*  ################## END TRAJECTORY OUTPUT ################ */
         
-        /* Determine the pressure:
-         * always when we want exact averages in the energy file,
-         * at ns steps when we have pressure coupling,
-         * otherwise only at energy output steps (set below).
-         */
-    
-        bNstEner = (bGStatEveryStep || do_per_step(step,ir->nstcalcenergy));
-        bCalcEnerPres = bNstEner;
-        
-        /* Do we need global communication ? */
-        bGStat = (bGStatEveryStep || bStopCM || bNS ||
-                  (ir->nstlist == -1 && !bRerunMD && step >= nlh.step_nscheck));
-        
-        do_ene = (do_per_step(step,ir->nstenergy) || bLastStep);
-        
-        if (do_ene || do_log)
-        {
-            bCalcEnerPres = TRUE;
-            bGStat        = TRUE;
-        }
-
         /* Determine the wallclock run time up till now */
         run_time = gmx_gettime() - (double)runtime->real;