Removed reduction of dH/dl without FE
authorBerk Hess <hess@kth.se>
Mon, 9 Mar 2015 14:45:46 +0000 (15:45 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 19 Mar 2015 12:42:20 +0000 (13:42 +0100)
Removed call to sum_dhdl when not doing free-energy calculations.
This call could take measurable time at high parallelization.

Refs #1694

Change-Id: I268ffea8ea008f20e192c7ce683ce8f6bee9e759

src/programs/mdrun/md.cpp

index 6a92f66f7d70c3438aabdfb5067f1a0290e836e5..b58a1844346e14b417507eecac5866a24f2173ec 100644 (file)
@@ -1234,7 +1234,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
                 saved_conserved_quantity -= enerd->term[F_DISPCORR];
             }
             /* sum up the foreign energy and dhdl terms for vv.  currently done every step so that dhdl is correct in the .edr */
-            if (!bRerunMD)
+            if (ir->efep != efepNO && !bRerunMD)
             {
                 sum_dhdl(enerd, state->lambda, ir->fepvals);
             }
@@ -1552,7 +1552,7 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[],
         }
         /* TODO remove the brace above, once iteration is removed */
 
-        if (!bVV || bRerunMD)
+        if (ir->efep != efepNO && (!bVV || bRerunMD))
         {
             /* Sum up the foreign energy and dhdl terms for md and sd.
                Currently done every step so that dhdl is correct in the .edr */