Skip to content

Commit fdf4c52

Browse files
author
corink21
committed
Added config for Eiger machine
1 parent 121974e commit fdf4c52

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

config.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def __init__(self, casename):
7171
# Specific settings based on the node type ('gpu' or 'mc')
7272
if self.machine == 'daint':
7373
self.set_node_info()
74+
elif self.machine == 'eiger':
75+
self.set_node_info()
7476

7577
def load_config_file(self):
7678
"""Load configuration settings from a YAML file and set them as attributes.
@@ -152,6 +154,8 @@ def set_machine(self):
152154
self.machine = 'daint'
153155
elif hostname.startswith('eu-'):
154156
self.machine = 'euler'
157+
elif hostname.startswith('eiger'):
158+
self.machine = 'eiger'
155159
else:
156160
raise ValueError(f"Unsupported hostname: {hostname}")
157161
print(f"You are on the {self.machine} machine.")
@@ -191,7 +195,7 @@ def set_node_info(self):
191195
'export MPICH_G2G_PIPELINE=256\n'
192196
'export CRAY_CUDA_MPS=1\n')
193197
elif self.constraint == 'mc':
194-
self.ntasks_per_node = 36
198+
self.ntasks_per_node = 128
195199
self.mpich_cuda = ''
196200
else:
197201
raise ValueError(
@@ -472,6 +476,22 @@ def submit_basic_python(self, job_name):
472476
f'./run_chain.py {self.casename} -j {job_name} -c {self.chunk_id} -f -s --no-logging',
473477
'',
474478
]
479+
elif self.machine == 'eiger':
480+
script_lines = [
481+
'#!/usr/bin/env bash',
482+
f'#SBATCH --job-name={job_name}',
483+
'#SBATCH --nodes=1',
484+
f'#SBATCH --time={walltime}',
485+
f'#SBATCH --output={self.logfile}',
486+
'#SBATCH --open-mode=append',
487+
f'#SBATCH --account={self.compute_account}',
488+
f'#SBATCH --partition={self.compute_queue}',
489+
f'#SBATCH --constraint={self.constraint}',
490+
'',
491+
f'cd {self.chain_src_dir}',
492+
f'./run_chain.py {self.casename} -j {job_name} -c {self.chunk_id} -f -s --no-logging',
493+
'',
494+
]
475495

476496
job_path = self.chain_root / 'job_scripts'
477497
job_path.mkdir(parents=True, exist_ok=True)
@@ -516,6 +536,17 @@ def wait_for_previous(self):
516536
f'#SBATCH --dependency=afterany:{dep_str}', '',
517537
'# Do nothing', 'exit 0'
518538
]
539+
elif self.machine == 'eiger':
540+
script_lines = [
541+
'#!/usr/bin/env bash', '#SBATCH --job-name="wait"',
542+
'#SBATCH --nodes=1', '#SBATCH --time=00:01:00',
543+
f'#SBATCH --output={log_file}',
544+
f'#SBATCH --account={self.compute_account}',
545+
f'#SBATCH --partition={self.compute_queue}',
546+
f'#SBATCH --constraint={self.constraint}',
547+
f'#SBATCH --dependency=afterany:{dep_str}', '',
548+
'# Do nothing', 'exit 0'
549+
]
519550
with open(job_file, mode='w') as wait_job:
520551
wait_job.write('\n'.join(script_lines))
521552

jobs/icon.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ def main(cfg):
4444
# Get name of initial file
4545
if hasattr(cfg, 'inicond_filename'):
4646
inidata_filename = cfg.icon_input_icbc / cfg.inicond_filename
47+
elif (hasattr(cfg, 'inidata_prefix') and hasattr(cfg, 'inidata_nameformat')
48+
and hasattr(cfg, 'inidata_filename_suffix')):
49+
inidata_filename = cfg.icon_input_icbc / str(
50+
cfg.startdate.strftime(cfg.inidata_prefix +
51+
cfg.inidata_nameformat +
52+
cfg.inidata_filename_suffix))
4753
else:
4854
inidata_filename = cfg.icon_input_icbc / str(
4955
cfg.startdate_sim.strftime(cfg.meteo['prefix'] +

0 commit comments

Comments
 (0)