Skip to content

Checkpointing: How to update iT when loading a checkpoint file?

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Checkpointing: How to update iT when loading a checkpoint file?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6896

    Dear OpenLB Community,

    I’d like to use the checkpointing feature of OpenLB for my long duration simulations. I had two questions about this:

    1) After loading the checkpoint file, I understand that I need to update the time step (iT) to the last time step in the checkpoint file:
    iT = LAST_TIME_STEP_IN_THE_CHECKPOINT_FILE;
    timer.update(iT);
    I was wondering whether it’s possible to call the last time step from the checkpoint file? Is there any function available for this purpose?

    2) What is the purpose of the function “postLoad()” implemented in the SuperLattice class? Is it necessary to be called just after loading the checkpoint file? I checked the Developer Guide however did not find any information.

    Thanks very much for your time and I’ll be looking forward to hearing from you.

    Kind Regards,
    Mehrdad

    #6904
    Adrian
    Keymaster

    The current timestep is a concept that is handled in the specific application case, so you can handle it however you want. The Timer is currently not serializable but this should be straight forward to change – if you are interested in this I can help you with further steps.

    The basic approach for checkpointing is to 1) write out the lattice checkpoint periodically using SuperLattice::save and 2) to only load it after the simulation has been constructed fully (i.e. prepareLattice has been called). The restarted simulation also has to use exactly the same cuboid decomposition (commonly derived from the number of MPI processes). You can try this out in e.g. examples/laminar/bstep(2,3)d.

    The overriden Serializable::postLoad method is needed to reinitialize the population structure after loading the checkpoint. It is called automatically by the serializer so you do not have to care about it if you only want to save and reload checkpoints.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.