Skip to content

Commit

Permalink
Make jobs fit for async (#52)
Browse files Browse the repository at this point in the history
* add: Make icon.py fit for async

* ref: don't use arguments to main, rather store info in config

* GitHub Action: Apply Pep8-formatting

* add:ref: model becomes workflow + get job dependencies from cfg

- No need to travel with `model_cfg`. The relevant part is now in
`cfg.worflow` and the former `cfg.model` is now `cfg.workflow_name`

- A method is added to Config to generate the dependency part of the
sbatch command

- Some other minor improvements like recursive abs path or recursive
attributes from dictionnaries of any depth

- NOTHING TESTED YET !!!

* fix: leftover from model => workflow_name

* ref: remove dependencies for prepare_data, not needed

* fix:add: get_dep_cmd was buggy, add wait_for_previous method

* GitHub Action: Apply Pep8-formatting

* add: cycling mechanism for async workflows

* GitHub Action: Apply Pep8-formatting

* ref: some reorganization of files

- move `class Config` in its own `config.py`
- mov workflow.yaml one level up becuase the `config` dir becomes
  confusing with `config.py`. Also not really needed to have that
  folder with only this file in it.

* GitHub Action: Apply Pep8-formatting

* ref: start using pathlib and make 2 introspective methods recurive

* ref: continue using pathlib, remove work_root arg (already in cfg)

* GitHub Action: Apply Pep8-formatting

* ref(prepare_data): continue using pathlib, replace setattr

* ref:add:fix: some more slurm integration

- use `is_async` instead of python keyword `async`
- add potential user provided dependency to `get_dep_xxx` methods.
  This allows for internal dependencies between subjobs of a
  particular task, like prepare_data.
- add a submit method to the `Config` class
- Start slurm integration for prepare_data. Continue the same way for
  the rest of it.
- replace some `setattr` calls by direct assignments
- move `jobs`, `startdate` and `enddate` to the Config object and
  remove them from the arguments of `restart_runs_xxx` functions

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
leclairm and github-actions authored Dec 12, 2023
1 parent 717f2c9 commit 12fcd65
Show file tree
Hide file tree
Showing 26 changed files with 703 additions and 658 deletions.
2 changes: 1 addition & 1 deletion cases/cosmo-ghg-spinup-test/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration file for the 'cosmo-ghg-spinup-test' case with COSMO-GHG

model: cosmo-ghg
workflow: cosmo-ghg
constraint: gpu
ntasks_per_node: 12
restart_step: PT6H
Expand Down
2 changes: 1 addition & 1 deletion cases/cosmo-ghg-test/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration file for the 'cosmo-ghg-test' case with COSMO-GHG

model: cosmo-ghg
workflow: cosmo-ghg
constraint: gpu
ntasks_per_node: 12
restart_step: PT6H
Expand Down
2 changes: 1 addition & 1 deletion cases/icon-art-global-test/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration file for the 'icon-art-global-test' case with ICON

model: icon-art-global
workflow: icon-art-global
constraint: gpu
run_on: cpu
compute_queue: normal
Expand Down
2 changes: 1 addition & 1 deletion cases/icon-art-oem-test/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration file for the 'icon-art-oem-test' case with ICON

model: icon-art-oem
worflow: icon-art-oem
constraint: gpu
run_on: cpu
compute_queue: normal
Expand Down
2 changes: 1 addition & 1 deletion cases/icon-test/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration file for the 'icon-test' case with ICON

model: icon
workflow: icon
constraint: gpu
run_on: cpu
compute_queue: normal
Expand Down
Loading

0 comments on commit 12fcd65

Please sign in to comment.