diff --git a/patches/gromacs-5.1.2.diff/src/programs/mdrun/md.cpp b/patches/gromacs-5.1.2.diff/src/programs/mdrun/md.cpp index 7af01c2a57fc05aea99fb6c7a5bfa41b91773283..430c006c8e6bcf97c73372eddc53f349d8d64922 100644 --- a/patches/gromacs-5.1.2.diff/src/programs/mdrun/md.cpp +++ b/patches/gromacs-5.1.2.diff/src/programs/mdrun/md.cpp @@ -1096,7 +1096,8 @@ double do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[], GMX_FORCE_VIRIAL | GMX_FORCE_ENERGY | GMX_FORCE_DHDL | - GMX_FORCE_NS); + GMX_FORCE_NS | + ( ( fr->bTwinRange && do_per_step(step, ir->nstcalclr) ) ? GMX_FORCE_DO_LR :0) ); plumed_cmd(plumedmain,"GREX cacheLocalUSwap",&hrex_enerd->term[F_EPOT]); sfree(hrex_enerd); diff --git a/patches/gromacs-5.1.2.diff/src/programs/mdrun/repl_ex.cpp b/patches/gromacs-5.1.2.diff/src/programs/mdrun/repl_ex.cpp index 63eac8236921fb0dbc752d02315f01aea7a09acf..e799bc66964a891d20d901b8fd0e543a9cfc03a3 100644 --- a/patches/gromacs-5.1.2.diff/src/programs/mdrun/repl_ex.cpp +++ b/patches/gromacs-5.1.2.diff/src/programs/mdrun/repl_ex.cpp @@ -895,6 +895,11 @@ static real calc_delta(FILE *fplog, gmx_bool bPrint, struct gmx_repl_ex *re, int { fprintf(fplog, "Repl %d <-> %d dE_term = %10.3e (kT)\n", a, b, delta); } + +/* this is necessary because with plumed HREX the energy contribution is + already taken into account */ + if(plumed_hrex) delta=0.0; + if (re->bNPT) { /* revist the calculation for 5.0. Might be some improvements. */ @@ -1117,9 +1122,6 @@ test_for_replica_exchange(FILE *fplog, if (i % 2 == m) { delta = calc_delta(fplog, bPrint, re, a, b, a, b); -/* this is necessary because with plumed HREX the energy contribution is - already taken into account */ - if(plumed_hrex) delta=0.0; /* PLUMED */ if(plumedswitch){ diff --git a/user-doc/tutorials/hrex.txt b/user-doc/tutorials/hrex.txt index 4e18296e7a49b27498d2fef2d5b1e7ad24ceca82..b3c4f6f754d853899499e9a9d5c3401f9f41d8a1 100644 --- a/user-doc/tutorials/hrex.txt +++ b/user-doc/tutorials/hrex.txt @@ -132,13 +132,22 @@ Notice that total cell could be charged. This happens whenever the scaled portio is not neutral. There should be no problem in this. When used with pbc, GROMACS will add a compensating background. -Suggested checks: +Suggested check: - Try with several identical force fields (hardcode the same lambda for all replicas in the script above) and different seed/starting point. Acceptance should be 1.0 +Notice that when you run with GPUs acceptance could be different from 1.0. +The reason is that to compute the acceptance GROMACS is sending the coordinates to the neighboring +replicas which then recompute energy. If all the tpr files are identical, one would expect +energy to be identically to the originally computed one. However, calculations +made with GPUs are typically not reproducible to machine precision. For a large system, even +an error in the total energy for the last significant digit could be on the order of a kJ. +This results in practice in a lower acceptance. The error induced on the final ensemble is +expected to be very small. + + Warnings: - Topologies should have the same number of atoms, same masses and same constraint topology -- Acceptance is not computed correctly if rcoulomb!=rvdw. - Choose neighbor list update (nstlist) that divides replex. Notice that running with GPUs GROMACS is going to change nstlist automatically, be sure that it still divides replex. - Option -hrex requires also option -plumed. If you do not care about plumed, just provide an empty