コード例 #1
0
ファイル: exampleJobs.py プロジェクト: grisu/grisu-clients
    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
コード例 #2
0
ファイル: exampleJobs.py プロジェクト: grisu/grisu-clients
 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)
コード例 #3
0
ファイル: exampleJobs.py プロジェクト: grisu/grisu-clients
    def prepare(self):
        job = JobObject(self.si);
        job.setUniqueJobname("echo_job1")
        job.setCommandline("echo \"Hello World\"")

        job.createJob()
        self.job = job
コード例 #4
0
ファイル: AddNewJobs.py プロジェクト: grisu/grisu-clients
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)

    job.setWalltimeInSeconds(60)
    # adding the job to the multijob
    batchJob.addJob(job)

# only start the newly added jobs and wait for the restart to finish
batchJob.restart(False, False, True, True)


# don't forget to exit properly. this cleans up possible existing threads/executors
sys.exit()
コード例 #5
0
ファイル: simpleDiffJob.py プロジェクト: grisu/grisu-clients
from org.vpac.grisu.frontend.model.job import JobObject
from org.vpac.grisu.model import FileManager
import sys

si = LoginManager.loginCommandline()

print 'Parsing commandline arguments...'
file1url = sys.argv[1]
file1Name = FileManager.getFilename(file1url)
file2url = sys.argv[2]
file2Name = FileManager.getFilename(file2url);

    
print 'Creating job...'
# create the job object
job = JobObject(si);
# set a unique jobname
job.setTimestampJobname("diff_job")
print 'Set jobname to: '+ job.getJobname()
# setting the application. this means that grisu can figure out the submission location and
# you don't have to do that manually
job.setApplication("UnixCommands")

# set the commandline that needs to be executed
job.setCommandline('diff ' + file1Name+ ' ' + file2Name)

job.addInputFileUrl(file1url);
job.addInputFileUrl(file2url);

# create the job on the backend and specify the VO to use
job.createJob("/ARCS/StartUp")
コード例 #6
0
ファイル: multijob.py プロジェクト: grisu/grisu-clients
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
    #job.setCommandline("java -jar "+pathToInputFiles+"/JavaTestJob.jar 30 1")
    # adding a job-specific input file
    #job.addInputFileUrl("/home/markus/test/singleJobFile.txt")
    # the walltime for the job. Can be set individually or for the multijob (which would have to be done later)
    job.setWalltimeInSeconds(60)
    # adding the job to the multijob
    multiPartJob.addJob(job)
    
multiPartJob.setDefaultNoCpus(1);
コード例 #7
0
from org.vpac.grisu.frontend.control.login import LoginManager
from org.vpac.grisu.frontend.model.job import JobObject

si = LoginManager.loginCommandline("BeSTGRID")

job = JobObject(si);
job.setUniqueJobname("cat_job")
job.setCommandline("cat singleJobFile_0.txt")
job.addInputFileUrl('/home/markus/test/singleJobFile_0.txt');

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

job.waitForJobToFinish(10)

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

job.kill(True)

コード例 #8
0
ファイル: simpleJob.py プロジェクト: grisu/grisu-clients
'''
Created on 17/11/2009

@author: markus
'''

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

si = LoginManager.loginCommandline("ARCS")
    
    
# 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("/ACC")
# 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."
コード例 #9
0
ファイル: mdsTests.py プロジェクト: grisu/grisu-clients
    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        
コード例 #10
0
ファイル: InitialSubmit.py プロジェクト: grisu/grisu-clients
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
    
    # 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')
    if i == 3 or i == 13:
        # this is just to demonstrate how to restart a failed job later on
        job.setCommandline('cat '+inputFile3relPath)
    else:
        job.setCommandline('cat '+ inputFile1relPath + ' ' + inputFile2relPath)

    job.setWalltimeInSeconds(60)
    # adding the job to the multijob
    batchJob.addJob(job)

# this should be set because it's used for the matchmaking/metascheduling
batchJob.setDefaultNoCpus(1);
コード例 #11
0
ファイル: ImageJ.py プロジェクト: grisu/grisu-clients
from org.vpac.grisu.frontend.control.login import LoginManager
from org.vpac.grisu.frontend.model.job import JobObject
from org.vpac.grisu.model import GrisuRegistryManager

si = LoginManager.loginCommandline("LOCAL")

appInfo = GrisuRegistryManager.getDefault(si).getApplicationInformation("ImageJ")

print 'app: '+appInfo.getApplicationName()

for subloc in appInfo.getAvailableAllSubmissionLocations():
    print subloc

job = JobObject(si);
job.setTimestampJobname("imageJ");
job.setApplication("java");
job.setApplication("ImageJ");
job.setCommandline("echo Hello");

job.setSubmissionLocation("normal:ng2.ivec.org");

job.createJob("/ARCS/StartUp");
job.submitJob();

job.waitForJobToFinish(3);

print "Stdout: "+job.getStdOutContent()
print "Stderr: "+job.getStdErrContent()
コード例 #12
0
ファイル: exampleJobs.py プロジェクト: grisu/grisu-clients
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()
コード例 #13
0
ファイル: exampleJobs.py プロジェクト: grisu/grisu-clients
    def prepare(self):
        job = JobObject(self.si);
        job.setUniqueJobname("echo_job1")
        job.setCommandline("echo \"Hello World\"")
        job.addInputFileUrl("/home/markus/tmp/46mbInput0.bin");
        job.addInputFileUrl("/home/markus/tmp/46mbInput1.bin");
        job.addInputFileUrl("/home/markus/tmp/46mbInput2.bin");
        job.addInputFileUrl("/home/markus/tmp/46mbInput3.bin");
        job.addInputFileUrl("/home/markus/tmp/46mbInput4.bin");
        job.setApplication(Constants.GENERIC_APPLICATION_NAME)
        job.setSubmissionLocation(self.subLoc)

        job.createJob()
        self.job = job
コード例 #14
0
ファイル: simpleJob2.py プロジェクト: grisu/grisu-clients
'''
Created on 17/11/2009

@author: markus
'''

from org.vpac.grisu.frontend.control.login import LoginManager
from org.vpac.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...'