Example #1
0
    def prepare(self):
        job = JobObject(self.si)
        job.setUniqueJobname("echo_job1")
        job.setCommandline('echo "Hello World"')

        job.createJob()
        self.job = job
Example #2
0
    def prepare(self):
        job = JobObject(self.si)
        job.setUniqueJobname("echo_job1")
        job.setCommandline("echo \"Hello World\"")

        job.createJob()
        self.job = job
Example #3
0
    def prepare(self):

        job = JobObject(self.si)
        job.setUniqueJobname("echo_job1")
        job.setCommandline("echo \"Hello World\"")
        job.addInputFileUrl("/home/markus/tmp/text0.txt")

        job.createJob()
        self.job = job
Example #4
0
    def prepare(self):

        job = JobObject(self.si)
        job.setUniqueJobname("echo_job1")
        job.setCommandline('echo "Hello World"')
        job.addInputFileUrl("/home/markus/tmp/text0.txt")

        job.createJob()
        self.job = job
Example #5
0
    def prepare(self):
        job = JobObject(self.si)
        job.setUniqueJobname("echo_job1")
        job.setCommandline('echo "Hello World"')
        job.addInputFileUrl("/home/markus/tmp/46mbInput0.bin")
        job.setApplication(Constants.GENERIC_APPLICATION_NAME)
        job.setSubmissionLocation(self.subLoc)

        job.createJob()

        self.job = job
Example #6
0
    def prepare(self):
        job = JobObject(self.si)
        job.setUniqueJobname("echo_job1")
        job.setCommandline("echo \"Hello World\"")
        job.addInputFileUrl("/home/markus/tmp/46mbInput0.bin")
        job.setApplication(Constants.GENERIC_APPLICATION_NAME)
        job.setSubmissionLocation(self.subLoc)

        job.createJob()

        self.job = job
Example #7
0
    def prepare(self):

        job = JobObject(self.si);
        job.setUniqueJobname("echo_job1")
        job.setCommandline("echo \"Hello World\"")
        job.addInputFileUrl("gsiftp://ng2.canterbury.ac.nz/home/gridcloud061/tmp/text0.txt");
        job.addInputFileUrl("gsiftp://ng2.canterbury.ac.nz/home/gridcloud061/tmp/text1.txt");
        job.addInputFileUrl("gsiftp://ng2.canterbury.ac.nz/home/gridcloud061/tmp/text2.txt");
        job.addInputFileUrl("gsiftp://ng2.canterbury.ac.nz/home/gridcloud061/tmp/text3.txt");
        job.addInputFileUrl("gsiftp://ng2.canterbury.ac.nz/home/gridcloud061/tmp/text4.txt");
        job.setApplication(Constants.GENERIC_APPLICATION_NAME)
        job.setSubmissionLocation(self.subLoc)

        job.createJob()
        
        self.job = job        
Example #8
0
class simpleStageJob(action):
    def __init__(self, si, subLoc=defaultSubLoc):
        super(simpleStageJob, self).__init__(si, subLoc)

        self.job = JobObject(self.si)
        self.job.setCommandline('echo "hello world"')
        self.job.setApplication(Constants.GENERIC_APPLICATION_NAME)
        self.job.setSubmissionLocation(self.subLoc)

    def prepare(self):

        self.job.setUniqueJobname(self.name())
        self.job.createJob()

    def execute(self):
        self.job.submitJob()
Example #9
0
class simpleStageJob(action):
    def __init__(self, si, subLoc=defaultSubLoc):
        super(simpleStageJob, self).__init__(si, subLoc)

        self.job = JobObject(self.si)
        self.job.setCommandline("echo \"hello world\"")
        self.job.setApplication(Constants.GENERIC_APPLICATION_NAME)
        self.job.setSubmissionLocation(self.subLoc)

    def prepare(self):

        self.job.setUniqueJobname(self.name())
        self.job.createJob()

    def execute(self):
        self.job.submitJob()
