Skip to content

Commit

Permalink
Add parallel option (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
forsyth2 authored Jul 18, 2023
1 parent a036e61 commit d3ad171
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tests/integration/test_defaults.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ mapping_file = /home/ac.zender/data/maps/map_ne30pg2_to_cmip6_180x360_aave.20200
# climo will override this value because it has a lower-level default
nodes = 1
output = test_defaults_output
# climo will override this value because it has a lower-level default
parallel = ""
partition = haswell
# climo will override this value because it has a lower-level default
vars = "FSNTOA,FLUT,FSNT,FLNT,FSNS,FLNS,SHFLX,QFLX,TAUX,TAUY,PRECC,PRECL,PRECSC,PRECSL,TS,TREFHT,CLDTOT,CLDHGH,CLDMED,CLDLOW,U"
Expand Down
10 changes: 10 additions & 0 deletions tests/test_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def test_sections(self):
"mapping_file": "",
"output": "OUTPUT",
"nodes": 1,
"parallel": "",
"partition": "SHORT",
"plugins": [],
"qos": "regular",
Expand Down Expand Up @@ -132,6 +133,7 @@ def test_sections(self):
"mapping_file": "MAPPING_FILE_TS",
"nodes": 1,
"output": "OUTPUT",
"parallel": "",
"partition": "SHORT",
"plugins": [],
"qos": "regular",
Expand All @@ -154,6 +156,7 @@ def test_sections(self):
"exclude": False,
"mapping_file": "MAPPING_FILE_CLIMO",
"nodes": 4,
"parallel": "mpi",
"vars": "",
"years": ["0001:0050:50"],
}
Expand All @@ -180,6 +183,7 @@ def test_sections(self):
"mapping_file": "MAPPING_FILE_CLIMO",
"nodes": 4,
"output": "OUTPUT",
"parallel": "mpi",
"partition": "SHORT",
"plugins": [],
"qos": "regular",
Expand Down Expand Up @@ -229,6 +233,7 @@ def test_subsections(self):
"mapping_file": "",
"nodes": 1,
"output": "OUTPUT",
"parallel": "",
"partition": "SHORT",
"plugins": [],
"qos": "regular",
Expand Down Expand Up @@ -299,6 +304,7 @@ def test_subsections(self):
"mapping_file": "MAPPING_FILE_TS_GRID1",
"nodes": 1,
"output": "OUTPUT",
"parallel": "",
"partition": "SHORT",
"plugins": [],
"qos": "regular",
Expand Down Expand Up @@ -335,6 +341,7 @@ def test_subsections(self):
"mapping_file": "MAPPING_FILE_TS_GRID2",
"nodes": 1,
"output": "OUTPUT",
"parallel": "",
"partition": "SHORT",
"plugins": [],
"qos": "regular",
Expand Down Expand Up @@ -371,6 +378,7 @@ def test_subsections(self):
"exclude": False,
"mapping_file": "MAPPING_FILE_CLIMO",
"nodes": 4,
"parallel": "mpi",
"vars": "",
"years": ["0001:0050:50"],
}
Expand All @@ -397,6 +405,7 @@ def test_subsections(self):
"mapping_file": "MAPPING_FILE_CLIMO_GRID1",
"nodes": 4,
"output": "OUTPUT",
"parallel": "mpi",
"partition": "SHORT",
"plugins": [],
"qos": "regular",
Expand Down Expand Up @@ -428,6 +437,7 @@ def test_subsections(self):
"mapping_file": "MAPPING_FILE_CLIMO_GRID2",
"nodes": 4,
"output": "OUTPUT",
"parallel": "mpi",
"partition": "LONG",
"plugins": [],
"qos": "regular",
Expand Down
4 changes: 2 additions & 2 deletions zppy/templates/climo.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ncclimo \
{%- if vars != '' %}
--vars={{ vars }} \
{%- endif %}
--parallel=mpi \
--parallel={{ parallel }} \
--yr_srt={{ yr_start }} \
--yr_end={{ yr_end }} \
--input={{ input }}/{{ input_subdir }} \
Expand Down Expand Up @@ -105,7 +105,7 @@ cat input.txt | ncclimo \
{%- if vars != '' %}
--vars={{ vars }} \
{%- endif %}
--parallel=mpi \
--parallel={{ parallel }} \
--yr_srt={{ yr_start }} \
--yr_end={{ yr_end }} \
{% if mapping_file == '' -%}
Expand Down
4 changes: 4 additions & 0 deletions zppy/templates/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ nodes = integer(default=1)
# Where the post-processing results (`post` directory) should go
# NOTE: no default, must be provided by user
output = string
# The `parallel` option for ncclimo
parallel = string(default="")
# The partition of the machine to run on
partition = string(default="")
# External zppy plugin modules
Expand Down Expand Up @@ -69,6 +71,8 @@ active = boolean(default=True)
[climo]
exclude = boolean(default=False)
# NOTE: always overrides value in [default]
parallel = string(default="mpi")
# NOTE: always overrides value in [default]
nodes = integer(default=4)
# NOTE: always overrides value in [default]
vars = string(default="")
Expand Down
3 changes: 3 additions & 0 deletions zppy/templates/ts.bash
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ cat input.txt | ncclimo \
{%- if extra_vars != '' %}
--var_xtr={{extra_vars}} \
{%- endif %}
{%- if parallel != '' %}
--parallel={{ parallel }} \
{%- endif %}
--yr_srt={{ yr_start }} \
--yr_end={{ yr_end }} \
--ypf={{ ypf }} \
Expand Down

0 comments on commit d3ad171

Please sign in to comment.