airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [1/2] airavata git commit: Added GSISSJ input order preserving implementation and smaple application registeration for montex and gaussian
Date Mon, 22 Dec 2014 20:13:26 GMT
Repository: airavata
Updated Branches:
  refs/heads/master d6ee95327 -> a9136101c


Added GSISSJ input order preserving implementation and smaple application registeration for
montex and gaussian


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

Branch: refs/heads/master
Commit: e2cc8a4897213a683c5ead237a78e78c2c7ad83f
Parents: 201a05e
Author: shamrath <shameerainfo@gmail.com>
Authored: Mon Dec 22 15:13:08 2014 -0500
Committer: shamrath <shameerainfo@gmail.com>
Committed: Mon Dec 22 15:13:08 2014 -0500

----------------------------------------------------------------------
 .../tools/RegisterSampleApplications.java       | 108 ++++++++++++++++++-
 .../gfac/gsissh/util/GFACGSISSHUtils.java       |  28 ++++-
 2 files changed, 131 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/e2cc8a48/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index 18408b7..75cb78c 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -72,6 +72,8 @@ public class RegisterSampleApplications {
     private static final String wrfName = "WRF";
     private static final String phastaName = "PHASTA";
     private static final String mpiName = "HelloMPI";
+    private static final String monteXName = "TinkerMonte";
+    private static final String gaussianName = "Gaussian";
 
     //Appplication Descriptions
     private static final String echoDescription = "A Simple Echo Application";
@@ -85,6 +87,8 @@ public class RegisterSampleApplications {
     private static final String wrfDescription = "Weather Research and Forecasting";
     private static final String phastaDescription = "Computational fluid dynamics solver";
     private static final String mpiDescription = "A Hello MPI Application";
+    private static final String monteXDescription = "Grid Chem Tinker Monte Application";
+    private static final String gaussianDescription = "Grid Chem Gaussian Application";
 
     //App Module Id's
     private static String echoModuleId;
@@ -98,6 +102,8 @@ public class RegisterSampleApplications {
     private static String wrfModuleId;
     private static String phastaModuleId;
     private static String mpiModuleId;
+    private static String monteXModuleId;
+    private static String gaussianModuleId;
 
     //App Interface Id's
     private static String echoInterfaceId = "";
@@ -295,6 +301,14 @@ public class RegisterSampleApplications {
                             phastaName, "1.0", phastaDescription));
             System.out.println("phasta Module Id " + phastaModuleId);
 
+            monteXModuleId = airavataClient.registerApplicationModule(
+                    RegisterSampleApplicationsUtils.createApplicationModule(
+                            monteXName, "1.0", monteXDescription));
+            System.out.println("Tinker Monte Module Id " + monteXModuleId);
+
+            gaussianModuleId = airavataClient.registerApplicationModule(
+                    RegisterSampleApplicationsUtils.createApplicationModule(
+                            gaussianName, "1.0", gaussianDescription));
         } catch (TException e) {
             e.printStackTrace();
         }
@@ -318,7 +332,7 @@ public class RegisterSampleApplications {
         //Registering FSD Apps
         registerFSDApps();
 
-        
+
     }
 
     public void registerAppInterfaces() {
@@ -358,6 +372,10 @@ public class RegisterSampleApplications {
         //Registering WRF
         registerWRFInterface();
 
+        registerTinkerMonteInterface();
+
+        registerGaussianInterface();
+
     }
 
     public void registerGromaxWorkflowInterfaces() {
@@ -934,6 +952,84 @@ public class RegisterSampleApplications {
         }
     }
 
+    private void registerGaussianInterface() {
+        try {
+            System.out.println("#### Registering Gaussian Application Interface ####");
+
+            List<String> appModules = new ArrayList<String>();
+            appModules.add(gaussianModuleId);
+
+            InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("MainInputFile",
null,
+                    DataType.URI, null, 1, false, "Gaussian main input file", null);
+
+            List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
+            applicationInputs.add(input1);
+
+            OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("gaussian.out",
+                    "", DataType.URI);
+
+            List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
+            applicationOutputs.add(output1);
+
+            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(
+                    RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Gaussian",
"Gaussian application",
+                            appModules, applicationInputs, applicationOutputs));
+            System.out.println("Gaussian Application Interface Id " + addApplicationInterfaceId);
+
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void registerTinkerMonteInterface() {
+        try {
+            System.out.println("#### Registering Tinker Monte Application Interface ####");
+
+            List<String> appModules = new ArrayList<String>();
+            appModules.add(monteXModuleId);
+
+            InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("xyzf",
"O16.xyz",
+                    DataType.STRING, null, 1, false, "Tinker monte input_1", null);
+            InputDataObjectType input2 = RegisterSampleApplicationsUtils.createAppInput("keyf",
"O16.key",
+                    DataType.STRING, "-k", 2, false, "Tinker monte input_2", null);
+            InputDataObjectType input3 = RegisterSampleApplicationsUtils.createAppInput("stps",
"20000",
+                    DataType.STRING, null, 3, false, "Tinker monte input_3", null);
+            InputDataObjectType input4 = RegisterSampleApplicationsUtils.createAppInput("Ctc",
"C",
+                    DataType.STRING, null, 4, false, "Tinker monte input_4", null);
+            InputDataObjectType input5 = RegisterSampleApplicationsUtils.createAppInput("stpsZ",
"3.0",
+                    DataType.STRING, null, 5, false, "Tinker monte input_5", null);
+            InputDataObjectType input6 = RegisterSampleApplicationsUtils.createAppInput("temp",
"298",
+                    DataType.STRING, null, 6, false, "Tinker monte input_6", null);
+            InputDataObjectType input7 = RegisterSampleApplicationsUtils.createAppInput("Rconv",
"0.01",
+                    DataType.STRING, null, 7, false, "Tinker monte input_7", null);
+
+
+            List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
+            applicationInputs.add(input1);
+            applicationInputs.add(input2);
+            applicationInputs.add(input3);
+            applicationInputs.add(input4);
+            applicationInputs.add(input5);
+            applicationInputs.add(input6);
+            applicationInputs.add(input7);
+
+            OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Diskoutputfile_with_dir",
+                    "", DataType.URI);
+
+            List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
+            applicationOutputs.add(output1);
+
+            String addApplicationInterfaceId = airavataClient.registerApplicationInterface(
+                    RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Tinker_Monte",
"Monte application",
+                            appModules, applicationInputs, applicationOutputs));
+            System.out.println("Monte Application Interface Id " + addApplicationInterfaceId);
+
+        } catch (TException e) {
+            e.printStackTrace();
+        }
+    }
+
+
     public void registerStampedeApps() {
         try {
             System.out.println("#### Registering Application Deployments on Stampede ####
\n");
@@ -1029,6 +1125,16 @@ public class RegisterSampleApplications {
                             lammpsDescription));
             System.out.println("LAMMPS on trestles deployment Id " + lammpsAppDeployId);
 
+            String monteXAppDeployId = airavataClient.registerApplicationDeployment(
+                    RegisterSampleApplicationsUtils.createApplicationDeployment(monteXModuleId,
trestlesResourceId,
+                            "path/to/the/monte.x", ApplicationParallelismType.OPENMP, monteXDescription));
+            System.out.println("Tinker Monte on trestles deployment Id " + monteXAppDeployId);
+
+            String gaussianAppDeployId = airavataClient.registerApplicationDeployment(
+                    RegisterSampleApplicationsUtils.createApplicationDeployment(gaussianModuleId,
trestlesResourceId,
+                            "path/to/the/gaussian.sh", ApplicationParallelismType.OPENMP,
gaussianDescription));
+            System.out.println("Gaussian on trestles deployment Id " + gaussianAppDeployId);
+
         } catch (TException e) {
             e.printStackTrace();
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/e2cc8a48/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
index e68effa..6aaafda 100644
--- a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
+++ b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/util/GFACGSISSHUtils.java
@@ -198,10 +198,30 @@ public class GFACGSISSHUtils {
         List<String> inputValues = new ArrayList<String>();
         MessageContext input = jobExecutionContext.getInMessageContext();
         Map<String, Object> inputs = input.getParameters();
-        Set<String> keys = inputs.keySet();
-        for (String paramName : keys) {
-            InputDataObjectType inputDataObjectType = (InputDataObjectType) inputs.get(paramName);
-            inputValues.add(inputDataObjectType.getValue());
+        // sort the inputs first and then build the command List
+        Comparator<InputDataObjectType> inputOrderComparator = new Comparator<InputDataObjectType>()
{
+            @Override
+            public int compare(InputDataObjectType inputDataObjectType, InputDataObjectType
t1) {
+                return inputDataObjectType.getInputOrder() - t1.getInputOrder();
+            }
+        };
+        Set<InputDataObjectType> sortedInputSet = new TreeSet<InputDataObjectType>(inputOrderComparator);
+        for (Object object : input.getParameters().values()) {
+            if (object instanceof InputDataObjectType) {
+                InputDataObjectType inputDOT = (InputDataObjectType) object;
+                sortedInputSet.add(inputDOT);
+            }
+        }
+        for (InputDataObjectType inputDataObjectType : sortedInputSet) {
+            if (inputDataObjectType.getApplicationArgument() != null
+                    && !inputDataObjectType.getApplicationArgument().equals(""))
{
+               inputValues.add(inputDataObjectType.getApplicationArgument());
+            }
+
+            if (inputDataObjectType.getValue() != null
+                    && !inputDataObjectType.getValue().equals("")) {
+                inputValues.add(inputDataObjectType.getValue());
+            }
         }
         jobDescriptor.setInputValues(inputValues);
 


Mime
View raw message