Skip to content

Commit ec75b9d

Browse files
committed
Extend to more tasks
1 parent 42622ca commit ec75b9d

File tree

10 files changed

+22
-19
lines changed

10 files changed

+22
-19
lines changed

polaris/ocean/ice_shelf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def setup_ssh_adjustment_steps(self, mesh_filename, graph_filename,
114114
else:
115115
ssh_forward = ForwardStep(
116116
component=component, min_resolution=min_resolution,
117-
indir=indir, graph_filename=graph_filename,
117+
indir=indir, graph_target=graph_filename,
118118
init_filename=current_init_filename, name=name,
119119
package=package, yaml_filename=yaml_filename,
120120
yaml_replacements=yaml_replacements)

polaris/ocean/ice_shelf/ssh_forward.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SshForward(OceanModelStep):
2222
file
2323
"""
2424
def __init__(self, component, min_resolution, init_filename,
25-
graph_filename, name='ssh_forward', subdir=None,
25+
graph_target, name='ssh_forward', subdir=None,
2626
package=None, yaml_filename='ssh_forward.yaml',
2727
yaml_replacements=None, indir=None, ntasks=None,
2828
min_tasks=None, openmp_threads=1):
@@ -41,7 +41,7 @@ def __init__(self, component, min_resolution, init_filename,
4141
the initial condition filename (relative to the base work
4242
directory)
4343
44-
graph_filename : str
44+
graph_target: str
4545
the graph filename (relative to the base work directory)
4646
4747
name : str, optional
@@ -91,7 +91,7 @@ def __init__(self, component, min_resolution, init_filename,
9191
self.add_input_file(filename='init.nc',
9292
work_dir_target=init_filename)
9393
self.add_input_file(filename='graph.info',
94-
work_dir_target=graph_filename)
94+
work_dir_target=graph_target)
9595

9696
self.add_output_file(
9797
filename='output.nc',

polaris/ocean/tasks/baroclinic_channel/decomp/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def __init__(self, component, resolution, indir, init):
3939
self.add_step(Forward(
4040
component=component, name=name, indir=self.subdir,
4141
ntasks=procs, min_tasks=procs, openmp_threads=1,
42-
resolution=resolution, run_time_steps=3))
42+
resolution=resolution, run_time_steps=3,
43+
graph_target=f'{init.path}/culled_graph.info'))
4344
subdirs.append(name)
4445
self.add_step(Validate(component=component, step_subdirs=subdirs,
4546
indir=self.subdir))

polaris/ocean/tasks/baroclinic_channel/default/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def __init__(self, component, resolution, indir, init):
3434
self.add_step(
3535
Forward(component=component, indir=self.subdir, ntasks=None,
3636
min_tasks=None, openmp_threads=1, resolution=resolution,
37-
run_time_steps=3))
37+
run_time_steps=3,
38+
graph_target=f'{init.path}/culled_graph.info'))
3839

3940
self.add_step(
4041
Viz(component=component, indir=self.subdir))

polaris/ocean/tasks/baroclinic_channel/forward.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Forward(OceanModelStep):
2525
"""
2626
def __init__(self, component, resolution, name='forward', subdir=None,
2727
indir=None, ntasks=None, min_tasks=None, openmp_threads=1,
28-
nu=None, run_time_steps=None):
28+
nu=None, run_time_steps=None, graph_target='graph.info'):
2929
"""
3030
Create a new task
3131
@@ -70,15 +70,14 @@ def __init__(self, component, resolution, name='forward', subdir=None,
7070
self.run_time_steps = run_time_steps
7171
super().__init__(component=component, name=name, subdir=subdir,
7272
indir=indir, ntasks=ntasks, min_tasks=min_tasks,
73-
openmp_threads=openmp_threads)
73+
openmp_threads=openmp_threads,
74+
graph_target=graph_target)
7475

7576
# make sure output is double precision
7677
self.add_yaml_file('polaris.ocean.config', 'output.yaml')
7778

7879
self.add_input_file(filename='initial_state.nc',
7980
target='../../init/initial_state.nc')
80-
self.add_input_file(filename='graph.info',
81-
target='../../init/culled_graph.info')
8281

8382
self.add_yaml_file('polaris.ocean.tasks.baroclinic_channel',
8483
'forward.yaml')

polaris/ocean/tasks/baroclinic_channel/restart/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ def __init__(self, component, resolution, indir, init):
3535
self.add_step(init, symlink='init')
3636

3737
full = RestartStep(component=component, resolution=resolution,
38-
name='full_run', indir=self.subdir)
38+
name='full_run', indir=self.subdir, init=init)
3939
self.add_step(full)
4040

4141
restart = RestartStep(component=component, resolution=resolution,
42-
name='restart_run', indir=self.subdir)
42+
name='restart_run', indir=self.subdir,
43+
init=init)
4344
restart.add_dependency(full, full.name)
4445
self.add_step(restart)
4546

polaris/ocean/tasks/baroclinic_channel/restart/restart_step.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class RestartStep(Forward):
77
"""
88
A forward model step in the restart test case
99
"""
10-
def __init__(self, component, resolution, name, indir):
10+
def __init__(self, component, resolution, name, indir, init):
1111
"""
1212
Create a new test case
1313
@@ -28,7 +28,8 @@ def __init__(self, component, resolution, name, indir):
2828
self.resolution = resolution
2929
super().__init__(component=component, name=name, indir=indir, ntasks=4,
3030
min_tasks=4, openmp_threads=1,
31-
resolution=resolution)
31+
resolution=resolution,
32+
graph_target=f'{init.path}/culled_graph.info')
3233

