plumed2 icon indicating copy to clipboard operation
plumed2 copied to clipboard

Possible issue with first hill in METAD

Open GiovanniBussi opened this issue 8 years ago • 2 comments

I open a new issue related to something that was pointed out by @ceriottm (also mentioned in the unrelated #262)

I copy here a text that Michele sent me by email:

Basically, if you restart a calculation and a hill should be deposited
on the very first step, it is not deposited because there is an
"isFirstStep" flag that is set regardless of whether this is a new
calculation or a restart. It is easy to fix this, but there are many
ways to fix it -- from checking that the step counter is greater than
zero rather than checking this flag, to setting this flag to false if
we are restarting.

I think the problem is related to the fact that isFirstStep is updated in the update() call, whereas probably it should be updated in calculate(). Indeed, it is not just the first deposited hill that should be skipped, but just that at the first step of the current MD simulation the hill should not be deposited. I did not try it yet though.

Any comment on this?

GiovanniBussi avatar Aug 27 '17 10:08 GiovanniBussi

An additional note: based on the code (I did not try) I guess that with the current implementation if we have PACE=100 and we restart at a step such as 2050, the hill at 2100 will be incorrectly skipped. If this is true, this should be considered as a bug and fixed (in v2.3 then merged to v2.4 and master)

GiovanniBussi avatar Aug 27 '17 11:08 GiovanniBussi

Just to give some context, I was testing the implementation of a direct PLUMED call from i-PI based on the Python bindings, and I noticed that simulations were not reproducible if I restarted. The only scenario in which I could see the current behavior as correct is if the host code calls plumed every time the force is called regardless of whether it's at the start or at the end of a step - so there could be some subtleties.

On 27 August 2017 at 13:07, Giovanni [email protected] wrote:

An additional note: based on the code (I did not try) I guess that with the current implementation if we have PACE=100 and we restart at a step such as 2050, the hill at 2100 will be incorrectly skipped. If this is true, this should be considered as a bug and fixed (in v2.3 then merged to v2.4 and master)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/plumed/plumed2/issues/267#issuecomment-325191687, or mute the thread https://github.com/notifications/unsubscribe-auth/ABESZ3pnOOef0IQF3enHiMtQRvcxbF-hks5scU3kgaJpZM4PDxKm .

ceriottm avatar Aug 27 '17 17:08 ceriottm