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


Python Dirac.submitJob方法代码示例

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


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

示例1: runLocal

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import submitJob [as 别名]
  def runLocal( self, dirac = None ):
    """ The dirac (API) object is for local submission.
    """

    if dirac is None:
      dirac = Dirac()

    return dirac.submitJob( self, mode = 'local' )
开发者ID:ahaupt,项目名称:DIRAC,代码行数:10,代码来源:Job.py

示例2: int

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import submitJob [as 别名]
  print "Usage %s <scriptName> <jobName> <nbJobs>"%sys.argv[0]
  sys.exit(1)

scriptName = sys.argv[1]
jobName = sys.argv[2]
nbJobs = int(sys.argv[3])

if not os.path.exists(jobName):
  os.makedirs(jobName)
  os.makedirs("%s/Done"%jobName)
  os.makedirs("%s/Failed"%jobName)
else:
  print "Folder %s exists"%jobName
  sys.exit(1)      

f = open("%s/jobIdList.txt"%jobName, 'w')

for i in xrange(nbJobs):
  j = Job()
  j.setCPUTime(10000)
  j.setExecutable(scriptName)
  j.addToOutputSandbox.append('myLog.txt')
  j.addToOutputSandbox.append('clock.txt')
  j.addToOutputSandbox.append('time.txt')
  dirac = Dirac()
  jobID = dirac.submitJob(j)
  realId = jobID.get('JobID')
  f.write("%s\n"%realId)

f.close()
开发者ID:DIRACGrid,项目名称:DIRAC,代码行数:32,代码来源:submitJobs.py

示例3: Dirac

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import submitJob [as 别名]
dirac = Dirac(use_repo, repo_name)
exitCode = 0
errorList = []

jFile = None
for sw, value in unprocessed_switches:
  if sw.lower() in ( 'f', 'file' ):
    if os.path.isfile( value ):
      print 'Appending job ids to existing logfile: %s' %value
      if not os.access( value , os.W_OK ):
        print 'Existing logfile %s must be writable by user.' %value
    jFile = open( value, 'a' )

for jdl in args:

  result = dirac.submitJob( jdl )
  if result['OK']:
    print 'JobID = %s' % ( result['Value'] )
    if jFile != None:
      # parametric jobs
      if isinstance( result['Value'], list ):
        jFile.write( '\n'.join(str(p) for p in result['Value']) )
        jFile.write( '\n' )
      else:  
        jFile.write( str( result['Value'] )+'\n' )
  else:
    errorList.append( ( jdl, result['Message'] ) )
    exitCode = 2

if jFile != None:
  jFile.close()
开发者ID:DIRACGrid-test,项目名称:DIRAC,代码行数:33,代码来源:dirac-wms-job-submit.py

示例4: Dirac

# 需要导入模块: from DIRAC.Interfaces.API.Dirac import Dirac [as 别名]
# 或者: from DIRAC.Interfaces.API.Dirac.Dirac import submitJob [as 别名]
gLogger.setLevel('DEBUG')

cwd = os.path.realpath('.')

dirac = Dirac()

# Simple Hello Word job to DIRAC.Jenkins.ch
gLogger.info("\n Submitting hello world job targeting DIRAC.Jenkins.ch")
helloJ = Job()
helloJ.setName("helloWorld-TEST-TO-Jenkins")
helloJ.setInputSandbox([find_all('exe-script.py', '..', '/DIRAC/tests/Workflow/')[0]])
helloJ.setExecutable("exe-script.py", "", "helloWorld.log")
helloJ.setCPUTime(17800)
helloJ.setDestination('DIRAC.Jenkins.ch')
result = dirac.submitJob(helloJ)
gLogger.info("Hello world job: ", result)
if not result['OK']:
  gLogger.error("Problem submitting job", result['Message'])
  exit(1)

# Simple Hello Word job to DIRAC.Jenkins.ch, that needs to be matched by a MP WN
gLogger.info("\n Submitting hello world job targeting DIRAC.Jenkins.ch and a MP WN")
helloJMP = Job()
helloJMP.setName("helloWorld-TEST-TO-Jenkins-MP")
helloJMP.setInputSandbox([find_all('exe-script.py', '..', '/DIRAC/tests/Workflow/')[0]])
helloJMP.setExecutable("exe-script.py", "", "helloWorld.log")
helloJMP.setCPUTime(17800)
helloJMP.setDestination('DIRAC.Jenkins.ch')
helloJMP.setTag('MultiProcessor')
result = dirac.submitJob(helloJMP)  # this should make the difference!
开发者ID:DIRACGrid,项目名称:DIRAC,代码行数:32,代码来源:dirac-test-job.py


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