Skip to content

Commit

Permalink
Merge pull request #880 from radical-cybertools/fix/perlmutter
Browse files Browse the repository at this point in the history
added possibility to set `partition[:qos]` as `queue`
  • Loading branch information
mtitov authored Jun 28, 2023
2 parents 44ea928 + ae47508 commit 29b7bcc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/radical/saga/adaptors/slurm/slurm_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,14 @@ def _job_run(self, job_obj):
else:
account, reservation = project, None

if queue and ':' in queue:
partition, qos = queue.split(':', 1)
else:
if 'perlmutter' in self.rm.host.lower():
partition, qos = None, queue
else:
partition, qos = queue, None

script = "#!/bin/sh\n\n"

# make sure we have something for cpu_count
Expand All @@ -668,7 +676,8 @@ def _job_run(self, job_obj):
resource = self.rm.host.split('.', 1)[0].lower()
# check user provided value first, then check discovered value
procs_per_host = procs_per_host or \
PPN_PER_QUEUE.get(resource, {}).get(queue.lower()) or \
PPN_PER_QUEUE.get(resource, {}).\
get(partition.lower()) or \
self._ppn

# define n_nodes and recalculate mem_per_node
Expand Down Expand Up @@ -807,7 +816,8 @@ def _job_run(self, job_obj):
if error : script += '#SBATCH --error "%s"\n' % error
if job_contact : script += '#SBATCH --mail-user="%s"\n' % job_contact
if account : script += '#SBATCH --account "%s"\n' % account
if queue : script += '#SBATCH --partition "%s"\n' % queue
if partition : script += '#SBATCH --partition "%s"\n' % partition
if qos : script += '#SBATCH --qos "%s"\n' % qos
if reservation : script += '#SBATCH --reservation "%s"\n' % reservation
if c_hosts : script += '#SBATCH --nodelist="%s"\n' % c_hosts
if constraints : script += '#SBATCH --constraint "%s"\n' % \
Expand Down

0 comments on commit 29b7bcc

Please sign in to comment.