Пример #1
0
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")
print 'Submitting job...'
# submit the job
Пример #2
0
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()