Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
976697f
refactor the log files into yaml
mandresm Feb 6, 2025
d1a23a0
add exists property to each file, refactor, rename logging function, …
mandresm Feb 6, 2025
0d4507d
fix --modify-config argument that was not working because the yaml wa…
mandresm Feb 7, 2025
ff4ffd1
add modify_runscripts_config.yaml to the tests to be able to define t…
mandresm Feb 14, 2025
0d05fb6
wip: should log in/out with yaml and checksums
pgierz Mar 10, 2026
3501128
Merge branch 'release' into feat/write_files_yaml
pgierz Mar 10, 2026
7956d44
feat: filetracker
pgierz Mar 10, 2026
03854d0
fix: cpn for albedo
pgierz Mar 10, 2026
14011e1
wip: pickling
pgierz Mar 10, 2026
5385f3c
wip: yaml repr
pgierz Mar 10, 2026
a92d247
tweaks to run config
pgierz Mar 10, 2026
dc6f720
...
pgierz Mar 10, 2026
bb706ae
wip: filetracker also in tidy
pgierz Mar 10, 2026
1d715fd
wip: metadata needs to happen after avoid override
pgierz Mar 10, 2026
822e840
wip: debug statements
pgierz Mar 10, 2026
e5b392d
wip: bad truthiness comp
pgierz Mar 10, 2026
99b04e6
correct runscript
pgierz Mar 10, 2026
5f731a3
provenance skipping for file tracker
pgierz Mar 10, 2026
fafc7c7
wip: tracking in all phases needs a dump
pgierz Mar 10, 2026
1a2ec84
prepare stage fix unknown, and setupname instad of it-coup setup name
pgierz Mar 10, 2026
704754c
main log not run log for filetracker
pgierz Mar 10, 2026
5a89cb9
filedict compatible output
pgierz Mar 10, 2026
a7c0621
filetracker: output like @mandresm design doc for PR #1448
pgierz Mar 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions configs/components/fesom/fesom-2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,5 @@ fesom:
- "throw_away_some_infiles"
- "copy_stuff_back_from_work"
- "copy_all_results_to_exp"
- "dump_file_tracker_log"
- "clean_run_dir"
1 change: 1 addition & 0 deletions configs/components/fesom/fesom-2.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ fesom:
- "throw_away_some_infiles"
- "copy_stuff_back_from_work"
- "copy_all_results_to_exp"
- "dump_file_tracker_log"
- "clean_run_dir"

computer:
Expand Down
1 change: 1 addition & 0 deletions configs/components/fesom/fesom-2.5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -659,4 +659,5 @@ fesom:
- "throw_away_some_infiles"
- "copy_stuff_back_from_work"
- "copy_all_results_to_exp"
- "dump_file_tracker_log"
- "clean_run_dir"
1 change: 1 addition & 0 deletions configs/components/fesom/fesom-2.6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -712,5 +712,6 @@ fesom:
- "throw_away_some_infiles"
- "copy_stuff_back_from_work"
- "copy_all_results_to_exp"
- "dump_file_tracker_log"
- "clean_run_dir"

2 changes: 1 addition & 1 deletion configs/components/pism/pism.recipes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pism:

#- "add_batch_hostfile"
- "copy_files_to_work"
- "compute_and_log_file_checksums"
- "log_files_in_target_to_yaml"
#- "write_simple_runscript"
- "report_missing_files"
#- "add_vcs_info"
Expand Down
2 changes: 1 addition & 1 deletion configs/components/pism_nh/pism_nh.recipes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pism_nh:

#- "add_batch_hostfile"
- "copy_files_to_work"
- "compute_and_log_file_checksums"
- "log_files_in_target_to_yaml"
#- "write_simple_runscript"
- "report_missing_files"
#- "add_vcs_info"
Expand Down
2 changes: 1 addition & 1 deletion configs/components/pism_sh/pism_sh.recipes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pism_sh:

#- "add_batch_hostfile"
- "copy_files_to_work"
- "compute_and_log_file_checksums"
- "log_files_in_target_to_yaml"
#- "write_simple_runscript"
- "report_missing_files"
#- "add_vcs_info"
Expand Down
4 changes: 3 additions & 1 deletion configs/esm_software/esm_runscripts/esm_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ core:
- "install_missing_plugins"
- "add_submission_info"
- "initialize_batch_system"
- "initialize_file_tracker"
- "initialize_coupler"
- "set_logfile"
#- "add_vcs_info"
Expand Down Expand Up @@ -86,7 +87,8 @@ core:
- "log_used_files"
- "report_missing_files"
- "check_for_unknown_files"
- "compute_and_log_file_checksums"
- "log_files_in_target_to_yaml"
- "dump_file_tracker_log"

database_actions:
- "database_entry"
Expand Down
5 changes: 4 additions & 1 deletion configs/esm_software/esm_runscripts/esm_runscripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ choose_job_type:
- "restore_protected_last_minute_changes"
- "add_submission_info"
- "initialize_batch_system"
- "initialize_file_tracker"
- "initialize_coupler"
- "set_logfile"
- "check_config_for_warnings_errors"
Expand Down Expand Up @@ -71,6 +72,7 @@ choose_job_type:
- "throw_away_some_infiles"
- "copy_stuff_back_from_work"
- "copy_all_results_to_exp"
- "dump_file_tracker_log"
- "clean_run_dir"

