本文整理汇总了Python中Ganga.Lib.LCG.Grid.arc_cancelMultiple方法的典型用法代码示例。如果您正苦于以下问题:Python Grid.arc_cancelMultiple方法的具体用法?Python Grid.arc_cancelMultiple怎么用?Python Grid.arc_cancelMultiple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ganga.Lib.LCG.Grid
的用法示例。
在下文中一共展示了Grid.arc_cancelMultiple方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __mt_bulk_submit__
# 需要导入模块: from Ganga.Lib.LCG import Grid [as 别名]
# 或者: from Ganga.Lib.LCG.Grid import arc_cancelMultiple [as 别名]
def __mt_bulk_submit__(self, node_jdls):
'''submitting jobs in multiple threads'''
job = self.getJobObject()
logger.warning(
'submitting %d subjobs ... it may take a while' % len(node_jdls))
# the algorithm for submitting a single bulk job
class MyAlgorithm(Algorithm):
def __init__(self, masterInputWorkspace, ce, arcverbose):
Algorithm.__init__(self)
self.inpw = masterInputWorkspace
self.ce = ce
self.arcverbose = arcverbose
def process(self, jdl_info):
my_sj_id = jdl_info[0]
my_sj_jdl = jdl_info[1]
#my_sj_jid = self.gridObj.arc_submit(my_sj_jdl, self.ce, self.verbose)
my_sj_jid = Grid.arc_submit(
my_sj_jdl, self.ce, self.arcverbose)
if not my_sj_jid:
return False
else:
self.__appendResult__(my_sj_id, my_sj_jid)
return True
mt_data = []
for id, jdl in node_jdls.items():
mt_data.append((id, jdl))
myAlg = MyAlgorithm(masterInputWorkspace=job.getInputWorkspace(
), ce=self.CE, arcverbose=self.verbose)
myData = Data(collection=mt_data)
runner = MTRunner(name='arc_jsubmit', algorithm=myAlg,
data=myData, numThread=config['SubmissionThread'])
runner.start()
runner.join(timeout=-1)
if len(runner.getDoneList()) < len(mt_data):
# not all bulk jobs are successfully submitted. canceling the
# submitted jobs on WMS immediately
logger.error(
'some bulk jobs not successfully (re)submitted, canceling submitted jobs on WMS')
Grid.arc_cancelMultiple(runner.getResults().values())
return None
else:
return runner.getResults()
示例2: master_bulk_kill
# 需要导入模块: from Ganga.Lib.LCG import Grid [as 别名]
# 或者: from Ganga.Lib.LCG.Grid import arc_cancelMultiple [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.arc_cancelMultiple(ids)
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