Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c461be0
chore: small typos in comments
pgierz Jan 29, 2025
82a85ba
chore: small typo
pgierz Jan 29, 2025
e00c357
fix: includes vcs definitions in plugins, these are not called
pgierz Jan 29, 2025
d237829
wip: sets up post job as method of the simulation object
pgierz Jan 29, 2025
94547a7
refactor: SimulationSetup is now named Simulation
pgierz Jan 29, 2025
a50060b
wip
pgierz Jan 29, 2025
ee93164
wip: adds post folder
pgierz Jan 29, 2025
b6e2f98
wip: automatically create post-folder, part 2
pgierz Jan 29, 2025
4d9e89d
feat: includes albedo reference runscript
pgierz Jan 29, 2025
fffd387
wip: AI-aided refactor of workflow module
pgierz Jan 29, 2025
ab8a01a
wip: minor spaces and newlines...
pgierz Jan 29, 2025
9cd35ae
wip: AI-aided refactor of workflow module, part 2
pgierz Jan 29, 2025
6099289
Merge branch 'feat/post-to-zarr' of https://github.com/esm-tools/esm_…
pgierz Jan 29, 2025
04a58c1
wip
pgierz Jan 29, 2025
e402daf
wip
pgierz Jan 29, 2025
dd81b69
wip
pgierz Jan 30, 2025
0bdc8e1
wip
pgierz Feb 3, 2025
1937b1f
Added phase and run_from_batch_script as new esm_runscripts arguments…
nwieters Mar 18, 2024
cd6d493
Define default workflow in default.yaml.
nwieters Mar 18, 2024
19597b4
Submit phase argument instead of task to subprocess call of esm_runsc…
nwieters Mar 18, 2024
73a51ac
Removed restart phase again from default workflow.
nwieters Mar 19, 2024
ae27993
Refactor get commands for run file and create run file.
nwieters Mar 19, 2024
6ae4ab1
Added exception if logfile not already defined.
nwieters Mar 19, 2024
4f8e57c
Started to refactor resubmit mechanism.
nwieters Mar 19, 2024
8cbbcd9
Added observe call to run script.
nwieters Mar 19, 2024
f581daa
Call phases in a more variable way.
nwieters Mar 19, 2024
d158f1d
Added functionality for argument -s and some code optimizations.
nwieters Mar 19, 2024
3fd4688
Added phase to observe call in run script.
nwieters Mar 19, 2024
d4c1548
Added START and END to log message in plugin manager.
nwieters Mar 19, 2024
9fe12b5
Some changes for observe task.
nwieters Mar 19, 2024
46c5d69
Bugfix in creating run script.
nwieters Mar 21, 2024
e8cab33
Changes towards a new run sbatch script.
nwieters Apr 11, 2024
139a53f
chore: minor typos in comments
pgierz Feb 3, 2025
2fd6e5c
wip
pgierz Feb 16, 2025
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
65 changes: 57 additions & 8 deletions configs/esm_software/esm_runscripts/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,61 @@ general:

# Defaults to be added to each model or component
per_model_defaults:
file_movements:
default:
all_directions: copy
bin:
init_to_exp: copy
exp_to_run: copy
run_to_work: copy
work_to_run: copy
file_movements:
default:
all_directions: copy
bin:
init_to_exp: copy
exp_to_run: copy
run_to_work: copy
work_to_run: copy

workflow:
user_phases: None
default_cluster: sim_cluster
clusters:
sim_cluster:
first_task_in_queue: prepcompute
last_task_in_queue: tidy
next_run_triggered_by: tidy
phases:
- prepcompute
- compute
- tidy

phases:
prepcompute:
phase_type: SimulationSetup
called_from: tidy
cluster: sim_cluster
name: prepcompute
next_submit:
- compute
nproc: 1
order_in_cluster: sequential
run_after: tidy
run_before: compute
compute:
phase_type: compute
called_from: prepcompute
cluster: sim_cluster
name: compute
next_submit:
- tidy
#nproc: None
nproc: 1
order_in_cluster: sequential
run_after: prepcompute
run_before: tidy
#run_on_queue: ${computer.partitions.pp.name}
tidy:
phase_type: SimulationSetup
called_from: compute
cluster: sim_cluster
name: tidy
next_submit:
- prepcompute
nproc: 1
order_in_cluster: sequential
run_after: compute
run_before: prepcompute
9 changes: 6 additions & 3 deletions configs/esm_software/esm_runscripts/esm_plugins.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mappings of functions/methods to parent ESM python libraries:
# tells ESM-Tools in which library and file/sublibrary can find the functions
# of the recipies
# of the recipes
# (prescribed in configs/esm_software/esm_runscripts/esm_runscripts.yaml).
#
# Core (not an external plugin)
Expand All @@ -25,8 +25,8 @@ core:
- "initialize_batch_system"
- "initialize_coupler"
- "set_logfile"
#- "add_vcs_info"
#- "check_vcs_info_against_last_run"
- "add_vcs_info"
- "check_vcs_info_against_last_run"
- "check_config_for_warnings_errors"

