You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2015/03/19 16:03:11 UTC

[45/62] [abbrv] airavata git commit: fixing more issues with LSF

fixing more issues with LSF


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

Branch: refs/heads/queue-gfac-rabbitmq
Commit: c2bacf2d724cc4c0a58c3956f8b1fd3d54577d29
Parents: 34b06cc
Author: Lahiru Gunathilake <gl...@gmail.com>
Authored: Wed Mar 11 16:20:17 2015 -0400
Committer: Lahiru Gunathilake <gl...@gmail.com>
Committed: Wed Mar 11 16:20:17 2015 -0400

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java  | 83 +++++++++++++++-----
 .../tools/RegisterSampleApplications.java       | 22 +++++-
 .../server/src/main/resources/LSFTemplate.xslt  |  3 +-
 .../gfac/ssh/provider/impl/SSHProvider.java     |  1 +
 .../gsissh/src/main/resources/LSFTemplate.xslt  |  2 +-
 5 files changed, 87 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/c2bacf2d/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 3d58197..b5a5bcc 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -58,13 +58,13 @@ public class CreateLaunchExperiment {
     private static final String DEFAULT_GATEWAY = "php_reference_gateway";
     private static Airavata.Client airavataClient;
 
-    private static String echoAppId = "Echo_8506337e-ab7a-46b6-9b71-4a461b6c5e35";
+    private static String echoAppId = "Echo_61988d1f-7ca9-47ba-9212-a0ac2e973cf1";
     private static String mpiAppId = "HelloMPI_720e159f-198f-4daa-96ca-9f5eafee92c9";
     private static String wrfAppId = "WRF_7ad5da38-c08b-417c-a9ea-da9298839762";
     private static String amberAppId = "Amber_a56d457c-f239-4c0b-ba00-66bda936f7bc";
     private static String gromacsAppId = "GROMACS_05622038-9edd-4cb1-824e-0b7cb993364b";
     private static String espressoAppId = "ESPRESSO_10cc2820-5d0b-4c63-9546-8a8b595593c1";
-    private static String lammpsAppId = "LAMMPS_10893eb5-3840-438c-8446-d26c7ecb001f";
+    private static String lammpsAppId = "LAMMPS_2472685b-8acf-497e-aafe-cc66fe5f4cb6";
     private static String nwchemAppId = "NWChem_2c8fee64-acf9-4a89-b6d3-91eb53c7640c";
     private static String trinityAppId = "Trinity_e894acf5-9bca-46e8-a1bd-7e2d5155191a";
     private static String autodockAppId = "AutoDock_43d9fdd0-c404-49f4-b913-3abf9080a8c9";
@@ -161,7 +161,8 @@ public class CreateLaunchExperiment {
 //                final String expId = createExperimentNWCHEMStampede(airavataClient);
 //                final String expId = createExperimentTRINITYStampede(airavataClient);
 //                final String expId = createExperimentAUTODOCKStampede(airavataClient); // this is not working , we need to register AutoDock app on stampede
-                final String expId = createExperimentForLSF(airavataClient);
+//                final String expId = createExperimentForLSF(airavataClient);
+                final String expId = createExperimentLAMMPSForLSF(airavataClient);
 //            	  final String expId = "Ultrascan_ln_eb029947-391a-4ccf-8ace-9bafebe07cc0";
                 System.out.println("Experiment ID : " + expId);
 //                updateExperiment(airavata, expId);
@@ -741,6 +742,8 @@ public class CreateLaunchExperiment {
         return null;
     }
 
+
+
     public static String createExperimentLAMMPSStampede(Airavata.Client client) throws TException {
         try {
             List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
@@ -1353,23 +1356,7 @@ public class CreateLaunchExperiment {
             for (InputDataObjectType inputDataObjectType : exInputs) {
                 inputDataObjectType.setValue("Hello World");
             }
-            /*List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
-            InputDataObjectType input = new InputDataObjectType();
-            input.setName("Input_to_Echo");
-            input.setType(DataType.STRING);
-            input.setValue("Echoed_Output=Hello World");
-            input.setRequiredToAddedToCommandLine(true);
-            exInputs.add(input);*/
-
             List<OutputDataObjectType> exOut = client.getApplicationOutputs(echoAppId);
-            /*
-            List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
-            OutputDataObjectType output = new OutputDataObjectType();
-            output.setName("output_file");
-            output.setType(DataType.URI);
-            output.setValue("");
-
-            exOut.add(output);*/
 
             Project project = ProjectModelUtil.createProject("default", "lg11w", "test project");
             String projectId = client.createProject(DEFAULT_GATEWAY, project);
@@ -1411,6 +1398,64 @@ public class CreateLaunchExperiment {
         }
         return null;
     }
+    public static String createExperimentLAMMPSForLSF(Airavata.Client client) throws TException {
+        try {
+            List<InputDataObjectType> exInputs = client.getApplicationInputs(lammpsAppId);
+
+            for (InputDataObjectType inputDataObjectType : exInputs) {
+                inputDataObjectType.setName("Friction_Simulation_Input");
+                inputDataObjectType.setValue("/Users/lginnali/Downloads/data/in.friction");
+                inputDataObjectType.setType(DataType.URI);
+            }
+            List<OutputDataObjectType> exOut = client.getApplicationOutputs(echoAppId);
+
+            /*OutputDataObjectType outputDataObjectType = exOut.get(0);
+            outputDataObjectType.setName("LAMMPS_Simulation_Log");
+            outputDataObjectType.setType(DataType.URI);
+            outputDataObjectType.setValue("");
+
+            OutputDataObjectType output1 = exOut.get(1);
+            output1.setName("LAMMPS.oJobID");
+            output1.setType(DataType.URI);
+            output1.setValue("");
+
+            exOut.add(outputDataObjectType);
+            exOut.add(output1);*/
+
+            Experiment simpleExperiment =
+                    ExperimentModelUtil.createSimpleExperiment("default", "lg11w", "LAMMPSExperiment", "Testing", lammpsAppId, exInputs);
+            simpleExperiment.setExperimentOutputs(exOut);
+
+            Map<String, String> computeResources = airavataClient.getAvailableAppInterfaceComputeResources(lammpsAppId);
+            if (computeResources != null && computeResources.size() != 0) {
+                for (String id : computeResources.keySet()) {
+                    String resourceName = computeResources.get(id);
+                    if (resourceName.equals(umassrcHostName)) {
+                        ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling(id, 10, 16, 1, "long", 60, 0, 1000, "airavata");
+                        UserConfigurationData userConfigurationData = new UserConfigurationData();
+                        userConfigurationData.setAiravataAutoSchedule(false);
+                        userConfigurationData.setOverrideManualScheduledParams(false);
+                        userConfigurationData.setComputationalResourceScheduling(scheduling);
+                        simpleExperiment.setUserConfigurationData(userConfigurationData);
+                        return client.createExperiment(DEFAULT_GATEWAY, simpleExperiment);
+                    }
+                }
+            }
+        } catch (AiravataSystemException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataSystemException(e);
+        } catch (InvalidRequestException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new InvalidRequestException(e);
+        } catch (AiravataClientException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new AiravataClientException(e);
+        } catch (TException e) {
+            logger.error("Error occured while creating the experiment...", e.getMessage());
+            throw new TException(e);
+        }
+        return null;
+    }
 
 
     public static String createExperimentForBR2Amber(Airavata.Client client) throws TException {

http://git-wip-us.apache.org/repos/asf/airavata/blob/c2bacf2d/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 55dbcf8..990fce7 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
@@ -101,6 +101,7 @@ public class RegisterSampleApplications {
     private static String espressoModuleId = "ESPRESSO_54dc94da-5e2b-4add-b054-41ad88891fdc";
     private static String gromacsModuleId = "GROMACS_417271fd-7ac1-4f40-b2a5-ed0908a743eb";
     private static String lammpsModuleId;
+    private static String lammpsModuleId1;
     private static String nwChemModuleId = "NWChem_edbc318d-4c41-46a7-b216-32bad71eabdd";
     private static String trinityModuleId = "Trinity_8af45ca0-b628-4614-9087-c7b73f5f2fb6";
     private static String wrfModuleId;
@@ -221,7 +222,7 @@ public class RegisterSampleApplications {
 
             //Register LSF resource
             lsfResourceId = registerComputeHost("ghpcc06.umassrc.org", "LSF Cluster",
-                    ResourceJobManagerType.LSF, "push", "source /etc/bashrc;/lsf/9.1/linux2.6-glibc2.3-x86_64/bin", SecurityProtocol.SSH_KEYS, 22, null);
+                    ResourceJobManagerType.LSF, "push", "source /etc/bashrc;/lsf/9.1/linux2.6-glibc2.3-x86_64/bin", SecurityProtocol.SSH_KEYS, 22, "mpiexec");
             System.out.println("LSF Resource Id is " + lsfResourceId);
 
         } catch (TException e) {
@@ -296,8 +297,15 @@ public class RegisterSampleApplications {
             lammpsModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
                             lammpsName, "20Mar14", lammpsDescription));
+
+            lammpsModuleId1 = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
+                    RegisterSampleApplicationsUtils.createApplicationModule(
+                            lammpsName, "28Jun14-base", lammpsDescription));
+
             System.out.println("LAMMPS Module Id " + lammpsModuleId);
 
+            System.out.println("LAMMPS Module Id for LSF " + lammpsModuleId1);
+
             //Register NWChem
             nwChemModuleId = airavataClient.registerApplicationModule(DEFAULT_GATEWAY,
                     RegisterSampleApplicationsUtils.createApplicationModule(
@@ -715,6 +723,7 @@ public class RegisterSampleApplications {
 
             List<String> appModules = new ArrayList<String>();
             appModules.add(lammpsModuleId);
+            appModules.add(lammpsModuleId1);
 
             InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("Friction_Simulation_Input", null,
                     DataType.URI, "<", 1,true, true, false, "Friction Simulation Input - in.friction", null);
@@ -1116,8 +1125,17 @@ public class RegisterSampleApplications {
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, lsfResourceId,
                             "/home/lg11w/executables/echo.sh", ApplicationParallelismType.SERIAL,
                             echoDescription, null, null, null));
-            System.out.println("Echo on trestles deployment Id " + echoAppDeployId);
 
+            List<String> moduleLoadCmd = new ArrayList<String>();
+            moduleLoadCmd.add("module load LAMMPS/28Jun14-base");
+            //Register Echo
+
+            String lammpsDeployId = airavataClient.registerApplicationDeployment(DEFAULT_GATEWAY,
+                    RegisterSampleApplicationsUtils.createApplicationDeployment(lammpsModuleId, lsfResourceId,
+                            "lmp_ghpcc", ApplicationParallelismType.MPI,
+                            echoDescription, moduleLoadCmd, null, null));
+            System.out.println("Echo on LSF deployment Id " + echoAppDeployId);
+            System.out.println("LAMMPS on LSF deployment Id " + lammpsDeployId);
         } catch (TException e) {
             e.printStackTrace();
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/c2bacf2d/modules/configuration/server/src/main/resources/LSFTemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/LSFTemplate.xslt b/modules/configuration/server/src/main/resources/LSFTemplate.xslt
index 7081260..3ed9285 100644
--- a/modules/configuration/server/src/main/resources/LSFTemplate.xslt
+++ b/modules/configuration/server/src/main/resources/LSFTemplate.xslt
@@ -68,14 +68,13 @@
         </xsl:choose>
 
         <xsl:text>&#xa;</xsl:text>
-
         <xsl:text>&#xa;</xsl:text>
         <xsl:for-each select="ns:moduleLoadCommands/ns:command">
             <xsl:text>&#xa;</xsl:text>
             <xsl:value-of select="."/><xsl:text>   </xsl:text>
         </xsl:for-each>
         <xsl:text>&#xa;</xsl:text>
-
+cd <xsl:text>   </xsl:text><xsl:value-of select="ns:workingDirectory"/><xsl:text>&#xa;</xsl:text>
         <xsl:for-each select="ns:preJobCommands/ns:command">
             <xsl:value-of select="."/><xsl:text>   </xsl:text>
             <xsl:text>&#xa;</xsl:text>

http://git-wip-us.apache.org/repos/asf/airavata/blob/c2bacf2d/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
index b1000c5..4c3abde 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
@@ -154,6 +154,7 @@ public class SSHProvider extends AbstractProvider {
                     }
                     // This installed path is a mandetory field, because this could change based on the computing resource
                     JobDescriptor jobDescriptor = GFACSSHUtils.createJobDescriptor(jobExecutionContext, cluster);
+
                     jobDetails.setJobName(jobDescriptor.getJobName());
                     log.info(jobDescriptor.toXML());
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/c2bacf2d/tools/gsissh/src/main/resources/LSFTemplate.xslt
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/resources/LSFTemplate.xslt b/tools/gsissh/src/main/resources/LSFTemplate.xslt
index 7081260..c548d8e 100644
--- a/tools/gsissh/src/main/resources/LSFTemplate.xslt
+++ b/tools/gsissh/src/main/resources/LSFTemplate.xslt
@@ -75,7 +75,7 @@
             <xsl:value-of select="."/><xsl:text>   </xsl:text>
         </xsl:for-each>
         <xsl:text>&#xa;</xsl:text>
-
+cd <xsl:text>   </xsl:text><xsl:value-of select="ns:workingDirectory"/><xsl:text>&#xa;</xsl:text>
         <xsl:for-each select="ns:preJobCommands/ns:command">
             <xsl:value-of select="."/><xsl:text>   </xsl:text>
             <xsl:text>&#xa;</xsl:text>