airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [1/4] airavata git commit: Updaged GaussianHandler and GSISSHProvider classes to support new API improvments
Date Tue, 23 Dec 2014 21:33:26 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 557aa6889 -> c29d4040b


Updaged GaussianHandler and GSISSHProvider classes to support new API improvments


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

Branch: refs/heads/master
Commit: 9fbb426be64d4577d67b79963385285e61f94470
Parents: cf7290a
Author: shamrath <shameerainfo@gmail.com>
Authored: Mon Dec 22 17:46:56 2014 -0500
Committer: shamrath <shameerainfo@gmail.com>
Committed: Mon Dec 22 17:46:56 2014 -0500

----------------------------------------------------------------------
 .../tools/RegisterSampleApplications.java       | 13 +++++++-----
 .../gaussian/handler/GaussianHandler.java       | 21 ++++++++++++--------
 .../gsissh/provider/impl/GSISSHProvider.java    |  2 +-
 .../gfac/gsissh/util/GFACGSISSHUtils.java       |  4 ++++
 .../gsissh/src/main/resources/PBSTemplate.xslt  |  5 +++++
 5 files changed, 31 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/9fbb426b/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 7a8f51f..3bd9f29 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
@@ -997,6 +997,11 @@ public class RegisterSampleApplications {
                             wrfDescription, null));
             System.out.println("WRF on stampede deployment Id " + wrfAppDeployId);
 
+
+            String monteXAppDeployId = airavataClient.registerApplicationDeployment(
+                    RegisterSampleApplicationsUtils.createApplicationDeployment(monteXModuleId,
stampedeResourceId,
+                            "/home1/00421/ccguser/apps/tinker/tinker/bin/monte.x", ApplicationParallelismType.OPENMP,
monteXDescription, null));
+            System.out.println("Tinker Monte on trestles deployment Id " + monteXAppDeployId);
         } catch (TException e) {
             e.printStackTrace();
         }
@@ -1042,14 +1047,12 @@ public class RegisterSampleApplications {
                             gamessDescription, moduleLoadCmd));
             System.out.println("Gamess on trestles deployment Id " + gamessAppDeployId);
 
-            String monteXAppDeployId = airavataClient.registerApplicationDeployment(
-                    RegisterSampleApplicationsUtils.createApplicationDeployment(monteXModuleId,
trestlesResourceId,
-                            "path/to/the/monte.x", ApplicationParallelismType.OPENMP, monteXDescription,
null));
-            System.out.println("Tinker Monte on trestles deployment Id " + monteXAppDeployId);
 
+            List<String> gaussianMouldes = new ArrayList<String>();
+            gaussianMouldes.add("module load gaussian");
             String gaussianAppDeployId = airavataClient.registerApplicationDeployment(
                     RegisterSampleApplicationsUtils.createApplicationDeployment(gaussianModuleId,
trestlesResourceId,
-                            "path/to/the/gaussian.sh", ApplicationParallelismType.OPENMP,
gaussianDescription, null));
+                            "g09", ApplicationParallelismType.OPENMP, gaussianDescription,
null));
             System.out.println("Gaussian on trestles deployment Id " + gaussianAppDeployId);
 
         } catch (TException e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/9fbb426b/modules/gfac/gfac-application-specific-handlers/src/main/java/org/apache/airavata/application/gaussian/handler/GaussianHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-application-specific-handlers/src/main/java/org/apache/airavata/application/gaussian/handler/GaussianHandler.java
b/modules/gfac/gfac-application-specific-handlers/src/main/java/org/apache/airavata/application/gaussian/handler/GaussianHandler.java
index 248a687..048ade6 100644
--- a/modules/gfac/gfac-application-specific-handlers/src/main/java/org/apache/airavata/application/gaussian/handler/GaussianHandler.java
+++ b/modules/gfac/gfac-application-specific-handlers/src/main/java/org/apache/airavata/application/gaussian/handler/GaussianHandler.java
@@ -26,6 +26,8 @@ import org.apache.airavata.gfac.core.handler.AbstractRecoverableHandler;
 import org.apache.airavata.gfac.core.handler.GFacHandlerException;
 import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
 import org.apache.airavata.model.workspace.experiment.ComputationalResourceScheduling;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.apache.airavata.registry.cpi.RegistryModelType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -75,7 +77,10 @@ public class GaussianHandler extends AbstractRecoverableHandler {
                         if (inputConfig.getKey().equals(PROC_SHARED)) {
                             taskScheduling.setTotalCPUCount(Integer.parseInt(inputConfig.getValue()));
                         } else if (inputConfig.getKey().equals(MEM)) {
-                            taskScheduling.setTotalPhysicalMemory(Integer.parseInt(inputConfig.getValue()));
+                            int userRequestedMem = Integer.parseInt(inputConfig.getValue());
+                            int additionalMem = (int) (userRequestedMem * 0.2);
+                            // TODO check (userRequestedMem + additionalMem)  > maxNode
or Queue allowed Mem
+                            taskScheduling.setTotalPhysicalMemory(userRequestedMem + additionalMem);
                         } else if (inputConfig.getKey().equals(PROC)) {
                             taskScheduling.setTotalCPUCount(Integer.parseInt(inputConfig.getValue()));
                         } else {
@@ -83,18 +88,18 @@ public class GaussianHandler extends AbstractRecoverableHandler {
                         }
                         logger.info("$$$$$$$$ " + inputConfig.getKey() + " --> " + inputConfig.getValue()
+ " $$$$$$$$$$$");
                     }
+                    registry.update(RegistryModelType.TASK_DETAIL, jobExecutionContext.getTaskData(),
jobExecutionContext.getTaskData().getTaskID());
                 } catch (IOException e) {
-                    System.out.println("IO exception occurs $$$$$$$$$$$$$$$$$$$$$$$$$");
-                    e.printStackTrace();
-                    // TODO handle this
+                    throw new GFacHandlerException("Error while reading main input file ",
e);
+                } catch (RegistryException e) {
+                    throw new GFacHandlerException("Error while updating task details", e);
                 }
             } else {
-//                System.out.println("main input file is not exists $$$$$$$$$$$$$$$$$$$$$$$$$$$");
-                // TODO - handle this scenario
+                throw new GFacHandlerException("Main input file doesn't exists " + mainInputFilePath);
             }
