airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject [1/2] git commit: Adding WRF descriptor on trestles
Date Wed, 28 May 2014 15:21:17 GMT
Repository: airavata
Updated Branches:
  refs/heads/master d87023a11 -> a6de79bd6


Adding WRF descriptor on trestles


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/7100e38d
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/7100e38d
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/7100e38d

Branch: refs/heads/master
Commit: 7100e38d0010c444411f4fa4455ba5bcf3edf8dd
Parents: 1dd6486
Author: Suresh Marru <smarru@apache.org>
Authored: Wed May 28 11:20:44 2014 -0400
Committer: Suresh Marru <smarru@apache.org>
Committed: Wed May 28 11:20:44 2014 -0400

----------------------------------------------------------------------
 .../airavata/client/tools/DocumentCreator.java  | 99 +++++++++++++++++++-
 1 file changed, 98 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/7100e38d/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java
----------------------------------------------------------------------
diff --git a/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java
b/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java
index 2fe308c..1e50832 100644
--- a/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java
+++ b/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreator.java
@@ -341,7 +341,8 @@ public class DocumentCreator {
         /*
            * Default tmp location
            */
-        String tempDir = "/home/ogce/scratch";
+        String tempDir = "/oasis/scratch/trestles/ogce/temp_project/";
+
      
         app.setScratchWorkingDirectory(tempDir);
         app.setInstalledParentPath("/opt/torque/bin/");
@@ -351,6 +352,102 @@ public class DocumentCreator {
         } 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(serviceName);
+
+        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");
+        ParameterType wrfoutparameterType1 = wrfOutput1.addNewParameterType();
+        wrfoutparameterType1.setType(DataType.URI);
+        wrfoutparameterType1.setName("URI");
+
+        OutputParameterType wrfOutput2 = OutputParameterType.Factory.newInstance();
+        wrfOutput2.setParameterName("WRF_Execution_Log");
+        ParameterType wrfoutparameterType2 = wrfOutput2.addNewParameterType();
+        wrfoutparameterType2.setType(DataType.URI);
+        wrfoutparameterType2.setName("URI");
+
+        wrfinputList.add(wrfinput1);
+        wrfinputList.add(wrfinput2);
+        wrfinputList.add(wrfinput3);
+        wrfoutputList.add(wrfOutput1);
+        wrfoutputList.add(wrfOutput2);
+
+        InputParameterType[] wrfinputParamList = wrfinputList.toArray(new InputParameterType[wrfinputList.size()]);
+        OutputParameterType[] wrfoutputParamList = wrfoutputList.toArray(new OutputParameterType[wrfoutputList.size()]);
+
+        wrfServ.getType().setInputParametersArray(wrfinputParamList);
+        wrfServ.getType().setOutputParametersArray(wrfoutputParamList);
+        try {
+            airavataAPI.getApplicationManager().saveServiceDescription(wrfServ);
+        } catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+        }
+
+        /*
+            Application descriptor creation and saving
+         */
+        ApplicationDescription wrfAppDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
+        HpcApplicationDeploymentType wrfApp = (HpcApplicationDeploymentType) wrfAppDesc.getType();
+        ApplicationDeploymentDescriptionType.ApplicationName wrfName = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
+        wrfName.setStringValue("WRF");
+        wrfApp.setApplicationName(name);
+        ProjectAccountType wrfprojectAccountType = wrfApp.addNewProjectAccount();
+        wrfprojectAccountType.setProjectAccountNumber("sds128");
+
+        QueueType wrfQueueType = wrfApp.addNewQueue();
+        wrfQueueType.setQueueName("normal");
+
+        wrfApp.setCpuCount(1);
+        wrfApp.setJobType(JobTypeType.SERIAL);
+        wrfApp.setNodeCount(1);
+        wrfApp.setProcessorsPerNode(1);
+        wrfApp.setMaxWallTime(10);
+        /*
+           * Use bat file if it is compiled on Windows
+           */
+        wrfApp.setExecutableLocation("/home/ogce/apps/wrf_wrapper.sh");
+
+        /*
+           * Default tmp location
+           */
+        String wrfTempDir = "/oasis/scratch/trestles/ogce/temp_project/";
+
+        wrfApp.setScratchWorkingDirectory(wrfTempDir);
+        wrfApp.setInstalledParentPath("/opt/torque/bin/");
+
+        try {
+            airavataAPI.getApplicationManager().saveApplicationDescription(wrfserviceName,
trestleshpcHostAddress, wrfAppDesc);
+        } catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+        }
     }
 
    


Mime
View raw message