prepcompute:
Expand All @@ -87,8 +89,9 @@ choose_job_type:
- "modify_namelists"
- "modify_files"
- "copy_files_to_work"
- "dump_file_tracker_log"
- "report_missing_files"
- "compute_and_log_file_checksums"
- "log_files_in_target_to_yaml"
#- "add_vcs_info"
#- "check_vcs_info_against_last_run"
- "_write_finalized_config"
Expand Down
4 changes: 3 additions & 1 deletion configs/machines/albedo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ computer:
accounting: true
further_reading:
- batch_system/slurm.yaml
partition_cpn: 128

partitions:
compute:
name: mpp
cores_per_node: 128
cores_per_node: ${computer.partition_cpn}
pp:
name: smp
cores_per_node: 1
Expand Down
2 changes: 1 addition & 1 deletion configs/setups/awiesm/awiesm-2.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ general:
- "modify_files"
- "copy_files_to_work"
- "report_missing_files"
- "compute_and_log_file_checksums"
- "log_files_in_target_to_yaml"
#- "add_vcs_info"
#- "check_vcs_info_against_last_run"
- "_write_finalized_config"
Expand Down
4 changes: 2 additions & 2 deletions configs/setups/awiesm/awiesm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ general:
- "modify_files"
- "copy_files_to_work"
- "report_missing_files"
- "compute_and_log_file_checksums"
- "log_files_in_target_to_yaml"
- "_write_finalized_config"
- "database_entry"
"*":
Expand All @@ -71,7 +71,7 @@ general:
- "modify_files"
- "copy_files_to_work"
- "report_missing_files"
- "compute_and_log_file_checksums"
- "log_files_in_target_to_yaml"
#- "add_vcs_info"
#- "check_vcs_info_against_last_run"
- "_write_finalized_config"
Expand Down
2 changes: 1 addition & 1 deletion configs/setups/focioifs/focioifs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ general:
- "modify_files"
- "copy_files_to_work"
- "report_missing_files"
- "compute_and_log_file_checksums"
- "log_files_in_target_to_yaml"
# not working, bug already reported at https://github.com/esm-tools/esm_tools/discussions/774
# - "add_vcs_info"
# - "check_vcs_info_against_last_run"
Expand Down
48 changes: 48 additions & 0 deletions docs/esm_runscripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,54 @@ As an example, to configure ``esm_runscripts`` for an echam-experiment to link t
Both ways to set the entries are doing the same thing. It is possible, as in the ``input`` case, to set the file movement method independently for each of the
directions; the setting ``all_directions`` is just a shortcut if the method is identical for all of them.

File Logging and Checksums
--------------------------

During experiment execution, ``esm_runscripts`` can generate a YAML file listing all
files that were copied or linked into the work directory, along with optional MD5
checksums. This is useful for:

* **Reproducibility**: Track exactly which files were used in a run
* **Debugging**: Identify missing or changed files between runs
* **Validation**: Compare file manifests between baseline and test runs

The file list is written to the ``log`` directory of each run as
``<expid>_<model>_filelist_<datestamp>.yaml`` and contains:

* Source, intermediate, and target paths for each file
* The file category (input, forcing, restart, etc.)
* Whether the file exists in the target directory
* MD5 checksum (if enabled)

To enable checksum computation, add the following to your runscript:

.. code-block:: yaml

general:
compute_file_checksums: True

.. note::
Computing checksums adds overhead to the job preparation phase, especially for
large files or many files. For production runs where reproducibility tracking
is not needed, leave this option disabled (the default).

The generated YAML file has the following structure:

.. code-block:: yaml

fesom:
forcing_sss:
source: /pool/forcing/sss.nc
intermediate: /work/exp/run_123/sss.nc
target: /work/exp/run_123/work/sss.nc
kind: forcing
checksum: a1b2c3d4e5f6...
exists: true
general:
# ... general files ...
not_handled_by_filelists:
# ... files found in work but not tracked by esm_runscripts ...

Parallel File Movements
-----------------------

Expand Down
26 changes: 26 additions & 0 deletions runscripts/fesom2/fesom2.6-albedo-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
general:
user: !ENV ${USER}
account: "computing.computing"
setup_name: fesom
compute_time: "00:30:00"
initial_date: "1958-01-01"
final_date: "1958-04-30"
base_dir: "/albedo/work/user/${user}/experiments/${general.setup_name}-${general.version}/"
nyear: 0
nmonth: 1
use_venv: True
install_esm_tools_branch: "feat/write_files_yaml"
compute_file_checksums: True
parallel_file_movements: "dask"

fesom:
version: 2.6
model_dir: "/albedo/work/user/${user}/Models/fesom-2.6/"
mesh_dir: "/albedo/pool/FESOM2/core2/"
forcing_data_dir: "/albedo/work/projects/p_pool_fesom1/forcing/"
restart_rate: 1
restart_first: 1
restart_unit: "m"
resolution: "CORE2"
lresume: false
time_step: 1800
4 changes: 3 additions & 1 deletion src/esm_parser/provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,8 +1089,10 @@ def clean_provenance(data, nested=False):
clean_provenance(key, nested=True): clean_provenance(value, nested=True)
for key, value in data.items()
}
# Clean vars in objects
# Clean vars in objects (skip objects marked with _skip_provenance)
elif hasattr(data, "__dict__"):
if getattr(data, "_skip_provenance", False):
return data
for key, value in vars(data).items():
setattr(data, key, clean_provenance(value, nested=True))
return data
Expand Down
Loading
Loading