From d473792ee07dae8b2145a4be05bba9b68a2c59d7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Mar 2026 17:33:23 +0000 Subject: [PATCH 1/2] Initial plan From aff8ea1d9b5beef955d83084e30777c918f9df77 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Mar 2026 17:36:03 +0000 Subject: [PATCH 2/2] Write job_script.sh in InPlaceRestartMember.setup() for restart job submission Agent-Logs-Url: https://github.com/alexolinhager/compass/sessions/ad48afc7-6f20-45ae-aa09-7f99c7120ba7 Co-authored-by: alexolinhager <131483939+alexolinhager@users.noreply.github.com> --- .../sgh_restart_ensemble/restart_member.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/compass/landice/tests/ensemble_generator/sgh_restart_ensemble/restart_member.py b/compass/landice/tests/ensemble_generator/sgh_restart_ensemble/restart_member.py index e459d20691..1a191cca34 100644 --- a/compass/landice/tests/ensemble_generator/sgh_restart_ensemble/restart_member.py +++ b/compass/landice/tests/ensemble_generator/sgh_restart_ensemble/restart_member.py @@ -4,6 +4,8 @@ import os +from compass.io import symlink +from compass.job import write_job_script from compass.step import Step @@ -98,3 +100,19 @@ def setup(self): print(f'Setting config_do_restart = .true. in {namelist_path}') _set_restart_in_namelist(namelist_path) + + # 128 matches a typical HPC node count; user can override via config + self.ntasks = self.config.getint('ensemble', 'ntasks', fallback=128) + self.min_tasks = self.ntasks + + run_name = f'run{self.run_num:03}' + self.config.set('job', 'job_name', f'uq_{run_name}_restart') + machine = self.config.get('deploy', 'machine') + write_job_script(self.config, machine, + target_cores=self.ntasks, min_cores=self.min_tasks, + work_dir=self.work_dir) + + if 'LOAD_COMPASS_ENV' in os.environ: + script_filename = os.environ['LOAD_COMPASS_ENV'] + symlink(script_filename, os.path.join(self.work_dir, + 'load_compass_env.sh'))