Skip to content

Semantics of I O parameters

Oleg Korobkin edited this page Feb 27, 2019 · 1 revision

Semantics of HDF5 I/O, multi-file output and restarts

This is a detailed description of how the H5Part I/O is controlled by various parameters in the current master branch.

Generating initial data from scratch

Run an ID generator with the parameter initial_data_prefix. This produces a file <initial_data_prefix>.h5part (default: initial_data.h5part). (!) If the file already exists, it will be overwritten.

Starting evolution from the initial data file

Use the same initial_data_prefix to specify the file, without 'h5part' file extension.

Periodic H5Part output, multi-file output

  output_h5data_every = 10              # output a snapshot every this many iterations
  output_h5data_prefix = "output_data"  # file prefix for the output files
  out_h5data_separate_iterations = yes  # if yes: output multiple files <file_prefix>_NNNNN.h5part
                                        # if no: output single file <file_prefix>.h5part.

Restart as a new run

One can use existing output file(s) as an input to another evolution run. Let's say we've generated either a single-file output 'relaxation.h5part', or a sequence of snapshots 'relaxation_NNNNN.h5part'. Then, we can use the following setup to start a new evolution from iteration 100:

  # start a new evolution from iteration 100
  initial_data_prefix = "relaxation"
  initial_iteration = 100

(!) If initial_data_prefix =/= output_h5data_prefix, all existing file(s) matching <output_h5data_prefix>.h5part or <output_h5data_prefix>_NNNNN.h5part will be deleted.

Restarting the same run

Setting initial_data_prefix the same as output_h5data_prefix corresponds to restart scenario from a given iteration. For example:

  # continue output in sedov_n200.h5part and restart from iteration 100
  initial_data_prefix = "sedov_n200"
  initial_iteration = 100
  output_h5data_prefix = "sedov_n200"
  • (!) If restarting from multiple-file output, all steps after the one corresponding to specified iteration are deleted.
  • (!) Cannot restart from multiple-file output with initial_iteration = 0.
  • (!) When restarting from a single-file output, 'initial_iteration' should point to the last step in the file: otherwise, simulation aborts (because editing large HDF5 files can be problematic).

Modifying input files

One can also instruct ID generators to modify an existing input file (for example, reset pressure, velocity, internal energy). This is achieved via a dedicated boolean parameter modify_initial_data. Example:

  # overwrites the file "relaxed_particles.h5part" with new generated values.
  initial_data_prefix = "relaxed_particles"
  modify_initial_data = yes

List of I/O parameters

  • initial_data_prefix (string, default: "initial_data")

    • file prefix for input and initial data file[s]
  • initial_iteration (integer, default: 0)

    • start from specific iteration in the input file[s]
  • modify_initial_data (boolean, default: "false")

    • used by initial data generators to modify existing input file[s]
  • output_h5data_prefix (string, default: "output_data")

    • file prefix for HDF5 output data file[s]
  • out_screen_every (integer, default: 1)

    • screen output frequency
  • out_scalar_every (integer, default: 10)

    • scalar reductions output frequency
  • out_diagnostic_every (integer, default: 10)

    • diagnostic info output frequency
  • out_h5data_every (integer, default: 10)

    • HDF5 output frequency
  • out_h5data_separate_iterations (boolean, default: false)

    • produce separate HDF5 file per iteration