@@ -20,12 +20,15 @@ class OceanModelStep(ModelStep):
2020 map : dict
2121 A nested dictionary that maps from MPAS-Ocean to Omega model config
2222 options
23+
24+ graph_target : str
25+ The name of the graph partition file to link to (relative to the base
26+ working directory)
2327 """
2428 def __init__ (self , component , name , subdir = None , indir = None , ntasks = None ,
2529 min_tasks = None , openmp_threads = None , max_memory = None ,
2630 cached = False , yaml = None , update_pio = True , make_graph = False ,
27- mesh_filename = None , partition_graph = True ,
28- graph_filename = 'graph.info' ):
31+ mesh_filename = None , partition_graph = True , graph_target = None ):
2932 """
3033 Make a step for running the model
3134
@@ -84,20 +87,25 @@ def __init__(self, component, name, subdir=None, indir=None, ntasks=None,
8487 If so, the partitioning executable is taken from the ``partition``
8588 option of the ``[executables]`` config section.
8689
87- graph_filename : str, optional
88- The name of the graph file to partition
90+ graph_target : str, optional
91+ The graph file name (relative to the base work directory).
92+ If none, it will be created.
8993 """
94+ if graph_target is None :
95+ self .make_graph = True
96+
9097 super ().__init__ (
9198 component = component , name = name , subdir = subdir , indir = indir ,
9299 ntasks = ntasks , min_tasks = min_tasks , openmp_threads = openmp_threads ,
93100 max_memory = max_memory , cached = cached , yaml = yaml ,
94101 update_pio = update_pio , make_graph = make_graph ,
95102 mesh_filename = mesh_filename , partition_graph = partition_graph ,
96- graph_filename = graph_filename )
103+ graph_filename = 'graph.info' )
97104
98105 self .dynamic_ntasks = (ntasks is None and min_tasks is None )
99106
100107 self .map : Union [None , List [Dict [str , Dict [str , str ]]]] = None
108+ self .graph_target = graph_target
101109
102110 def setup (self ):
103111 """
@@ -112,9 +120,14 @@ def setup(self):
112120 self .config_models = ['ocean' , 'Omega' ]
113121 self .yaml = 'omega.yml'
114122 self ._read_map ()
123+ self .partition_graph = False
115124 elif model == 'mpas-ocean' :
116125 self .config_models = ['ocean' , 'mpas-ocean' ]
117126 self .make_yaml = False
127+ self .add_input_file (
128+ filename = 'graph.info' ,
129+ work_dir_target = self .graph_target )
130+
118131 else :
119132 raise ValueError (f'Unexpected ocean model: { model } ' )
120133
0 commit comments