本文整理汇总了Python中DIRAC.Interfaces.API.Job.Job.setBannedSites方法的典型用法代码示例。如果您正苦于以下问题:Python Job.setBannedSites方法的具体用法?Python Job.setBannedSites怎么用?Python Job.setBannedSites使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.Interfaces.API.Job.Job
的用法示例。
在下文中一共展示了Job.setBannedSites方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_execute
# 需要导入模块: from DIRAC.Interfaces.API.Job import Job [as 别名]
# 或者: from DIRAC.Interfaces.API.Job.Job import setBannedSites [as 别名]
def test_execute( self ):
job = Job()
job.setName( "helloWorld-test" )
job.setExecutable( find_all( "helloWorld.py", '.', 'Integration' )[0],
arguments = "This is an argument",
logFile = "aLogFileForTest.txt" ,
parameters=[('executable', 'string', '', "Executable Script"),
('arguments', 'string', '', 'Arguments for executable Script'),
( 'applicationLog', 'string', '', "Log file name" ),
( 'someCustomOne', 'string', '', "boh" )],
paramValues = [( 'someCustomOne', 'aCustomValue' )] )
job.setBannedSites( ['LCG.SiteA.com', 'DIRAC.SiteB.org'] )
job.setOwner( 'ownerName' )
job.setOwnerGroup( 'ownerGroup' )
job.setName( 'jobName' )
job.setJobGroup( 'jobGroup' )
job.setType( 'jobType' )
job.setDestination( 'DIRAC.someSite.ch' )
job.setCPUTime( 12345 )
job.setLogLevel( 'DEBUG' )
res = job.runLocal( self.d )
self.assertTrue( res['OK'] )
示例2: print
# 需要导入模块: from DIRAC.Interfaces.API.Job import Job [as 别名]
# 或者: from DIRAC.Interfaces.API.Job.Job import setBannedSites [as 别名]
if NJobs == 0:
print("maximum number of jobs to submit reached")
print("breaking loop now")
break
else:
NJobs -= 1
j = Job()
# runtime in seconds times 8 (CPU normalisation factor)
j.setCPUTime(6 * 3600 * 8)
j.setName(job_name)
j.setInputSandbox(input_sandbox)
if banned_sites:
j.setBannedSites(banned_sites)
# j.setDestination( 'LCG.IN2P3-CC.fr' )
# mr_filter loses its executable property by uploading it to the GRID SE; reset
j.setExecutable('chmod', '+x mr_filter')
j.setExecutable('ls -lah')
for run_file in run_filelist:
file_token = re.split('_', run_file)[3]
# wait for a random number of seconds (up to five minutes) before starting
# to add a bit more entropy in the starting times of the dirac querries.
# if too many jobs try in parallel to access the SEs, the interface crashes
sleep = random.randint(0, 5 * 60)
j.setExecutable('sleep', str(sleep))
示例3: dexit
# 需要导入模块: from DIRAC.Interfaces.API.Job import Job [as 别名]
# 或者: from DIRAC.Interfaces.API.Job.Job import setBannedSites [as 别名]
gLogger.error("No executable defined.")
dexit(1)
j.setName("MC job")
if not opts.name is None:
j.setName(opts.name)
j.setInputSandbox(input_sandbox_files) # all input files in the sandbox
j.setOutputSandbox(output_sandbox_files)
j.setCPUTime(opts.cpu)
if not opts.site is None:
j.setDestination(opts.site.split(","))#can also be a list
if not opts.bannedSites is None:
j.setBannedSites(opts.bannedSites.split(","))
if not opts.release is None:
tag = opts.release
cl = SoftwareTagClient()
result = cl.getSitesForTag(tag,'Valid') # keyword doesn't work there.
if not result['OK']:
gLogger.error("*ERROR* Could not get sites for Tag %s"%tag,result['Message'])
dexit(1)
sites = result[ 'Value' ]
j.setDestination(sites)
if not opts.stagein is None:
input_stage_files = []
# we do add. input staging
files = opts.stagein.split(",")
示例4: Job
# 需要导入模块: from DIRAC.Interfaces.API.Job import Job [as 别名]
# 或者: from DIRAC.Interfaces.API.Job.Job import setBannedSites [as 别名]
""" simple hello world job
"""
from DIRAC.Interfaces.API.Job import Job
from DIRAC.Interfaces.API.Dirac import Dirac
from DIRAC.DataManagementSystem.Utilities.DMSHelpers import DMSHelpers
j = Job()
j.setName( "helloWorld-test" )
j.setExecutable( "exe-script.py", "", "Executable.log" )
# <-- user settings
j.setCPUTime( 172800 )
tier1s = DMSHelpers().getTiers( tier = ( 0, 1 ) )
j.setBannedSites( tier1s )
# user settings -->
# print j.workflow
# submit the job to dirac
result = Dirac().submitJob(j)
print result