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

support for account, qos in Slurm submission #20

Merged
merged 5 commits into from
Oct 12, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions python/lsst/ctrl/execute/allocator.py
Expand Up @@ -96,6 +96,9 @@ def __init__(self, platform, opts, configuration, condorInfoFileName):
self.commandLineDefaults["NODE_COUNT"] = self.opts.nodeCount
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 @@ -303,6 +306,12 @@ def getNodes(self):
"""
return self.getParameter("NODE_COUNT")

def getMemoryPerCore(self):
"""Accessor for MemoryPerCore
@return the value of MemoryPerCore
"""
return self.getParameter("MEMPERCORE")

def getCPUs(self):
"""Accessor for CPUS
@return the value of CPUS
Expand Down
18 changes: 18 additions & 0 deletions python/lsst/ctrl/execute/allocatorParser.py
Expand Up @@ -81,6 +81,24 @@ def parseArgs(self, basename):
type=int,
required=True,
)
parser.add_argument(
"-a",
"--account",
action="store",
default="rubin:developers",
dest="account",
help="Slurm account for glidein job",
type=str,
)
parser.add_argument(
"-s",
"--qos",
action="store",
default="normal",
dest="qos",
help="Slurm qos or glidein job",
type=str,
)
parser.add_argument(
"-m",
"--maximum-wall-clock",
Expand Down
5 changes: 4 additions & 1 deletion python/lsst/ctrl/execute/slurmPlugin.py
Expand Up @@ -61,6 +61,9 @@ def submit(self, platform, platformPkgDir):
self.createAllocationFile(allocationName)

nodes = self.getNodes()
cpus = self.getCPUs()
memoryPerCore = self.getMemoryPerCore()
totalMemory = cpus * memoryPerCore
print("Targeting %s glidein(s) for the computing pool/set." % nodes)

# run the sbatch command
Expand All @@ -77,7 +80,7 @@ def submit(self, platform, platformPkgDir):

print("The generated Slurm submit file is %s " % generatedSlurmFile)

cmd = "sbatch %s" % generatedSlurmFile
cmd = "sbatch --mem %s %s" % (totalMemory, generatedSlurmFile)

auser = self.getUserName()
jobname = "".join(["glide_", auser])
Expand Down