本文整理汇总了Python中Ganga.Lib.LCG.Grid.cream_cancel_multiple方法的典型用法代码示例。如果您正苦于以下问题:Python Grid.cream_cancel_multiple方法的具体用法?Python Grid.cream_cancel_multiple怎么用?Python Grid.cream_cancel_multiple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ganga.Lib.LCG.Grid
的用法示例。
在下文中一共展示了Grid.cream_cancel_multiple方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: master_bulk_kill
# 需要导入模块: from Ganga.Lib.LCG import Grid [as 别名]
# 或者: from Ganga.Lib.LCG.Grid import cream_cancel_multiple [as 别名]
def master_bulk_kill(self):
'''GLITE bulk resubmission'''
job = self.getJobObject()
# killing the individually re-submitted subjobs
logger.debug('cancelling running/submitted subjobs.')
# 1. collect job ids
ids = []
for sj in job.subjobs:
if sj.status in ['submitted', 'running'] and sj.backend.id:
ids.append(sj.backend.id)
# 2. cancel the collected jobs
ck = Grid.cream_cancel_multiple(ids, self.credential_requirements)
if not ck:
logger.warning('Job cancellation failed')
return False
else:
for sj in job.subjobs:
if sj.backend.id in ids:
sj.updateStatus('killed')
return True
示例2: kill
# 需要导入模块: from Ganga.Lib.LCG import Grid [as 别名]
# 或者: from Ganga.Lib.LCG.Grid import cream_cancel_multiple [as 别名]
def kill(self):
'''Kill the job'''
job = self.getJobObject()
logger.info('Killing job %s' % job.getFQID('.'))
if not self.id:
logger.warning('Job %s is not running.' % job.getFQID('.'))
return False
return Grid.cream_cancel_multiple([self.id], self.credential_requirements)