use of org.apache.airavata.model.experiment.TaskDetails in project airavata by apache.
the class ResourceProcessor method generateResourceElements.
public static void generateResourceElements(JobDefinitionType value, JobExecutionContext context) throws Exception {
TaskDetails taskData = context.getTaskData();
if (taskData != null && taskData.isSetTaskScheduling()) {
try {
ComputationalResourceScheduling crs = taskData.getTaskScheduling();
if (crs.getTotalPhysicalMemory() > 0) {
RangeValueType rangeType = new RangeValueType();
rangeType.setLowerBound(Double.NaN);
rangeType.setUpperBound(Double.NaN);
rangeType.setExact(crs.getTotalPhysicalMemory());
JSDLUtils.setIndividualPhysicalMemoryRequirements(value, rangeType);
}
if (crs.getNodeCount() > 0) {
RangeValueType rangeType = new RangeValueType();
rangeType.setLowerBound(Double.NaN);
rangeType.setUpperBound(Double.NaN);
rangeType.setExact(crs.getNodeCount());
JSDLUtils.setTotalResourceCountRequirements(value, rangeType);
// set totalcpu count to -1 as we dont need that
crs.setTotalCPUCount(0);
}
if (crs.getWallTimeLimit() > 0) {
RangeValueType cpuTime = new RangeValueType();
cpuTime.setLowerBound(Double.NaN);
cpuTime.setUpperBound(Double.NaN);
long wallTime = crs.getWallTimeLimit() * 60;
cpuTime.setExact(wallTime);
JSDLUtils.setIndividualCPUTimeRequirements(value, cpuTime);
}
if (crs.getTotalCPUCount() > 0) {
RangeValueType rangeType = new RangeValueType();
rangeType.setLowerBound(Double.NaN);
rangeType.setUpperBound(Double.NaN);
rangeType.setExact(crs.getTotalCPUCount());
JSDLUtils.setTotalCPUCountRequirements(value, rangeType);
}
} catch (NullPointerException npe) {
new GFacProviderException("No value set for resource requirements.", npe);
}
}
}
use of org.apache.airavata.model.experiment.TaskDetails in project airavata by apache.
the class DataTransferrer method getDownloadLocation.
private String getDownloadLocation() {
TaskDetails taskData = jobContext.getTaskData();
// In case of third party transfer this will not work.
// if (taskData != null && taskData.getAdvancedOutputDataHandling() != null) {
// String outputDataDirectory = taskData.getAdvancedOutputDataHandling().getOutputDataDir();
// return outputDataDirectory;
// }
String outputDataDir = File.separator + "tmp";
outputDataDir = outputDataDir + File.separator + jobContext.getExperimentID();
(new File(outputDataDir)).mkdirs();
return outputDataDir;
}
Aggregations