Skip to content

Commit

Permalink
Add slurmprovider options (#2986)
Browse files Browse the repository at this point in the history
Adds optional parameters to SlurmProvider for choosing the queue and constraint slurm options. This makes the SlurmProvider easier to work on NERSC systems which uses these options for job submissions. Queue is used to choose the jobs priority (regular, debug, realtime, etc.) and constraint to choose between cpu and gpu nodes on Perlmutter.
  • Loading branch information
tylern4 authored Dec 11, 2023
1 parent df1a8b6 commit 24ae950
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions parsl/providers/slurm/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class SlurmProvider(ClusterProvider, RepresentationMixin):
account : str
Slurm account to which to charge resources used by the job. If unspecified or ``None``, the job will use the
user's default account.
qos : str
Slurm queue to place job in. If unspecified or ``None``, no queue slurm directive will be specified.
constraint : str
Slurm job constraint, often used to choose cpu or gpu type. If unspecified or ``None``, no constraint slurm directive will be added.
channel : Channel
Channel for accessing this provider. Possible channels include
:class:`~parsl.channels.LocalChannel` (the default),
Expand Down Expand Up @@ -92,6 +96,8 @@ class SlurmProvider(ClusterProvider, RepresentationMixin):
def __init__(self,
partition: Optional[str] = None,
account: Optional[str] = None,
qos: Optional[str] = None,
constraint: Optional[str] = None,
channel: Channel = LocalChannel(),
nodes_per_block: int = 1,
cores_per_node: Optional[int] = None,
Expand Down Expand Up @@ -133,6 +139,11 @@ def __init__(self,
self.scheduler_options += "#SBATCH --partition={}\n".format(partition)
if account:
self.scheduler_options += "#SBATCH --account={}\n".format(account)
if qos:
self.scheduler_options += "#SBATCH --qos={}\n".format(qos)
if constraint:
self.scheduler_options += "#SBATCH --constraint={}\n".format(constraint)

self.regex_job_id = regex_job_id
self.worker_init = worker_init + '\n'

Expand Down

0 comments on commit 24ae950

Please sign in to comment.