use of org.gridlab.gat.Preferences in project compss by bsc-wdc.
the class FileInputStreamAdaptorTest method run.
private void run(String host, String script) {
Preferences preferences = new Preferences();
preferences.put("resourcebroker.adaptor.name", "commandlinessh,sshtrilead,local");
preferences.put("file.adaptor.name", "commandlinessh,sshtrilead,local");
SoftwareDescription sd = new SoftwareDescription();
sd.setExecutable("/bin/bash");
sd.setArguments(script);
try {
sd.addPreStagedFile(GAT.createFile(preferences, "tests" + java.io.File.separator + "src" + java.io.File.separator + "benchmarks" + java.io.File.separator + script));
} catch (GATObjectCreationException e) {
e.printStackTrace();
System.exit(1);
}
ResourceBroker broker = null;
try {
broker = GAT.createResourceBroker(preferences, new URI("any://" + host));
} catch (GATObjectCreationException e) {
e.printStackTrace();
System.exit(1);
} catch (URISyntaxException e) {
e.printStackTrace();
System.exit(1);
}
Job job = null;
try {
job = broker.submitJob(new JobDescription(sd));
} catch (GATInvocationException e) {
e.printStackTrace();
System.exit(1);
}
while (job.getState() != Job.JobState.STOPPED && job.getState() != Job.JobState.SUBMISSION_ERROR) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
// ignored
}
}
}
use of org.gridlab.gat.Preferences in project compss by bsc-wdc.
the class ResourceBrokerAdaptorTest method test.
public AdaptorTestResult test(String adaptor, String host) {
try {
URI temp = new URI(host);
if (temp.getScheme() == null && !host.equals("")) {
host = "any://" + host;
}
} catch (URISyntaxException e) {
// ignored
}
AdaptorTestResult adaptorTestResult = new AdaptorTestResult(adaptor, host);
GATContext gatContext = new GATContext();
// CertificateSecurityContext ctxt = new CertificateSecurityContext(null, null, "username", "passphrase");
// gatContext.addSecurityContext(ctxt);
// Add security contexts to gatContext here.
Preferences preferences = new Preferences();
preferences.put("resourcebroker.adaptor.name", adaptor);
// preferences.put("file.adaptor.name", "commandlinessh,sshtrilead,local");
jobFinished = false;
adaptorTestResult.put("submit job easy ", submitJobEasy(gatContext, preferences, host));
jobFinished = false;
adaptorTestResult.put("submit job parallel", submitJobParallel(gatContext, preferences, host));
jobFinished = false;
adaptorTestResult.put("submit job stdout", submitJobStdout(gatContext, preferences, host));
jobFinished = false;
adaptorTestResult.put("submit job stderr", submitJobStderr(gatContext, preferences, host));
jobFinished = false;
adaptorTestResult.put("submit job prestage", submitJobPreStage(gatContext, preferences, host));
jobFinished = false;
adaptorTestResult.put("submit job poststage", submitJobPostStage(gatContext, preferences, host));
jobFinished = false;
adaptorTestResult.put("submit job environment", submitJobEnvironment(gatContext, preferences, host));
jobFinished = false;
adaptorTestResult.put("job state consistency", submitJobStateConsistency(gatContext, preferences, host));
jobFinished = false;
adaptorTestResult.put("job get info ", submitJobGetInfo(gatContext, preferences, host));
jobFinished = false;
return adaptorTestResult;
}
use of org.gridlab.gat.Preferences in project compss by bsc-wdc.
the class SshLsfResourceBrokerAdaptor method getSupportedPreferences.
public static Preferences getSupportedPreferences() {
Preferences p = ResourceBrokerCpi.getSupportedPreferences();
p.put(SSHLSF_NATIVE_FLAGS, "");
p.put(SSHLSF_SCRIPT, "");
p.put(SSHLSF_SUBMITTER_SCHEME, "ssh");
return p;
}
use of org.gridlab.gat.Preferences in project compss by bsc-wdc.
the class ConnectToAdvertJob method main.
public static void main(String[] args) throws Exception {
GATContext c = new GATContext();
Preferences prefs = new Preferences();
prefs.put("File.adaptor.name", "local");
AdvertService a = GAT.createAdvertService(c, prefs);
a.importDataBase(new URI("file:///mydb"));
c = new GATContext();
prefs = new Preferences();
// prefs.put("Resourcebroker.adaptor.name", "sshsge");
prefs.put("File.adaptor.name", "local, commandlinessh");
c.addPreferences(prefs);
Job other = (Job) a.getAdvertisable(c, "/rob/testJob");
System.err.println("got job back: " + other);
while ((other.getState() != Job.JobState.STOPPED) && (other.getState() != Job.JobState.SUBMISSION_ERROR)) {
System.err.println("job state = " + other.getInfo());
Thread.sleep(1000);
}
System.err.println("job DONE, state = " + other.getInfo());
GAT.end();
}
use of org.gridlab.gat.Preferences in project compss by bsc-wdc.
the class FileAdaptorTest method run.
private void run(String host, String script) {
Preferences preferences = new Preferences();
preferences.put("resourcebroker.adaptor.name", "commandlinessh,sshtrilead,local");
preferences.put("file.adaptor.name", "commandlinessh,sshtrilead,local");
SoftwareDescription sd = new SoftwareDescription();
sd.setExecutable("/bin/bash");
sd.setArguments(script);
try {
sd.addPreStagedFile(GAT.createFile(preferences, "tests" + java.io.File.separator + "src" + java.io.File.separator + "benchmarks" + java.io.File.separator + script));
} catch (GATObjectCreationException e) {
e.printStackTrace();
System.exit(1);
}
ResourceBroker broker = null;
try {
broker = GAT.createResourceBroker(preferences, new URI("any://" + host));
} catch (GATObjectCreationException e) {
e.printStackTrace();
System.exit(1);
} catch (URISyntaxException e) {
e.printStackTrace();
System.exit(1);
}
Job job = null;
try {
job = broker.submitJob(new JobDescription(sd));
} catch (GATInvocationException e) {
e.printStackTrace();
System.exit(1);
}
while (job.getState() != Job.JobState.STOPPED && job.getState() != Job.JobState.SUBMISSION_ERROR) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
// ignored
}
}
}
Aggregations