Skip to content

Commit

Permalink
Merge pull request #5684 from belforte/maxWall
Browse files Browse the repository at this point in the history
introduce MaxWallTimeMinsRun. Fix #5683
  • Loading branch information
belforte authored Jun 3, 2018
2 parents 99e7034 + a0550be commit 94f4987
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/python/TaskWorker/Actions/DagmanCreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@
((JobStatus =?= 1) && (time() - EnteredCurrentStatus > 7*24*60*60)) || \
((JobStatus =?= 2) && ( \
(MemoryUsage > RequestMemory) || \
(MaxWallTimeMins*60 < time() - EnteredCurrentStatus) || \
(MaxWallTimeMinsRun*60 < time() - EnteredCurrentStatus) || \
(DiskUsage > %(max_disk_space)s))) || \
(time() > CRAB_TaskEndTime) || \
((JobStatus =?= 1) && (time() > (x509UserProxyExpiration + 86400)))
+PeriodicRemoveReason = ifThenElse(time() - EnteredCurrentStatus > 7*24*60*60 && isUndefined(MemoryUsage), "Removed due to idle time limit", \
ifThenElse(time() > x509UserProxyExpiration, "Removed job due to proxy expiration", \
ifThenElse(MemoryUsage > RequestMemory, "Removed due to memory use", \
ifThenElse(MaxWallTimeMins*60 < time() - EnteredCurrentStatus, "Removed due to wall clock limit", \
ifThenElse(MaxWallTimeMinsRun*60 < time() - EnteredCurrentStatus, "Removed due to wall clock limit", \
ifThenElse(DiskUsage > %(max_disk_space)s, "Removed due to disk usage", \
ifThenElse(time() > CRAB_TaskEndTime, "Removed due to reached CRAB_TaskEndTime", \
"Removed due to job being held"))))))
Expand Down
1 change: 1 addition & 0 deletions src/python/TaskWorker/Actions/DagmanSubmitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
('RequestMemory', 'tm_maxmemory'),
('RequestCpus', 'tm_numcores'),
('MaxWallTimeMins', 'tm_maxjobruntime'),
('MaxWallTimeMinsRun', 'tm_maxjobruntime'),
('MaxWallTimeMinsProbe', 'maxproberuntime'),
('MaxWallTimeMinsTail', 'maxtailruntime'),
('JobPrio', 'tm_priority'),
Expand Down
7 changes: 4 additions & 3 deletions src/python/TaskWorker/Actions/PreJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ def alter_submit(self, crab_retry):
maxjobruntime = int(str(self.task_ad.lookup('MaxWallTimeMinsProbe')))
elif 'MaxWallTimeMinsTail' in self.task_ad and self.stage == 'tail':
maxjobruntime = int(str(self.task_ad.lookup('MaxWallTimeMinsTail')))
elif 'MaxWallTimeMins' in self.task_ad:
maxjobruntime = int(str(self.task_ad.lookup('MaxWallTimeMins')))
elif 'MaxWallTimeMinsRun' in self.task_ad:
maxjobruntime = int(str(self.task_ad.lookup('MaxWallTimeMinsRun')))
if 'RequestMemory' in self.task_ad:
maxmemory = int(str(self.task_ad.lookup('RequestMemory')))
if 'RequestCpus' in self.task_ad:
Expand Down Expand Up @@ -341,7 +341,8 @@ def alter_submit(self, crab_retry):
new_submit_text += '+CRAB_TransferOutputs = {0}\n+CRAB_SaveLogsFlag = {1}\n'.format(saveoutputs, savelogs)
if maxjobruntime is not None:
new_submit_text += '+EstimatedWallTimeMins = %s\n' % str(maxjobruntime)
new_submit_text += '+MaxWallTimeMins = %s\n' % str(maxjobruntime)
new_submit_text += '+MaxWallTimeMinsRun = %s\n' % str(maxjobruntime) # how long it can run
new_submit_text += '+MaxWallTimeMins = %s\n' % str(maxjobruntime) # how long a slot can it match to
if maxmemory is not None:
new_submit_text += '+RequestMemory = %s\n' % (str(maxmemory))
if numcores is not None:
Expand Down
6 changes: 3 additions & 3 deletions src/python/TaskWorker/Actions/RetryJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,11 @@ def execute_internal(self, logger, reqname, job_return_code, dag_retry, crab_ret
if used_job_ad:
#We can determine walltime and max memory from job ad.
self.ad = job_ad
if 'MaxWallTimeMins' in self.ad:
if 'MaxWallTimeMinsRun' in self.ad:
try:
MAX_WALLTIME = int(self.ad['MaxWallTimeMins']) * 60
MAX_WALLTIME = int(self.ad['MaxWallTimeMinsRun']) * 60
except:
msg = "Unable to get MaxWallTimeMins from job classads. Using the default."
msg = "Unable to get MaxWallTimeMinsRun from job classads. Using the default MAX_WALLTIME."
self.logger.debug(msg)
if 'RequestMemory' in self.ad:
try:
Expand Down

0 comments on commit 94f4987

Please sign in to comment.