Skip to content

Commit

Permalink
Merge pull request #24 from lsst/tickets/DM-42101
Browse files Browse the repository at this point in the history
DM:42101: changes for new qos handling
  • Loading branch information
daues committed Dec 8, 2023
2 parents 883fba3 + 2ac992b commit 1e8eb4f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
7 changes: 6 additions & 1 deletion python/lsst/ctrl/execute/allocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def __init__(self, platform, opts, configuration, condorInfoFileName):
self.commandLineDefaults["CPUS"] = self.opts.cpus
self.commandLineDefaults["WALL_CLOCK"] = self.opts.maximumWallClock
self.commandLineDefaults["ACCOUNT"] = self.opts.account
self.commandLineDefaults["QOS"] = self.opts.qos
self.commandLineDefaults["MEMPERCORE"] = 4096
self.commandLineDefaults["QUEUE"] = self.opts.queue
self.load()
Expand Down Expand Up @@ -326,6 +325,12 @@ def getMemoryPerCore(self):
"""
return self.getParameter("MEMPERCORE")

def getQOS(self):
"""Accessor for QOS
@return the value of QOS
"""
return self.getParameter("QOS")

def getCPUs(self):
"""Accessor for CPUS
@return the value of CPUS
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/ctrl/execute/allocatorParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ def parseArgs(self, basename):
"-s",
"--qos",
action="store",
default="normal",
default=None,
dest="qos",
help="Slurm qos or glidein job",
help="Slurm qos for glidein job",
type=str,
)
parser.add_argument(
Expand Down
7 changes: 6 additions & 1 deletion python/lsst/ctrl/execute/slurmPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,16 @@ def submit(self, platform, platformPkgDir):
def loadSlurm(self, name, platformPkgDir):
if self.opts.reservation is not None:
self.defaults["RESERVATION"] = (
"#SBATCH --reservation=%s" % self.opts.reservation
"#SBATCH --reservation %s" % self.opts.reservation
)
else:
self.defaults["RESERVATION"] = ""

if self.opts.qos:
self.defaults["QOS"] = "#SBATCH --qos %s" % self.opts.qos
else:
self.defaults["QOS"] = ""

allocationConfig = self.loadAllocationConfig(name, "slurm")

template = Template(allocationConfig.platform.scratchDirectory)
Expand Down

0 comments on commit 1e8eb4f

Please sign in to comment.