List<InputParameterType> inputList = new ArrayList<InputParameterType>();
List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
InputParameterType input = InputParameterType.Factory.newInstance();
input.setParameterName("echo_input");
ParameterType parameterType = input.addNewParameterType();
parameterType.setType(DataType.STRING);
parameterType.setName("String");
OutputParameterType output = OutputParameterType.Factory.newInstance();
output.setParameterName("echo_output");
ParameterType parameterType1 = output.addNewParameterType();
parameterType1.setType(DataType.STRING);
parameterType1.setName("String");
inputList.add(input);
outputList.add(output);
InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList.size()]);
OutputParameterType[] outputParamList = outputList.toArray(new OutputParameterType[outputList.size()]);
serv.getType().setInputParametersArray(inputParamList);
serv.getType().setOutputParametersArray(outputParamList);
try {
airavataAPI.getApplicationManager().saveServiceDescription(serv);
} catch (AiravataAPIInvocationException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
/*
Application descriptor creation and saving
*/
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("sds128");
QueueType queueType = app.addNewQueue();
queueType.setQueueName("normal");
app.setCpuCount(1);
app.setJobType(JobTypeType.SERIAL);
app.setNodeCount(1);
app.setProcessorsPerNode(1);
app.setMaxWallTime(10);
/*
* Use bat file if it is compiled on Windows
*/
app.setExecutableLocation("/bin/echo");
/*
* Default tmp location
*/
String tempDir = "/oasis/scratch/trestles/ogce/temp_project/";
app.setScratchWorkingDirectory(tempDir);
app.setInstalledParentPath("/opt/torque/bin/");
try {
airavataAPI.getApplicationManager().saveApplicationDescription(serviceName, trestleshpcHostAddress, appDesc);
} catch (AiravataAPIInvocationException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
/*
* Service Description creation and saving
*/
String wrfserviceName = "WRF";
ServiceDescription wrfServ = new ServiceDescription();
wrfServ.getType().setName(wrfserviceName);
List<InputParameterType> wrfinputList = new ArrayList<InputParameterType>();
List<OutputParameterType> wrfoutputList = new ArrayList<OutputParameterType>();
InputParameterType wrfinput1 = InputParameterType.Factory.newInstance();
wrfinput1.setParameterName("WRF_Namelist");
ParameterType wrfparameterType1 = wrfinput1.addNewParameterType();
wrfparameterType1.setType(DataType.URI);
wrfparameterType1.setName("URI");
InputParameterType wrfinput2 = InputParameterType.Factory.newInstance();
wrfinput2.setParameterName("WRF_Input_File");
ParameterType wrfparameterType2 = wrfinput2.addNewParameterType();
wrfparameterType2.setType(DataType.URI);
wrfparameterType2.setName("URI");
InputParameterType wrfinput3 = InputParameterType.Factory.newInstance();
wrfinput3.setParameterName("WRF_Boundary_File");
ParameterType wrfparameterType3 = wrfinput3.addNewParameterType();
wrfparameterType3.setType(DataType.URI);
wrfparameterType3.setName("URI");
OutputParameterType wrfOutput1 = OutputParameterType.Factory.newInstance();
wrfOutput1.setParameterName("WRF_Output");