Skip to content

Commit

Permalink
remove hard coded username, obtain active username for constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
daues committed Oct 31, 2023
1 parent 24bd3ed commit e3a0a26
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/lsst/ctrl/execute/slurmPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def glideinsFromJobPressure(self):
maxNumberOfGlideins = self.getNodes()
coresPerGlidein = self.getCPUs()
ratioMemCore = self.getMemoryPerCore()
auser = self.getUserName()

# initialize counters
totalCores = 0
Expand All @@ -207,7 +208,12 @@ def glideinsFromJobPressure(self):
"JobUniverse",
"RequestMemory",
]
full_constraint = '(Owner=="daues") && (JobStatus==1) && (JobUniverse==5)'
owner = "".join(["(Owner==\"", auser, "\") "])
jstat = "&& (JobStatus==1) "
juniv = "&& (JobUniverse==5)"
full_constraint = "".join([owner, jstat, juniv])
if verbose:
print(f"full_constraint {full_constraint}")
condorq_data = condor_q(
constraint=full_constraint,
schedds={schedd_name: scheddref},
Expand Down Expand Up @@ -254,7 +260,6 @@ def glideinsFromJobPressure(self):
)

# Check Slurm queue Running glideins
auser = self.getUserName()
jobname = "".join(["glide_", auser])
existingGlideinsRunning = 0
batcmd = "".join(["squeue --noheader --states=R --name=", jobname, " | wc -l"])
Expand Down

0 comments on commit e3a0a26

Please sign in to comment.