本文整理汇总了Python中userinterface.Client.reassignJobs方法的典型用法代码示例。如果您正苦于以下问题:Python Client.reassignJobs方法的具体用法?Python Client.reassignJobs怎么用?Python Client.reassignJobs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类userinterface.Client
的用法示例。
在下文中一共展示了Client.reassignJobs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from userinterface import Client [as 别名]
# 或者: from userinterface.Client import reassignJobs [as 别名]
import sys
import userinterface.Client as Client
if len(sys.argv) == 2:
Client.reassignJobs([sys.argv[1]])
else:
startID = int(sys.argv[1])
endID = int(sys.argv[2])
if startID > endID:
print '%d is less than %d' % (endID,startID)
sys.exit(1)
Client.reassignJobs(range(startID,endID+1))
示例2: len
# 需要导入模块: from userinterface import Client [as 别名]
# 或者: from userinterface.Client import reassignJobs [as 别名]
sql = "SELECT PandaID,lockedby FROM ATLAS_PANDA.jobsActive4 "
sql += "WHERE jobStatus=:jobStatus AND computingSite=:computingSite AND modificationTime<:modificationTime AND prodSourceLabel=:prodSourceLabel ORDER BY PandaID"
status,res = proxyS.querySQLS(sql,varMap)
print "got {0} jobs".format(len(res))
jobs = []
jediJobs = []
if res != None:
for (id,lockedby) in res:
if lockedby == 'jedi':
jediJobs.append(id)
else:
jobs.append(id)
if len(jobs):
nJob = 100
iJob = 0
while iJob < len(jobs):
print 'reassign %s' % str(jobs[iJob:iJob+nJob])
Client.reassignJobs(jobs[iJob:iJob+nJob])
iJob += nJob
if len(jediJobs) != 0:
nJob = 100
iJob = 0
while iJob < len(jediJobs):
print 'kill JEDI jobs %s' % str(jediJobs[iJob:iJob+nJob])
Client.killJobs(jediJobs[iJob:iJob+nJob],51)
iJob += nJob
示例3: sort
# 需要导入模块: from userinterface import Client [as 别名]
# 或者: from userinterface.Client import reassignJobs [as 别名]
allSites = []
for site in tmpSites:
# _allSites may conain NULL after sort()
if site == 'NULL':
continue
# ignore test sites
if site.endswith('test') or site.endswith('Test'):
continue
# append
allSites.append(site)
# reassign jobs
jobs=[]
for (id,modTime) in res:
if modTime < timeLimit:
jobs.append(id)
# reassign
if len(jobs):
nJob = 20
iJob = 0
while iJob < len(jobs):
print 'reassignJobs(%s)' % jobs[iJob:iJob+nJob]
index = random.randint(1,len(allSites))
site = allSites[int(index)-1]
print 'site=%s' % site
Client.reassignJobs(jobs[iJob:iJob+nJob],site)
iJob += nJob
time.sleep(10)