prepexp:
Expand Down Expand Up @@ -111,3 +111,6 @@ core:
workflow:
- "assemble_workflow"

postprocess:
- "convert_to_zarr"

4 changes: 2 additions & 2 deletions configs/esm_software/esm_runscripts/esm_runscripts.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Default recipies
# Default recipes
# ESM-Tools uses config/esm_software/esm_runscripts/esm_plugins.yaml to understand
# where to look for each of this function/methods (the steps within each recipy, e.g.
# "_read_date_file").
Expand Down Expand Up @@ -49,7 +49,7 @@ choose_job_type:
- "copy_tools_to_thisrun"
# The next step will call esm_runscripts again from the experiment folder,
# if the current folder is not the experiment folder already.
# If esm_runscripts will be excuted, the following step will be skipped, since
# If esm_runscripts will be executed, the following step will be skipped, since
# there is a sys.exit() after the esm_runscripts call.
- "call_esm_runscripts_from_prepexp"
# The following step will be skipped, if not in experiment folder.
Expand Down
25 changes: 25 additions & 0 deletions runscripts/fesom2/fesom2.6-albedo-reference.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
general:
user: !ENV ${USER}
account: "computing.computing"
setup_name: fesom
compute_time: "08:00:00"
initial_date: "1958-01-01"
final_date: "1958-03-31"
project_base: !ENV ${PROJECT_BASE}
base_dir: "${general.project_base}/experiments"
nyear: 0
nmonth: 1
use_venv: False

fesom:
version: 2.6
model_dir: "${general.project_base}/model-codes/fesom-2.6/"
mesh_dir: /albedo/pool/FESOM2/core2/
restart_rate: 1
restart_first: 1
restart_unit: "m"
resolution: "CORE2"
lresume: false
time_step: 1800
# FIXME(@pgierz, @hpc-team): We have FESOM and FESOM2 in the albedo pool, this should be unified...
forcing_data_dir: "/albedo/pool/FESOM/forcing/"
35 changes: 31 additions & 4 deletions src/esm_plugin_manager/esm_plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@

import esm_parser
import esm_profile
from esm_parser import yaml_file_to_dict


def read_recipe(recipe, additional_dict, needs_parse=True):
if needs_parse:
recipe = yaml_file_to_dict(recipe)
recipe = esm_parser.yaml_file_to_dict(recipe)
recipe.update(additional_dict)
esm_parser.basic_choose_blocks(recipe, recipe)
esm_parser.recursive_run_function(
Expand All @@ -26,7 +25,7 @@ def read_recipe(recipe, additional_dict, needs_parse=True):
def read_plugin_information(plugins_bare, recipe, needs_parse=True):
# pluginfile = esm_plugins.yaml
if needs_parse:
plugins_bare = yaml_file_to_dict(plugins_bare)
plugins_bare = esm_parser.yaml_file_to_dict(plugins_bare)
extra_info = ["location", "git-url"]
plugins = {}
for workitem in recipe["recipe"]:
Expand Down Expand Up @@ -62,6 +61,7 @@ def read_plugin_information(plugins_bare, recipe, needs_parse=True):
if found:
break

breakpoint()
attach_installed_plugins_to_all(plugins)
return plugins

Expand Down Expand Up @@ -127,17 +127,31 @@ def check_plugin_availability(plugins):


def work_through_recipe(recipe, plugins, config):
"""
Works through the esm_runscripts recipes and plugin recipes.

Parameters
----------
recipe : dict # What is in these two dictionaries? Where do the entries are comming from?
plugins : dict
config : dict

Returns
-------
config : dict
"""
if config.get("general", {}).get("debug_recipe", False):
import pdb

pdb.set_trace()
recipes = recipe["recipe"]
recipe_name = recipe["job_type"]
# Loop over the recipe
for index, workitem in enumerate(recipes, start=1):
if config["general"].get("verbose", False):
# diagnostic message of which recipe step is being executed
message = (
f"::: Executing the step: {workitem} "
f"::: START Executing the step: {workitem} "
f"(step [{index}/{len(recipes)}] of the job: "
f'{recipe["job_type"]})'
)
Expand Down Expand Up @@ -187,6 +201,19 @@ def work_through_recipe(recipe, plugins, config):
config = timed_workitem_callable(config)
else:
config = getattr(thismodule, workitem)(config)
config = getattr(thismodule, workitem)(config)
if config["general"].get("verbose", False):
# diagnostic message of which recipe step is being executed
message = (
f"::: END Executing the step: {workitem} "
f"(step [{index}/{len(recipes)}] of the job: "
f'{recipe["job_type"]})'
)

logger.info()
logger.info("=" * len(message))
logger.info(message)
logger.info("=" * len(message))
return config


Expand Down
Loading
Loading