Skip to content

Commit

Permalink
modify maxPSS per task
Browse files Browse the repository at this point in the history
  • Loading branch information
LinaresToine committed Mar 29, 2024
2 parents 59497f5 + 9658b9c commit e5d8a33
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/python/WMComponent/RetryManager/Modifier/BaseModifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def updateSandbox(self, jobPKL, workload): # Not using workload?
tempDir.cleanup()
return

<<<<<<< HEAD
def getTask(self, jobPKL):
"""
_getTask_
Expand All @@ -70,11 +71,18 @@ def getTask(self, jobPKL):
task = jobPKL['task']
return task

=======

>>>>>>> 9658b9cb711aa8a6c2e83b7b3c2049277dc491f6
def getWorkload(self, jobPKL):
"""
_getWorkload_
<<<<<<< HEAD
=======
>>>>>>> 9658b9cb711aa8a6c2e83b7b3c2049277dc491f6
"""
pklPath = jobPKL['spec']

Expand Down
10 changes: 10 additions & 0 deletions src/python/WMComponent/RetryManager/Modifier/MemoryModifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,24 @@ def changeSandbox(self, jobPKL, newMemory):

for task in workHelper.getAllTasks():
task.setMaxPSS(newMemory)
<<<<<<< HEAD

=======
>>>>>>> 9658b9cb711aa8a6c2e83b7b3c2049277dc491f6

self.setWorkload(workload, jobPKL)

return
<<<<<<< HEAD

def changeMemoryForTask(self, jobPKL, newMemory):
"""
Approach to modify memory per task, rather than continuously changing the whole workflow
"""
task = self.getTask(jobPKL)
task.setMaxPSS(newMemory)
=======
>>>>>>> 9658b9cb711aa8a6c2e83b7b3c2049277dc491f6

def changeJobPkl(self, pklFile, jobPKL, newMemory):
"""
Expand Down Expand Up @@ -88,7 +94,11 @@ def changeMemory(self, job, settings):
newMemory = self.getNewMemory(jobPKL, settings)

self.changeJobPkl(pklFile, jobPKL, newMemory)
<<<<<<< HEAD
self.changeMemoryForTask(jobPKL, newMemory)
=======
self.changeSandbox(jobPKL, newMemory)
>>>>>>> 9658b9cb711aa8a6c2e83b7b3c2049277dc491f6
logging.info('Old maxPSS: %d. New maxPSS: %d', job['estimatedMemoryUsage'], newMemory)

def modifyJob(self, job):
Expand Down

0 comments on commit e5d8a33

Please sign in to comment.