本文整理汇总了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' )
示例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()
示例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()
示例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!