本文整理匯總了Python中DIRAC.Core.Utilities.ProcessPool.ProcessPool.getNumWorkingProcesses方法的典型用法代碼示例。如果您正苦於以下問題:Python ProcessPool.getNumWorkingProcesses方法的具體用法?Python ProcessPool.getNumWorkingProcesses怎麽用?Python ProcessPool.getNumWorkingProcesses使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DIRAC.Core.Utilities.ProcessPool.ProcessPool
的用法示例。
在下文中一共展示了ProcessPool.getNumWorkingProcesses方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ProcessPool
# 需要導入模塊: from DIRAC.Core.Utilities.ProcessPool import ProcessPool [as 別名]
# 或者: from DIRAC.Core.Utilities.ProcessPool.ProcessPool import getNumWorkingProcesses [as 別名]
pPool = ProcessPool(10,50,50)
pPool.daemonize()
# dirlist = ['prod/ilc/mc-dbd/generated','prod/ilc/mc-dbd/ild']
# dirlist= ['prod/ilc/mc-dbd/generated/500-TDR_ws/higgs']
# dirlist= ['prod/ilc/mc-dbd/generated/250-TDR_ws/higgs','prod/ilc/mc-dbd/generated/350-TDR_ws/higgs']
#dirlist= ['prod/ilc/mc-dbd/generated/250-TDR_ws']
#dirlist= ['prod/ilc/mc-dbd/generated/250-TDR_ws/1f',
# 'prod/ilc/mc-dbd/generated/250-TDR_ws/3f',
# 'prod/ilc/mc-dbd/generated/250-TDR_ws/aa_lowpt',
# 'prod/ilc/mc-dbd/generated/250-TDR_ws/aa_minijet']
#dirlist= ['prod/ilc/mc-dbd/generated/250-TDR_ws/aa_2f',
# 'prod/ilc/mc-dbd/generated/350-TDR_ws/3f',
# 'prod/ilc/mc-dbd/generated/350-TDR_ws/1f',
# 'prod/ilc/mc-dbd/generated/350-TDR_ws/aa_minijet']
lfcHosts = ['grid-lfc.desy.de']
for dir in dirlist:
path = "/ilc/%s" % (dir)
print "Queueing user", dir, pPool.getFreeSlots(),pPool.getNumWorkingProcesses(),pPool.hasPendingTasks(),pPool.getNumIdleProcesses(), lfcHosts[0]
result = pPool.createAndQueueTask( processDir,[path,True,lfcHosts[0]],callback=finalizeDirectory )
if not result['OK']:
print "Failed queueing", path
pPool.processAllResults()
print "LFC_to_DFC completed."