From 6336508710f25c9e1ae108a0d3c9ace4a82235f1 Mon Sep 17 00:00:00 2001 From: Greg Daues Date: Mon, 4 Dec 2023 19:41:48 -0800 Subject: [PATCH] first draft packing nodes --- python/lsst/ctrl/execute/allocatorParser.py | 7 +++++++ python/lsst/ctrl/execute/slurmPlugin.py | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/python/lsst/ctrl/execute/allocatorParser.py b/python/lsst/ctrl/execute/allocatorParser.py index 1c496d7..1945459 100644 --- a/python/lsst/ctrl/execute/allocatorParser.py +++ b/python/lsst/ctrl/execute/allocatorParser.py @@ -148,6 +148,13 @@ def parseArgs(self, basename): default=None, help="glide-in inactivity shutdown time in seconds", ) + parser.add_argument( + "-p", + "--pack", + action="store_true", + dest="packnodes", + help="encouraging nodes to pack jobs rather than spread", + ) parser.add_argument( "-v", "--verbose", action="store_true", dest="verbose", help="verbose" ) diff --git a/python/lsst/ctrl/execute/slurmPlugin.py b/python/lsst/ctrl/execute/slurmPlugin.py index 4ed8b5d..422a4dc 100644 --- a/python/lsst/ctrl/execute/slurmPlugin.py +++ b/python/lsst/ctrl/execute/slurmPlugin.py @@ -137,6 +137,11 @@ def loadSlurm(self, name, platformPkgDir): self.allocationFileName ) + if self.opts.packnodes is None: + self.defaults["PACK_BLOCK"] = "#" + else: + self.defaults["PACK_BLOCK"] = "Rank = TotalCpus - Cpus" + # handle dynamic slot block template: # 1) if it isn't specified, just put a comment in it's place # 2) if it's specified, but without a filename, use the default