Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os

from compass.model import run_model
from compass.step import Step


Expand Down Expand Up @@ -40,8 +41,8 @@ class InPlaceRestartMember(Step):

Rather than copying files to a new directory, this step operates directly
in the original run directory. It sets ``config_do_restart = .true.`` in
``namelist.landice`` so that the run continues from its last checkpoint
when ``job_script.sh`` is resubmitted by ``EnsembleManager``.
``namelist.landice`` and then runs MALI to continue from the last
checkpoint.

Attributes
----------
Expand Down Expand Up @@ -80,7 +81,8 @@ def __init__(self, test_case, run_num, spinup_work_dir):
def setup(self):
"""
Edit ``namelist.landice`` in-place in the original run directory,
setting ``config_do_restart = .true.``.
setting ``config_do_restart = .true.``, and register the MALI
executable as an input for this step.

No files are copied and no new subdirectories are created.
"""
Expand All @@ -98,3 +100,13 @@ def setup(self):

print(f'Setting config_do_restart = .true. in {namelist_path}')
_set_restart_in_namelist(namelist_path)

# Register MALI executable so compass knows this step needs the model
self.add_model_as_input()

def run(self):
"""
Run MALI in the original run directory to continue the simulation
from its last checkpoint.
"""
run_model(self)
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
import json
import os

from compass.landice.tests.ensemble_generator.ensemble_manager import (
EnsembleManager,
)
from compass.testcase import TestCase

from .restart_member import InPlaceRestartMember
Expand All @@ -43,9 +40,6 @@ def __init__(self, test_group):
name = 'sgh_restart_ensemble'
super().__init__(test_group=test_group, name=name)

# Add the ensemble manager (handles job submission)
self.add_step(EnsembleManager(test_case=self))

def configure(self):
"""
Configure restart ensemble by identifying incomplete runs.
Expand Down Expand Up @@ -122,9 +116,6 @@ def configure(self):

self.restart_run_numbers = restart_runs

# Only run ensemble_manager; it submits individual restart jobs
self.steps_to_run = ['ensemble_manager']

def _should_restart_run(
self,
run_dir,
Expand Down