espressomd / espresso

The ESPResSo package
https://espressomd.org
GNU General Public License v3.0
222 stars 183 forks source link

has_checkpoint overlooking existing checkpoint not indexed 0 #4939

Open RebeccaStephan opened 2 weeks ago

RebeccaStephan commented 2 weeks ago

When checkpointing via checkpoint.save, espresso creates a new checkpoint under the given checkpoint id with incremented index. It seems like has_checkpoint only recognizes a checkpoint if the indices start at 0. When where is only a checkpoint with higher index present it wrongly returns False.

jngrad commented 1 week ago

The checkpointing Python file is a bit obscure, but the relevant part should be this loop: https://github.com/espressomd/espresso/blob/1d5a2e31f7fb1faf526a8ef63d59e670b01380c6/src/python/espressomd/checkpointing.py#L67-L71 Looks like it should only detect a checkpoint with index 1 if there is also a checkpoint with index 0.

Do you know why your checkpoint folder lost the file with index 0?