Exemplo n.º 1
0
except:
    print "No need to kill and clean job " + multiJobName
    

# to see whats going on we add a simple event listener. Hm. This doesn't seem to work reliably in jython. 
#SystemOutMultiJobLogger(multiJobName)

# create the multipart job 
multiPartJob = BatchJobObject(si, multiJobName, "/ARCS/NGAdmin", "java", Constants.NO_VERSION_INDICATOR_STRING);

# if you want to display a gui element to control/monitor the job, use the following line
BatchJobDialog.open(si, multiJobName)

# not needed anymore. it's the default now
multiPartJob.addJobProperty(Constants.DISTRIBUTION_METHOD, Constants.DISTRIBUTION_METHOD_EQUAL);

# now we can calculate the relative path (from every job directory) to the common input file folder
pathToInputFiles = multiPartJob.pathToInputFiles()

for i in range(0, numberOfJobs):
    # create a unique jobname for every job
    jobname = multiJobName+"_"+ str(i)
    # create the single job
    job = JobObject(si)
    #job.setSubmissionLocation("")
    job.setJobname(jobname)
    # better to set the application to use explicitely because in that case we don't need to use mds (faster)
    job.setApplication("java")
    job.setCommandline("java -version")
    # setting the commandline. In this example we reference to both types of possible input files