From: Mark Abraham Date: Sun, 24 Jan 2016 13:07:30 +0000 (+0100) Subject: Merge branch release-5-1 X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=cae513cd275189b0adb2b4a0e4901893c761cfca;p=alexxy%2Fgromacs.git Merge branch release-5-1 Several minor clashes in md.cpp from refactoring in master branch; specifically the removal of CGLO_RERUN (adjacent to changes in release-5-1), rename of bStateFromCP to startingFromCheckpoint, change IR_NVT_TROTTER(ir) to inputrecNvtTrotter(ir), removal of bCompact. Change-Id: I42740bb6c67684f81bc305703240df4d5977bdab --- cae513cd275189b0adb2b4a0e4901893c761cfca diff --cc src/programs/mdrun/md.cpp index 5944f106c2,ce25ac7e90..61d886fee1 --- a/src/programs/mdrun/md.cpp +++ b/src/programs/mdrun/md.cpp @@@ -223,10 -174,10 +223,10 @@@ double gmx::do_md(FILE *fplog, t_commre gmx_int64_t step, step_rel; double elapsed_time; double t, t0, lam0[efptNR]; - gmx_bool bGStatEveryStep, bGStat, bCalcVir, bCalcEner; + gmx_bool bGStatEveryStep, bGStat, bCalcVir, bCalcEnerStep, bCalcEner; gmx_bool bNS, bNStList, bSimAnn, bStopCM, bRerunMD, bNotLastFrame = FALSE, - bFirstStep, bStateFromCP, bStateFromTPX, bInitStep, bLastStep, - bBornRadii, bStartingFromCpt; + bFirstStep, startingFromCheckpoint, bInitStep, bLastStep, + bBornRadii; gmx_bool bDoDHDL = FALSE, bDoFEP = FALSE, bDoExpanded = FALSE; gmx_bool do_ene, do_log, do_verbose, bRerunWarnNoV = TRUE, bForceUpdate = FALSE, bCPT; @@@ -919,7 -910,13 +919,13 @@@ bBornRadii = TRUE; } - do_log = do_per_step(step, ir->nstlog) || bFirstStep || bLastStep; + /* do_log triggers energy and virial calculation. Because this leads + * to different code paths, forces can be different. Thus for exact + * continuation we should avoid extra log output. + * Note that the || bLastStep can result in non-exact continuation + * beyond the last step. But we don't consider that to be an issue. + */ - do_log = do_per_step(step, ir->nstlog) || (bFirstStep && !bStateFromCP) || bLastStep; ++ do_log = do_per_step(step, ir->nstlog) || (bFirstStep && !startingFromCheckpoint) || bLastStep; do_verbose = bVerbose && (step % stepout == 0 || bFirstStep || bLastStep); @@@ -1032,12 -1022,22 +1035,16 @@@ { bCalcVir = TRUE; bCalcEner = TRUE; - bGStat = TRUE; } + /* Do we need global communication ? */ + bGStat = (bCalcVir || bCalcEner || bStopCM || + do_per_step(step, nstglobalcomm) || - (bVV && IR_NVT_TROTTER(ir) && do_per_step(step-1, nstglobalcomm))); - - /* these CGLO_ options remain the same throughout the iteration */ - cglo_flags = ((bRerunMD ? CGLO_RERUNMD : 0) | - (bGStat ? CGLO_GSTAT : 0) - ); ++ (EI_VV(ir->eI) && inputrecNvtTrotter(ir) && do_per_step(step-1, nstglobalcomm))); + force_flags = (GMX_FORCE_STATECHANGED | - ((DYNAMIC_BOX(*ir) || bRerunMD) ? GMX_FORCE_DYNAMICBOX : 0) | + ((inputrecDynamicBox(ir) || bRerunMD) ? GMX_FORCE_DYNAMICBOX : 0) | GMX_FORCE_ALLFORCES | - GMX_FORCE_SEPLRF | (bCalcVir ? GMX_FORCE_VIRIAL : 0) | (bCalcEner ? GMX_FORCE_ENERGY : 0) | (bDoFEP ? GMX_FORCE_DHDL : 0) @@@ -1562,28 -1604,26 +1567,26 @@@ PrintFreeEnergyInfoToFile(fplog, ir->fepvals, ir->expandedvals, ir->bSimTemp ? ir->simtempvals : NULL, &state_global->dfhist, state->fep_state, ir->nstlog, step); } - if (!(startingFromCheckpoint && (EI_VV(ir->eI)))) + if (bCalcEner) { - if (bCalcEner) - { - upd_mdebin(mdebin, bDoDHDL, TRUE, - t, mdatoms->tmass, enerd, state, - ir->fepvals, ir->expandedvals, lastbox, - shake_vir, force_vir, total_vir, pres, - ekind, mu_tot, constr); - } - else - { - upd_mdebin_step(mdebin); - } + upd_mdebin(mdebin, bDoDHDL, bCalcEnerStep, + t, mdatoms->tmass, enerd, state, + ir->fepvals, ir->expandedvals, lastbox, + shake_vir, force_vir, total_vir, pres, + ekind, mu_tot, constr); + } + else + { + upd_mdebin_step(mdebin); + } - do_dr = do_per_step(step, ir->nstdisreout); - do_or = do_per_step(step, ir->nstorireout); + gmx_bool do_dr = do_per_step(step, ir->nstdisreout); + gmx_bool do_or = do_per_step(step, ir->nstorireout); + + print_ebin(mdoutf_get_fp_ene(outf), do_ene, do_dr, do_or, do_log ? fplog : NULL, + step, t, - eprNORMAL, bCompact, mdebin, fcd, groups, &(ir->opts)); ++ eprNORMAL, mdebin, fcd, groups, &(ir->opts)); - print_ebin(mdoutf_get_fp_ene(outf), do_ene, do_dr, do_or, do_log ? fplog : NULL, - step, t, - eprNORMAL, mdebin, fcd, groups, &(ir->opts)); - } if (ir->bPull) { pull_print_output(ir->pull_work, step, t);