use of org.gridlab.gat.resources.Job in project compss by bsc-wdc.
the class SubmitLocalJob method main.
public static void main(String[] args) throws Exception {
SoftwareDescription sd = new SoftwareDescription();
sd.setExecutable("/bin/hostname");
File stdout = GAT.createFile("hostname.txt");
sd.setStdout(stdout);
JobDescription jd = new JobDescription(sd);
ResourceBroker broker = GAT.createResourceBroker(new URI("any://localhost"));
Job job = broker.submitJob(jd);
while ((job.getState() != JobState.STOPPED) && (job.getState() != JobState.SUBMISSION_ERROR)) Thread.sleep(1000);
GAT.end();
}
use of org.gridlab.gat.resources.Job in project compss by bsc-wdc.
the class SubmitRemoteJob method main.
public static void main(String[] args) throws Exception {
SoftwareDescription sd = new SoftwareDescription();
sd.setExecutable("/bin/hostname");
File stdout = GAT.createFile("hostname.txt");
sd.setStdout(stdout);
JobDescription jd = new JobDescription(sd);
Preferences prefs = new Preferences();
/*
prefs.put("VirtualOrganisation", "pvier");
prefs.put("vomsServerURL", "voms.grid.sara.nl");
prefs.put("vomsServerPort", "30000");
prefs.put("vomsHostDN", "/O=dutchgrid/O=hosts/OU=sara.nl/CN=voms.grid.sara.nl");
*/
CertificateSecurityContext ctxt = new CertificateSecurityContext(new URI(System.getProperty("user.home") + "/.globus/userkey.pem"), new URI(System.getProperty("user.home") + "/.globus/usercert.pem"), getPassphrase());
GATContext context = new GATContext();
context.addPreferences(prefs);
context.addSecurityContext(ctxt);
ResourceBroker broker = GAT.createResourceBroker(context, new URI(args[0]));
Job job = broker.submitJob(jd);
while ((job.getState() != JobState.STOPPED) && (job.getState() != JobState.SUBMISSION_ERROR)) {
System.out.println("State: " + job.getState());
Thread.sleep(1000);
}
}
Aggregations