return applicationContext;
}
protected ApplicationDescription getApplicationDesc(JobTypeType jobType) {
ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc.getType();
ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory
.newInstance();
name.setStringValue("EchoLocal");
app.setApplicationName(name);
ProjectAccountType projectAccountType = app.addNewProjectAccount();
projectAccountType.setProjectAccountNumber("TG-AST110064");
QueueType queueType = app.addNewQueue();
queueType.setQueueName("development");
app.setCpuCount(1);
// TODO: also handle parallel jobs
if ((jobType.enumValue() == JobTypeType.SERIAL) || (jobType.enumValue() == JobTypeType.SINGLE)) {
app.setJobType(JobTypeType.SERIAL);
} else if (jobType.enumValue() == JobTypeType.MPI) {
app.setJobType(JobTypeType.MPI);
} else {
app.setJobType(JobTypeType.OPEN_MP);
}
app.setNodeCount(1);
app.setProcessorsPerNode(1);
/*
* Use bat file if it is compiled on Windows
*/
app.setExecutableLocation("/bin/cat");
/*
* Default tmp location
*/
String date = (new Date()).toString();
date = date.replaceAll(" ", "_");
date = date.replaceAll(":", "_");
String remoteTempDir = scratchDir + File.separator + "SimpleEcho" + "_" + date + "_" + UUID.randomUUID();
System.out.println(remoteTempDir);
// no need of these parameters, as unicore manages by itself
app.setScratchWorkingDirectory(remoteTempDir);
app.setStaticWorkingDirectory(remoteTempDir);
app.setInputDataDirectory(remoteTempDir + File.separator + "inputData");
app.setOutputDataDirectory(remoteTempDir + File.separator + "outputData");
app.setStandardOutput(app.getOutputDataDirectory() + "/jsdl_stdout");
app.setStandardError(app.getOutputDataDirectory() + "/jsdl_stderr");
return appDesc;
}