Skip to content

Commit

Permalink
Add the ability to specify cores per task for SLURM (#94)
Browse files Browse the repository at this point in the history
* Addition of a general way to append additional parameters.

* Addition of "cores per task" to SLURM adapter.
  • Loading branch information
FrankD412 committed May 1, 2018
1 parent 9f3243d commit 2baf994
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions maestrowf/interfaces/script/slurmscriptadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __init__(self, **kwargs):
"ntasks": "-n",
"nodes": "-N",
"reservation": "--reservation",
"cores per task": "-c",
}

def get_header(self, step):
Expand Down Expand Up @@ -140,12 +141,15 @@ def get_parallelize_command(self, procs, nodes=None, **kwargs):
str(nodes),
]

rsvp = kwargs.pop("reservation", "")
if rsvp:
args += [
self._cmd_flags["reservation"],
"\"{}\"".format(str(rsvp))
]
for key, value in kwargs.items():
if key not in self._cmd_flags:
LOGGER.warning("'%s' is not supported -- ommitted.")
continue
if value:
args += [
self._cmd_flags[key],
"\"{}\"".format(str(value))
]

return " ".join(args)

Expand Down

0 comments on commit 2baf994

Please sign in to comment.