Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reservation parameter #582

Merged
merged 1 commit into from
Apr 24, 2024
Merged
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
8 changes: 8 additions & 0 deletions tests/test_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def test_sections(self):
"parallel": "",
"partition": "SHORT",
"plugins": [],
"reservation": "",
"qos": "regular",
"templateDir": "zppy/templates",
"vars": "FSNTOA,FLUT,FSNT,FLNT,FSNS,FLNS,SHFLX,QFLX,TAUX,TAUY,PRECC,PRECL,PRECSC,PRECSL,TS,TREFHT,CLDTOT,CLDHGH,CLDMED,CLDLOW,U",
Expand Down Expand Up @@ -141,6 +142,7 @@ def test_sections(self):
"partition": "SHORT",
"plugins": [],
"qos": "regular",
"reservation": "",
"subsection": None,
"templateDir": "zppy/templates",
"tpd": 1,
Expand Down Expand Up @@ -194,6 +196,7 @@ def test_sections(self):
"partition": "SHORT",
"plugins": [],
"qos": "regular",
"reservation": "",
"subsection": None,
"templateDir": "zppy/templates",
"vars": "",
Expand Down Expand Up @@ -245,6 +248,7 @@ def test_subsections(self):
"partition": "SHORT",
"plugins": [],
"qos": "regular",
"reservation": "",
"templateDir": "zppy/templates",
"vars": "FSNTOA,FLUT,FSNT,FLNT,FSNS,FLNS,SHFLX,QFLX,TAUX,TAUY,PRECC,PRECL,PRECSC,PRECSL,TS,TREFHT,CLDTOT,CLDHGH,CLDMED,CLDLOW,U",
"walltime": "02:00:00",
Expand Down Expand Up @@ -321,6 +325,7 @@ def test_subsections(self):
"partition": "SHORT",
"plugins": [],
"qos": "regular",
"reservation": "",
"subsection": "ts_grid1",
"templateDir": "zppy/templates",
"tpd": 1,
Expand Down Expand Up @@ -360,6 +365,7 @@ def test_subsections(self):
"partition": "SHORT",
"plugins": [],
"qos": "regular",
"reservation": "",
"subsection": "ts_grid2",
"templateDir": "zppy/templates",
"tpd": 1,
Expand Down Expand Up @@ -429,6 +435,7 @@ def test_subsections(self):
"partition": "SHORT",
"plugins": [],
"qos": "regular",
"reservation": "",
"subsection": "climo_grid1",
"templateDir": "zppy/templates",
"vars": "",
Expand Down Expand Up @@ -462,6 +469,7 @@ def test_subsections(self):
"parallel": "mpi",
"partition": "LONG",
"plugins": [],
"reservation": "",
"qos": "regular",
"subsection": "climo_grid2",
"templateDir": "zppy/templates",
Expand Down
2 changes: 2 additions & 0 deletions zppy/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(self, c):
self.script_dir: str = c["scriptDir"]
self.nodes: int = c["nodes"]
self.partition: str = c["partition"]
self.reservation: str = c["reservation"]
self.qos: str = c["qos"]
self.walltime: str = c["walltime"]

Expand Down Expand Up @@ -55,6 +56,7 @@ def render(self, config):
c["prefix"] = self.bundle_name
c["nodes"] = self.nodes
c["partition"] = self.partition
c["reservation"] = self.reservation
c["qos"] = self.qos
c["walltime"] = self.walltime
c["tasks"] = [os.path.split(t)[-1] for t in self.tasks]
Expand Down
2 changes: 2 additions & 0 deletions zppy/templates/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ partition = string(default="")
plugins = force_list(default=list())
# Quality of service
qos = string(default="regular")
# Reservation -- if you have access to a node reservation, specify it with this parameter.
reservation = string(default="")
# scriptDir -- NOTE: this parameter is created internally
# templateDir -- NOTE: this parameter is created internally
# The variables to process
Expand Down
3 changes: 3 additions & 0 deletions zppy/templates/slurm_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#SBATCH --output={{ scriptDir }}/{{ prefix }}.o%j
#SBATCH --exclusive
#SBATCH --time={{ walltime }}
{% if reservation %}
#SBATCH --reservation={{ reservation }}
{% endif %}
{% if machine in ['anvil', 'chrysalis'] %}
#SBATCH --partition={{ partition }}

Expand Down
Loading