Project

General

Profile

Bug #2950

wrong temperature reported at end of sim with uneven number of steps

Added by Marvin Bernhardt 7 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

For one of my simulations i get a temperature of 3000 K reported for the last bit of 333333 steps, where it was equilibrated around 298.15 K before.

I tried to reproduce this with 333 steps, but that did not result in a spike. Therefore I include the ener.edr file. Using gmx dump, one sees the spike is in the .edr file, so this is not a problem of gmx energy.

ener.edr (822 KB) ener.edr Marvin Bernhardt, 05/13/2019 03:06 PM
grompp.mdp (540 Bytes) grompp.mdp Marvin Bernhardt, 05/13/2019 03:06 PM
conf.gro (3.05 MB) conf.gro Marvin Bernhardt, 05/13/2019 03:06 PM
ffbonded.itp (205 KB) ffbonded.itp Marvin Bernhardt, 05/13/2019 03:07 PM
ffnonbonded.itp (61.5 KB) ffnonbonded.itp Marvin Bernhardt, 05/13/2019 03:07 PM
forcefield.itp (862 Bytes) forcefield.itp Marvin Bernhardt, 05/13/2019 03:07 PM
MET.itp (880 Bytes) MET.itp Marvin Bernhardt, 05/13/2019 03:07 PM
SOL.itp (1.09 KB) SOL.itp Marvin Bernhardt, 05/13/2019 03:07 PM
topol.top (135 Bytes) topol.top Marvin Bernhardt, 05/13/2019 03:07 PM
ener_3333steps.edr (9.67 KB) ener_3333steps.edr Paul Bauer, 07/08/2019 12:58 PM
3355.tpr (1.08 MB) 3355.tpr Paul Bauer, 07/08/2019 01:42 PM
ener_3355steps.edr (9.67 KB) ener_3355steps.edr Paul Bauer, 07/08/2019 01:43 PM
md_3355steps.log (52.1 KB) md_3355steps.log Paul Bauer, 07/08/2019 01:43 PM

Associated revisions

Revision 147f664d (diff)
Added by Pascal Merz 2 months ago

Output correct kinetic at last step (modular simulator)

This replicates the fix in I9a0bc228 for the modular simulator.

Fixes a bug which would write an incorrect kinetic energy and
temperature to the energy and log files when using the leap-frog
integrator and having a last step not coinciding with an energy
calculation step.

Refs #2950

Change-Id: I9969fa8114240145d9aa84f381a898bbb7570b75

Revision a2afb057 (diff)
Added by Berk Hess 2 months ago

Always output correct kinetic at last step

When the last step did not coincide with an energy calculation step,
the kinetic energy and temperature written to the energy and log
file were incorrect when using the leap frog integrator.

Fixes #2950

Change-Id: I9a0bc2280235f233a37cd3b2cd03d9d5067bd4f9

History

#1 Updated by Paul Bauer 5 months ago

I just reproduced this with 3333 steps in a debug build on my machine.

#2 Updated by Paul Bauer 5 months ago

so, investigating further I found that the only thing significantly diverging between the average and final write step energies is the kinetic energy contribution

The results here are from extending the previous 3333 step run to 3355 steps to have a fast reproducer

   Energies (kJ/mol)
           Bond          Angle Ryckaert-Bell.          LJ-14     Coulomb-14
    5.87965e+03    3.71328e+04    6.73000e+03    0.00000e+00    6.87208e+04
        LJ (SR)   Coulomb (SR)   Coul. recip.      Potential    Kinetic En.
   -8.25315e+03   -2.94160e+05    2.65487e+03   -1.81295e+05    1.66365e+06
   Total Energy  Conserved En.    Temperature Pressure (bar)   Constr. rmsd
    1.48235e+06    1.48278e+06    4.63189e+03    4.11956e+04    1.81575e-06

        <======  ###############  ==>
        <====  A V E R A G E S  ====>
        <==  ###############  ======>

        Statistics over 3356 steps using 34 frames

   Energies (kJ/mol)
           Bond          Angle Ryckaert-Bell.          LJ-14     Coulomb-14
    6.11285e+03    3.70713e+04    6.90941e+03    0.00000e+00    6.86842e+04
        LJ (SR)   Coulomb (SR)   Coul. recip.      Potential    Kinetic En.
   -8.27930e+03   -2.93863e+05    2.67504e+03   -1.80689e+05    1.07054e+05
   Total Energy  Conserved En.    Temperature Pressure (bar)   Constr. rmsd
   -7.36357e+04   -7.37932e+04    2.98057e+02   -2.11207e+01    0.00000e+00

The kinetic energy seems to be wrong by a factor of 10.

#3 Updated by Paul Bauer 2 months ago

@Berk, could this just be an issue with the summation?

#4 Updated by Paul Bauer 2 months ago

  • Status changed from Accepted to Fix uploaded
  • Assignee changed from Paul Bauer to Berk Hess

#5 Updated by Paul Bauer 2 months ago

#6 Updated by Marvin Bernhardt 2 months ago

Any tip on how to provoke the wrong temperature without running all 333333 steps?
I tried with 3333 steps, but don't get a spike with a not-fixed-2019.3
I also had a look at the fix, but I do not really get what the expression

step_rel + 1 == ir->nsteps

does.

#7 Updated by Berk Hess 2 months ago

  • Status changed from Fix uploaded to Resolved

#8 Updated by Paul Bauer 2 months ago

  • Status changed from Resolved to Closed

#9 Updated by Marvin Bernhardt 2 months ago

Thanks for taking care of this.

Also available in: Atom PDF