+
         } else {
-//            System.out.println("Main input file path is null $$$$$$$$$$$$$$$$$$$$");
-            // TODO - handle this scenario
+            throw new GFacHandlerException("Main input file path shouldn't be null");
         }
 
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/9fbb426b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/provider/impl/GSISSHProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/provider/impl/GSISSHProvider.java
b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/provider/impl/GSISSHProvider.java
index 28b6686..0fa4dd8 100644
--- a/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/provider/impl/GSISSHProvider.java
+++ b/modules/gfac/gfac-gsissh/src/main/java/org/apache/airavata/gfac/gsissh/provider/impl/GSISSHProvider.java
@@ -106,7 +106,7 @@ public class GSISSHProvider extends AbstractRecoverableProvider {
             log.info(jobDescriptor.toXML());
             data.append("jobDesc=").append(jobDescriptor.toXML());
             jobDetails.setJobDescription(jobDescriptor.toXML());
-
+            cluster
             String jobID = cluster.submitBatchJob(jobDescriptor);
             jobExecutionContext.setJobDetails(jobDetails);
             if (jobID == null) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/9fbb426b/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 6aaafda..e471c77 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
@@ -261,6 +261,10 @@ public class GFACGSISSHUtils {
             if (taskScheduling.getWallTimeLimit() > 0) {
                 jobDescriptor.setMaxWallTime(String.valueOf(taskScheduling.getWallTimeLimit()));
             }
+
+            if (taskScheduling.getTotalPhysicalMemory() > 0) {
+                jobDescriptor.setUsedMemory(taskScheduling.getTotalPhysicalMemory() + "");
+            }
         } else {
             logger.error("Task scheduling cannot be null at this point..");
         }

http://git-wip-us.apache.org/repos/asf/airavata/blob/9fbb426b/tools/gsissh/src/main/resources/PBSTemplate.xslt
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/resources/PBSTemplate.xslt b/tools/gsissh/src/main/resources/PBSTemplate.xslt
index e4398e0..73c5eb6 100644
--- a/tools/gsissh/src/main/resources/PBSTemplate.xslt
+++ b/tools/gsissh/src/main/resources/PBSTemplate.xslt
@@ -49,6 +49,11 @@
     </xsl:when>
     </xsl:choose>
     <xsl:choose>
+    <xsl:when test="ns:usedMem">
+#PBS -l mem=<xsl:value-of select="ns:usedMem"/>
+    </xsl:when>
+    </xsl:choose>
+    <xsl:choose>
     <xsl:when test="(ns:nodes) and (ns:processesPerNode)">
 #PBS -l nodes=<xsl:value-of select="ns:nodes"/>:ppn=<xsl:value-of select="ns:processesPerNode"/>
 <xsl:text>&#xa;</xsl:text>


Mime
View raw message