Example #10
0
    def prepare(self):

        job = JobObject(self.si)
        job.setUniqueJobname("echo_job1")
        job.setCommandline("echo \"Hello World\"")
        job.addInputFileUrl(
            "gsiftp://ng2.canterbury.ac.nz/home/gridcloud061/tmp/text0.txt")
        job.addInputFileUrl(
            "gsiftp://ng2.canterbury.ac.nz/home/gridcloud061/tmp/text1.txt")
        job.addInputFileUrl(
            "gsiftp://ng2.canterbury.ac.nz/home/gridcloud061/tmp/text2.txt")
        job.addInputFileUrl(
            "gsiftp://ng2.canterbury.ac.nz/home/gridcloud061/tmp/text3.txt")
        job.addInputFileUrl(
            "gsiftp://ng2.canterbury.ac.nz/home/gridcloud061/tmp/text4.txt")
        job.setApplication(Constants.GENERIC_APPLICATION_NAME)
        job.setSubmissionLocation(self.subLoc)

        job.createJob()

        self.job = job
Example #11
0
    def submit(self):
        
        if self.jobs:
            print 'There is already a run with the name "'+self.jobname+'". Exiting...'
            sys.exit(1)
            
        # uploading input file once, so we don't need to do it for every job again and again
        fm.cp(self.filepath, 'gsiftp://pan.nesi.org.nz/~/inputfiles/'+self.jobname, True)
        
        for i in range(0,self.runs):
            
            # create the job object
            job = JobObject(si);
            # set a unique jobname
            number = str(i+1).zfill(4)
            job.setUniqueJobname(self.jobname+"_run_"+number)
            # set the commandline that needs to be executed
            job.setCommandline(megabeast_path+' '+remote_home_dir+'/inputfiles/'+self.jobname+'/'+self.filename)
            job.setSubmissionLocation('pan:pan.nesi.org.nz')
            
            job.setCpus(self.cpus)

            job.setWalltime(self.walltime)
            
            job.setMemory(self.memory)
            
            job.setApplication('UltraBEAST')
            job.setApplicationVersion('0.1')
            
            #job.addInputFileUrl(self.filepath)
            
            # create the job on the backend and specify the VO to use
            temp_jobname = job.createJob("/nz/nesi")
            print "created job: '"+temp_jobname+"', submitting..."
            # submit the job
            job.submitJob()
            print "submission finished: " + temp_jobname
Example #12
0
from grisu.frontend.control.login import LoginManager
from grisu.frontend.model.job import JobObject

si = LoginManager.loginCommandline("BeSTGRID-DEV")

print 'Logged in.'

job = JobObject(si)
job.setUniqueJobname("cat_job", si)
job.setCommandline("cat text0.txt")
job.addInputFileUrl('/home/markus/tmp/text0.txt')

job.createJob("/nz/nesi")
#job.setSubmissionLocation('[email protected]:ng2.auckland.ac.nz')
job.submitJob()

print 'Job submitted.'

job.waitForJobToFinish(10)

print 'Job finished. Status: ' + job.getStatusString(False)
print "Stdout: " + job.getStdOutContent()
print "Stderr: " + job.getStdErrContent()

