当前位置: 首页>>代码示例>>Python>>正文


Python ProcessPool.getNumIdleProcesses方法代码示例

本文整理汇总了Python中DIRAC.Core.Utilities.ProcessPool.ProcessPool.getNumIdleProcesses方法的典型用法代码示例。如果您正苦于以下问题:Python ProcessPool.getNumIdleProcesses方法的具体用法?Python ProcessPool.getNumIdleProcesses怎么用?Python ProcessPool.getNumIdleProcesses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DIRAC.Core.Utilities.ProcessPool.ProcessPool的用法示例。


在下文中一共展示了ProcessPool.getNumIdleProcesses方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ProcessPool

# 需要导入模块: from DIRAC.Core.Utilities.ProcessPool import ProcessPool [as 别名]
# 或者: from DIRAC.Core.Utilities.ProcessPool.ProcessPool import getNumIdleProcesses [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."


开发者ID:akiyamiyamoto,项目名称:ildprod,代码行数:30,代码来源:LFC_to_DFC.py


注:本文中的DIRAC.Core.Utilities.ProcessPool.ProcessPool.getNumIdleProcesses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。