print 'logging in...' si = LoginManager.loginCommandline(backend) print 'starting job creation...' group = '/nz/nesi' #sub_loc = '[email protected]:ng2.auckland.ac.nz' batch_job = BatchJobObject(si, basename, group, 'R', Constants.NO_VERSION_INDICATOR_STRING) batch_job_name = batch_job.getJobname() print 'jobname on backend: '+batch_job_name path_to_inputfile = batch_job.pathToInputFiles()+inputfilename for i in range(1,gen_jobs+1): job = JobObject(si) job.setEmail_address(email) job.setEmail_on_job_finish(True) job.setCommandline('R --no-readline --no-restore --no-save -f '+path_to_inputfile) batch_job.addJob(job) batch_job.addInputFile('/home/markus/Desktop/R/'+inputfilename) batch_job.setDefaultNoCpus(1) batch_job.setDefaultWalltimeInSeconds(walltime)
from grisu.frontend.control.login import LoginManager from grisu.frontend.model.job import BatchJobObject, JobObject import sys batchJobName = sys.argv[1] # display commandline login menu if no local proxy exists si = LoginManager.loginCommandline() batchJob = BatchJobObject(si, batchJobName, False) start = 30 end = 40 pathToInputFiles = batchJob.pathToInputFiles() inputFile1relPath = pathToInputFiles+'inputFile1.txt ' inputFile2relPath = pathToInputFiles+'inputFile2.txt' for i in range(start, end): # create a unique jobname for every job jobname = batchJobName+"_"+ str(i) print 'Creating job: '+jobname # create the single job job = JobObject(si) 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('UnixCommands') job.setCommandline('cat '+ inputFile1relPath + ' ' + inputFile2relPath)
import time si = LoginManager.loginCommandline("BeSTGRID-DEV") # how many jobs do we want numberOfJobs = 10 # the (unique) name of the batchjob batch_job_name = "test_batch" # create the batchjob batch_job = BatchJobObject(si, batch_job_name, "/nz/nesi", "UnixCommands", Constants.NO_VERSION_INDICATOR_STRING) # now we can calculate the relative path (from every job directory) to the common input file folder pathToInputFiles = batch_job.pathToInputFiles() for i in range(0, numberOfJobs): # create the single job job = JobObject(si) # better to set the application to use explicitely because in that case we don't need to use mds (faster) job.setCommandline('cat ' + pathToInputFiles + 'commonJobFile.txt ' + 'singleJobFile.txt') # adding a job-specific input file job.addInputFileUrl("/home/markus/tmp/singleJobFile.txt") # adding the job to the multijob batch_job.addJob(job) # now we are adding a file that can be used by all of the child jobs. it needs to be referenced via the pathToInputFiles() method shown above batch_job.addInputFile('/home/markus/tmp/commonJobFile.txt')
# display commandline login menu if no local proxy exists si = LoginManager.loginCommandline() # how many jobs do we want numberOfJobs = 20 # the (unique) name of the multijob batchJobName = JobnameHelpers.calculateTimestampedJobname('exampleBatchJob') print 'Creating batchjob ' + batchJobName # create the multipart job batchJob = BatchJobObject(si, batchJobName, '/ARCS/NGAdmin', 'UnixCommands', Constants.NO_VERSION_INDICATOR_STRING) # now we can calculate the relative path (from every job directory) to the common input file folder pathToInputFiles = batchJob.pathToInputFiles() inputFile1Url = '/home/markus/test/inputFile1.txt' inputFile1relPath = pathToInputFiles + 'inputFile1.txt ' inputFile2Url = 'gsiftp://ng2.vpac.org/home/grid-vpac/DC_au_DC_org_DC_arcs_DC_slcs_O_VPAC_CN_Markus_Binsteiner_qTrDzHY7L1aKo3WSy8623-7bjgM/inputFile2.txt' inputFile2relPath = pathToInputFiles + 'inputFile2.txt' inputFile3Url = '/home/markus/test/errorFile.txt' inputFile3relPath = pathToInputFiles + 'errorFile.txt' for i in range(0, numberOfJobs): # create a unique jobname for every job jobname = batchJobName + "_" + str(i) print 'Creating job: ' + jobname
import sys import time si = LoginManager.loginCommandline("BeSTGRID-DEV") # how many jobs do we want numberOfJobs = 10 # the (unique) name of the batchjob batch_job_name = "test_batch"; # create the batchjob batch_job = BatchJobObject(si, batch_job_name, "/nz/nesi", "UnixCommands", Constants.NO_VERSION_INDICATOR_STRING); # now we can calculate the relative path (from every job directory) to the common input file folder pathToInputFiles = batch_job.pathToInputFiles() for i in range(0, numberOfJobs): # create the single job job = JobObject(si) # better to set the application to use explicitely because in that case we don't need to use mds (faster) job.setCommandline('cat ' + pathToInputFiles+'commonJobFile.txt ' + 'singleJobFile.txt') # adding a job-specific input file job.addInputFileUrl("/home/markus/tmp/singleJobFile.txt") # adding the job to the multijob batch_job.addJob(job) # now we are adding a file that can be used by all of the child jobs. it needs to be referenced via the pathToInputFiles() method shown above batch_job.addInputFile('/home/markus/tmp/commonJobFile.txt') batch_job.setDefaultNoCpus(1);
print 'logging in...' si = LoginManager.loginCommandline(backend) print 'starting job creation...' group = '/nz/nesi' #sub_loc = '[email protected]:ng2.auckland.ac.nz' batch_job = BatchJobObject(si, basename, group, 'R', Constants.NO_VERSION_INDICATOR_STRING) batch_job_name = batch_job.getJobname() print 'jobname on backend: ' + batch_job_name path_to_inputfile = batch_job.pathToInputFiles() + inputfilename for i in range(1, gen_jobs + 1): job = JobObject(si) job.setEmail_address(email) job.setEmail_on_job_finish(True) job.setCommandline('R --no-readline --no-restore --no-save -f ' + path_to_inputfile) batch_job.addJob(job) batch_job.addInputFile('/home/markus/Desktop/R/' + inputfilename) batch_job.setDefaultNoCpus(1) batch_job.setDefaultWalltimeInSeconds(walltime)