checkpoint cctk_delta_time in PUGH

Issue #1533 closed
Roland Haas created an issue

the PUGH driver currently does not checkpoint the stepsize which makes using it with adaptive timestepping hard. Carpet on the other hand checkpoints the stepsize.

The attached patch writes cckt_delta_time into checkpoints. When reading a checkpoint file that does not set the timestep, the user will see level 1 warning that the attribute cctk_delta_time was not found but the code will not abort and will behave as it does right now otherwise (which is to use cctk_delta_time based on the values from parameters/set in basegrid).

Keyword: IOHDF5Util

Comments (6)

  1. Erik Schnetter
    • removed comment

    You write cctk_time and cctk_delta_time into the same attribute. Is there a particular reason for this? Otherwise I find it cleaner to use a separate attribute named "cctk_delta"time". This would also be automatically ignored when read from older versions of PUGH. You would read this attribute with a construct equivalent to

              bool file_exists;
              H5E_BEGIN_TRY {
                file_exists = H5Fis_hdf5(name.c_str()) > 0;
              } H5E_END_TRY;
              if (not file_exists) {
    

    that ensures that HDF5 will not abort on errors.

  2. Roland Haas reporter
    • removed comment

    I am not sure I fully understand your comment Erik. Are you asking why the code uses a single buffer of 2 CCTK_REAL to hold cctk_delta_time and cctk_time when read from the file? It uses a single buffer since the the read-in value is broadcast using MPI and I'd have had to add a second broadcast call for cctk_delta_time otherwise. This is the same logic that is used for the integer attributes "main_loop_index" and "cctk_iteration".

    There are separate attributes "cctk_delta_time" and "cctk_time" in the file, not a single attribute with two values in it.

    Was that what you were asking?

    I actually do want it to output a warning when a checkpoint file that does not contain cctk_delta_time is read. Otherwise it silently uses the incorrect cctk_delta_time. This would only be an issue for "old" checkpoint files since the new ones will always contain the attribute. Storing cctk_delta_time is not a new feature, it's a bugfix.

  3. Roland Haas reporter
    • changed status to resolved
    • removed comment

    Applied as rev 174 of IOHDF5Util and rev 274 of IOHDF5 whose test suite contained a checkpoint.

  4. Log in to comment