I solved this problem by moving my checkpointing act (serialization) from
step() method to another point.
Tony, when I said "is important to verify the current step, to
decide to save or not that moment", it was in terms of the application. As a
automatic checkpoint, my application should know when (in which step) save
the simulation. This "on every X steps" approach is set in a config section,
so the application should check the current step before serialization.
Thank you all. All the information posted here were very useful for the
resolution of the problem.