Write out input parameters with their used values, add header to some files

Merged
#410 · Created  · Last updated

Merged pull request

Merged in feature/output-inputs (pull request #410)

56d4e4c·Author: ·Closed by: ·2021-08-05

Description

Writes <run name>.used_inputs.in just before starting the main simulation. This file contains the input parameter values that were actually used: including default values and any smart defaults.

Also adds standard_header() which returns a string to be used as a header for various files. Header looks like:

! Created by GS2 at 2021-03-02T11:51:39.887Z+00:00 ! GS2 version: 8.0.6-1622-gdd3701ae-dirty ! Run UUID: 3774355D-6274-434D-933F-0A436049037C ! GK_SYSTEM: ubuntu ! Compiler: gfortran ! Optional file description

The ! prefix is optional and customisable (currently the argument is comment_character, but maybe prefix is better?). Datetime is in ISO8601 format so nice and parsable.

The program name might also want to be customised for e.g. ingen?

Header is currently added to the following files:

  • standard out of gs2

  • <run name>.out (only old diagnostics at the mo I realise)

  • <run name>.used_inputs.in

  • <run name>.inp for ingen

  • <run name>.report for ingen

Should we add it to all files? I wasn’t sure if people would have scripts to parse the other text files, and if a header might be a problem there.

Also, we could do something like:

#ifdef USE_FFT logical, parameter :: has_fft = .true. #else logical, parameter :: has_fft = .false. #endif

to add some more build info to the header.

Another issue I’ve just discovered: file_utils doesn’t get rebuilt when the commit changes. This means the commit hash in the header can be out of date. Making file_utils depend on the git commit (somehow?!) would entail rebuilding basically everything on a commit.

If we can work out how to make a file depend on the git commit (presumably without just resorting to CMake… ), then we probably want to put that in a separate module in order to vastly reduce the scope of rebuilding on commits.

0 attachments

0 comments

Loading commits...