Skip to content

Commit 4c27834

Browse files
Merge pull request #890 from SCOREC/cws/gisCoarseTest
support running landice/greenland/mesh_gen test case on workstations This PR passes the parallel_executable to a few functions that were hardcoded to use srun. With the right input files, this allows testing on workstations with limited memory and cores.
2 parents 76d360c + d4f748e commit 4c27834

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

compass/landice/mesh.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,8 +1007,8 @@ def preprocess_ais_data(self, source_gridded_dataset,
10071007
return preprocessed_gridded_dataset
10081008

10091009

1010-
def interp_gridded2mali(self, source_file, mali_scrip, nProcs, dest_file, proj,
1011-
variables="all"):
1010+
def interp_gridded2mali(self, source_file, mali_scrip, parallel_executable,
1011+
nProcs, dest_file, proj, variables="all"):
10121012
"""
10131013
Interpolate gridded dataset (e.g. MEASURES, BedMachine) onto a MALI mesh
10141014
@@ -1020,6 +1020,9 @@ def interp_gridded2mali(self, source_file, mali_scrip, nProcs, dest_file, proj,
10201020
mali_scrip : str
10211021
name of scrip file corresponding to destination MALI mesh
10221022
1023+
parallel_executable : str
1024+
executable needed to launch a parallel job
1025+
10231026
nProcs : int
10241027
number of processors to use for generating remapping weights
10251028
@@ -1070,7 +1073,7 @@ def __guess_scrip_name(filename):
10701073

10711074
# Generate remapping weights
10721075
logger.info('generating gridded dataset -> MPAS weights')
1073-
args = ['srun', '-n', nProcs, 'ESMF_RegridWeightGen',
1076+
args = [parallel_executable, '-n', nProcs, 'ESMF_RegridWeightGen',
10741077
'--source', source_scrip,
10751078
'--destination', mali_scrip,
10761079
'--weight', weights_filename,

compass/landice/tests/antarctica/mesh.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def run(self):
6363

6464
section_ais = config['antarctica']
6565

66+
parallel_executable = config.get('parallel', 'parallel_executable')
6667
nProcs = section_ais.get('nProcs')
6768
src_proj = section_ais.get("src_proj")
6869
data_path = section_ais.get('data_path')
@@ -138,14 +139,16 @@ def run(self):
138139

139140
# Now perform bespoke interpolation of geometry and velocity data
140141
# from their respective sources
141-
interp_gridded2mali(self, bedmachine_dataset, dst_scrip_file, nProcs,
142+
interp_gridded2mali(self, bedmachine_dataset, dst_scrip_file,
143+
parallel_executable, nProcs,
142144
self.mesh_filename, src_proj, variables="all")
143145

144146
# only interpolate a subset of MEaSUREs variables onto the MALI mesh
145147
measures_vars = ['observedSurfaceVelocityX',
146148
'observedSurfaceVelocityY',
147149
'observedSurfaceVelocityUncertainty']
148-
interp_gridded2mali(self, measures_dataset, dst_scrip_file, nProcs,
150+
interp_gridded2mali(self, measures_dataset, dst_scrip_file,
151+
parallel_executable, nProcs,
149152
self.mesh_filename, src_proj,
150153
variables=measures_vars)
151154

compass/landice/tests/greenland/mesh.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def run(self):
6565

6666
section_gis = config['greenland']
6767

68+
parallel_executable = config.get('parallel', 'parallel_executable')
6869
nProcs = section_gis.get('nProcs')
6970
src_proj = section_gis.get("src_proj")
7071
data_path = section_gis.get('data_path')
@@ -100,14 +101,16 @@ def run(self):
100101

101102
# Now perform bespoke interpolation of geometry and velocity data
102103
# from their respective sources
103-
interp_gridded2mali(self, bedmachine_dataset, dst_scrip_file, nProcs,
104+
interp_gridded2mali(self, bedmachine_dataset, dst_scrip_file,
105+
parallel_executable, nProcs,
104106
self.mesh_filename, src_proj, variables="all")
105107

106108
# only interpolate a subset of MEaSUREs variables onto the MALI mesh
107109
measures_vars = ['observedSurfaceVelocityX',
108110
'observedSurfaceVelocityY',
109111
'observedSurfaceVelocityUncertainty']
110-
interp_gridded2mali(self, measures_dataset, dst_scrip_file, nProcs,
112+
interp_gridded2mali(self, measures_dataset, dst_scrip_file,
113+
parallel_executable, nProcs,
111114
self.mesh_filename, src_proj,
112115
variables=measures_vars)
113116

0 commit comments

Comments
 (0)