job.kill(True)
Example #13
0
@author: markus
'''

from grisu.frontend.control.login import LoginManager
from grisu.frontend.model.job import JobObject
import sys

HttpProxyManager.useSystemHttpProxy()

si = LoginManager.loginCommandline("bestgrid")

# create the job object
job = JobObject(si)
# set a unique jobname
job.setUniqueJobname("echo_job1")

# set the commandline that needs to be executed
job.setCommandline("echo \"Hello World\"")

# create the job on the backend and specify the VO to use
job.createJob("/nz/nesi")
# submit the job
job.submitJob()

# this waits until the job is finished. Checks every 10 seconds (which would be too often for a real job)
finished = job.waitForJobToFinish(10)

if not finished:
    print "not finished yet."
    # kill the job on the backend anyway
Example #14
0
from grisu.frontend.model.job import JobObject
import sys


si = LoginManager.loginCommandline("Local")
folder = "/home/markus/test/batch/"
original = folder + "original.txt"

jobnames = []

for i in range(10):

    file = folder + "test" + str(i) + ".txt"

    job = JobObject(si)
    job.setUniqueJobname("diff_" + str(i))
    job.setApplication("UnixCommands")
    job.setCommandline("diff original.txt test" + str(i) + ".txt")
    job.createJob("/ARCS/BeSTGRID")
    job.addInputFileUrl(file)
    job.addInputFileUrl(original)
    job.submitJob()

    jobnames.append(job.getJobname())


for jobname in jobnames:

    finished = job.waitForJobToFinish(10)

    print "Job: " + jobname
Example #15
0
from grisu.frontend.model.job import JobObject
import sys


si = LoginManager.loginCommandline("Local")
folder = '/home/markus/test/batch/'
original = folder + 'original.txt'

jobnames = []

for i in range(10):
    
    file = folder+'test'+str(i)+'.txt'
    
    job = JobObject(si);
    job.setUniqueJobname('diff_'+str(i))
    job.setApplication('UnixCommands')
    job.setCommandline('diff original.txt test'+str(i)+'.txt')
    job.createJob("/ARCS/BeSTGRID")
    job.addInputFileUrl(file)
    job.addInputFileUrl(original)
    job.submitJob()
    
    jobnames.append(job.getJobname())


for jobname in jobnames:
    
    finished = job.waitForJobToFinish(10)
    
    print 'Job: '+jobname
Example #16
0
'''
@author: markus
'''

from grisu.frontend.control.login import LoginManager
from grisu.frontend.model.job import JobObject
import sys


si = LoginManager.loginCommandline("Local")
folder = '/home/markus/test/batchWrap/'
original = folder + 'original.txt'
script = folder + 'wrap.sh'

job = JobObject(si);
job.setUniqueJobname('diff_wrap')
job.setApplication('UnixCommands')
job.setCommandline('sh wrap.sh 0 9')
job.addInputFileUrl(original)
job.addInputFileUrl(script)
    
for i in range(10):
    
    file = folder+'test'+str(i)+'.txt'
    job.addInputFileUrl(file)
    
job.createJob("/ARCS/BeSTGRID")
job.submitJob()

finished = job.waitForJobToFinish(10)
    
Example #17
0
Created on 17/11/2009

@author: markus
'''

from grisu.frontend.control.login import LoginManager
from grisu.frontend.model.job import JobObject
import sys

si = LoginManager.loginCommandline()
    
print 'Creating job...'
# create the job object
job = JobObject(si);
# set a unique jobname
job.setUniqueJobname("echo_job1")
print 'Set jobname to: '+ job.getJobname()
# set the name of the application like it is published in mds. "generic" means not to use mds for the lookup.
job.setApplication("generic")
# since we are using a "generic" job, we need to specify a submission location. I'll make that easier later on...
job.setSubmissionLocation("dque@edda-m:ng2.vpac.org")

# set the commandline that needs to be executed
job.setCommandline("echo \"Hello World\"")

job.addInputFileUrl('/home/markus/test/singleJobFile_0.txt');

# create the job on the backend and specify the VO to use
job.createJob("/ARCS/NGAdmin")
print 'Submitting job...'
# submit the job
Example #18
0
from grisu.frontend.control.login import LoginManager
from grisu.frontend.model.job import JobObject

si = LoginManager.loginCommandline("BeSTGRID-DEV")

print "Logged in."

job = JobObject(si)
job.setUniqueJobname("cat_job", si)
job.setCommandline("cat text0.txt")
job.addInputFileUrl("/home/markus/tmp/text0.txt")


job.createJob("/nz/nesi")
# job.setSubmissionLocation('[email protected]:ng2.auckland.ac.nz')
job.submitJob()

print "Job submitted."

job.waitForJobToFinish(10)

print "Job finished. Status: " + job.getStatusString(False)
print "Stdout: " + job.getStdOutContent()
print "Stderr: " + job.getStdErrContent()

job.kill(True)
Example #19
0
'''
@author: markus
'''

from grisu.frontend.control.login import LoginManager
from grisu.frontend.model.job import JobObject
import sys

si = LoginManager.loginCommandline("Local")
folder = '/home/markus/test/batchWrap/'
original = folder + 'original.txt'
script = folder + 'wrap.sh'

job = JobObject(si)
job.setUniqueJobname('diff_wrap')
job.setApplication('UnixCommands')
job.setCommandline('sh wrap.sh 0 9')
job.addInputFileUrl(original)
job.addInputFileUrl(script)

for i in range(10):

    file = folder + 'test' + str(i) + '.txt'
    job.addInputFileUrl(file)

job.createJob("/ARCS/BeSTGRID")
job.submitJob()

finished = job.waitForJobToFinish(10)

print 'Job: ' + job.getJobname()