3334
def dynamic_model_config(self, at_setup):
3435
"""

polaris/ocean/tasks/baroclinic_channel/threads/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def __init__(self, component, resolution, indir, init):
3838
self.add_step(Forward(
3939
component=component, name=name, indir=self.subdir, ntasks=4,
4040
min_tasks=4, openmp_threads=openmp_threads,
41-
resolution=resolution, run_time_steps=3))
41+
resolution=resolution, run_time_steps=3,
42+
graph_target=f'{init.path}/culled_graph.info'))
4243
subdirs.append(name)
4344
self.add_step(Validate(component=component, step_subdirs=subdirs,
4445
indir=self.subdir))

polaris/ocean/tasks/ice_shelf_2d/forward.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def __init__(self, component, resolution, mesh, init,
6969
name = 'restart'
7070
super().__init__(component=component, name=name, subdir=subdir,
7171
indir=indir, ntasks=ntasks, min_tasks=min_tasks,
72-
openmp_threads=openmp_threads)
72+
openmp_threads=openmp_threads,
73+
graph_target=f'{mesh.path}/culled_graph.info')
7374

7475
self.resolution = resolution
7576
self.do_restart = do_restart
@@ -80,8 +81,6 @@ def __init__(self, component, resolution, mesh, init,
8081

8182
self.add_input_file(filename='init.nc',
8283
work_dir_target=f'{init.path}/output.nc')
83-
self.add_input_file(filename='graph.info',
84-
work_dir_target=f'{mesh.path}/culled_graph.info')
8584

8685
self.add_output_file(
8786
filename='output.nc',

polaris/ocean/tasks/inertial_gravity_wave/forward.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, component, name, resolution, subdir, init):
3737
resolution=resolution, mesh=init, init=init,
3838
package='polaris.ocean.tasks.inertial_gravity_wave',
3939
yaml_filename='forward.yaml',
40-
graph_target='culled_graph.info',
40+
graph_target=f'{init.path}/culled_graph.info',
4141
output_filename='output.nc',
4242
validate_vars=['layerThickness', 'normalVelocity'])
4343

0 commit comments

Comments
 (0)