airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject [1/2] git commit: Adding SLURMTEMPLATE to the build- AIRAVATA-1057
Date Fri, 07 Mar 2014 15:20:19 GMT
Repository: airavata
Updated Branches:
  refs/heads/master ccf48b253 -> 4523bd9db


Adding SLURMTEMPLATE to the build- AIRAVATA-1057


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

Branch: refs/heads/master
Commit: 4ecf18e831892bdd3d7c43d8c8c9acba6f25ecca
Parents: c57378b
Author: lahiru <lahiru@apache.org>
Authored: Fri Mar 7 10:19:33 2014 -0500
Committer: lahiru <lahiru@apache.org>
Committed: Fri Mar 7 10:19:33 2014 -0500

----------------------------------------------------------------------
 .../monitor/impl/pull/qstat/QstatMonitor.java   | 16 +++--
 .../src/main/resources/SLURMTemplate.xslt       | 69 --------------------
 .../src/main/resources/conf/SLURMTemplate.xslt  | 69 ++++++++++++++++++++
 3 files changed, 80 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/4ecf18e8/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
----------------------------------------------------------------------
diff --git a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
index fa18db8..3e8475d 100644
--- a/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
+++ b/modules/airavata-job-monitor/src/main/java/org/apache/airavata/job/monitor/impl/pull/qstat/QstatMonitor.java
@@ -36,6 +36,7 @@ import org.slf4j.LoggerFactory;
 import java.sql.Timestamp;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.concurrent.BlockingQueue;
 
@@ -73,7 +74,7 @@ public class QstatMonitor extends PullMonitor implements Runnable {
             try {
                 startPulling();
                 // After finishing one iteration of the full queue this thread sleeps 1 second
-                Thread.sleep(1000);
+                Thread.sleep(5000);
             } catch (Exception e){
                 // we catch all the exceptions here because no matter what happens we do
not stop running this
                 // thread, but ideally we should report proper error messages, but this is
handled in startPulling
@@ -96,8 +97,14 @@ public class QstatMonitor extends PullMonitor implements Runnable {
         JobStatus jobStatus = new JobStatus();
         while (!this.queue.isEmpty()) {
             try {
-                take = this.queue.take();
-                if (take.getHost().getType() instanceof GsisshHostType) {
+                Iterator<MonitorID> iterator = this.queue.iterator();
+                // no need to check iterator.hasNext because its already checked
+                MonitorID next = iterator.next();
+                // we check whether the job is type of gsissh otherwise we return the job
back to the queue
+                // Here we use iterator because it not fair to take the object from the queue
unless its
+                // the correct host type,so if its not the right type it will remain in the
queue
+                if(next.getHost().getType() instanceof GsisshHostType){
+                    take = this.queue.take();
                     long monitorDiff = 0;
                     long startedDiff = 0;
                     if (take.getLastMonitored() != null) {
@@ -136,8 +143,7 @@ public class QstatMonitor extends PullMonitor implements Runnable {
                         }
                     }
                 } else {
-                    //Qstat doesn't handle other jobs eexcept GsisshHostTypes
-                    this.queue.put(take);
+                    logger.debug("Qstat Monitor doesn't handle non-gsissh hosts");
                 }
             } catch (InterruptedException e) {
                 if(!this.queue.contains(take)){

http://git-wip-us.apache.org/repos/asf/airavata/blob/4ecf18e8/modules/distribution/airavata-server/src/main/resources/SLURMTemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/distribution/airavata-server/src/main/resources/SLURMTemplate.xslt b/modules/distribution/airavata-server/src/main/resources/SLURMTemplate.xslt
deleted file mode 100644
index 169dbbf..0000000
--- a/modules/distribution/airavata-server/src/main/resources/SLURMTemplate.xslt
+++ /dev/null
@@ -1,69 +0,0 @@
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements. See the NOTICE file
-	distributed with this work for additional information regarding copyright ownership. The
ASF licenses this file to you under
-	the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance
with the License. You may
-	obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to
-	in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF
-	ANY ~ KIND, either express or implied. See the License for the specific language governing
permissions and limitations under
-	the License. -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://airavata.apache.org/gsi/ssh/2012/12">
-<xsl:output method="text" />
-<xsl:template match="/ns:JobDescriptor">
-<xsl:choose>
-<xsl:when test="ns:shellName">
-#!<xsl:value-of select="ns:shellName"/>
-    </xsl:when>
-    </xsl:choose>
-<xsl:choose>
-    <xsl:when test="ns:queueName">
-#SBATCH -p <xsl:value-of select="ns:queueName"/>
-    </xsl:when>
-    </xsl:choose>
-<xsl:choose>
-    <xsl:when test="ns:nodes">
-#SBATCH -n <xsl:value-of select="ns:nodes"/>
-    </xsl:when>
-    </xsl:choose>
-    <xsl:choose>
-    <xsl:when test="ns:mailAddress">
-#SBATCH -mail-user=<xsl:value-of select="ns:mailAddress"/>
-    </xsl:when>
-    </xsl:choose>
-    <xsl:choose>
-    <xsl:when test="ns:mailType">
-#SBATCH -mail-type=<xsl:value-of select="ns:mailType"/>
-    </xsl:when>
-    </xsl:choose>
-    <xsl:choose>
-<xsl:when test="ns:acountString">
-#SBATCH -A <xsl:value-of select="ns:acountString"/>
-    </xsl:when>
-    </xsl:choose>
-    <xsl:choose>
-    <xsl:when test="ns:maxWallTime">
-#SBATCH -t <xsl:value-of select="ns:maxWallTime"/>
-    </xsl:when>
-    </xsl:choose>
-    <xsl:choose>
-    <xsl:when test="ns:jobName">
-#SBATCH -J <xsl:value-of select="ns:jobName"/>
-    </xsl:when>
-    </xsl:choose>
-    <xsl:choose>
-    <xsl:when test="ns:standardOutFile">
-#SBATCH -o <xsl:value-of select="ns:standardOutFile"/>
-    </xsl:when>
-    </xsl:choose>
-    <xsl:choose>
-    <xsl:when test="ns:standardOutFile">
-#SBATCH -e <xsl:value-of select="ns:standardErrorFile"/>
-    </xsl:when>
-    </xsl:choose>
-cd <xsl:text>   </xsl:text><xsl:value-of select="ns:workingDirectory"/><xsl:text>&#xa;</xsl:text>
-    <xsl:choose><xsl:when test="ns:jobSubmitterCommand">
-<xsl:value-of select="ns:jobSubmitterCommand"/><xsl:text>   </xsl:text></xsl:when></xsl:choose><xsl:value-of
select="ns:executablePath"/><xsl:text>   </xsl:text>
-<xsl:for-each select="ns:inputs/ns:input">
-      <xsl:value-of select="."/><xsl:text>   </xsl:text>
-    </xsl:for-each>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/4ecf18e8/modules/distribution/airavata-server/src/main/resources/conf/SLURMTemplate.xslt
----------------------------------------------------------------------
diff --git a/modules/distribution/airavata-server/src/main/resources/conf/SLURMTemplate.xslt
b/modules/distribution/airavata-server/src/main/resources/conf/SLURMTemplate.xslt
new file mode 100644
index 0000000..169dbbf
--- /dev/null
+++ b/modules/distribution/airavata-server/src/main/resources/conf/SLURMTemplate.xslt
@@ -0,0 +1,69 @@
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements. See the NOTICE file
+	distributed with this work for additional information regarding copyright ownership. The
ASF licenses this file to you under
+	the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance
with the License. You may
+	obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to
+	in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF
+	ANY ~ KIND, either express or implied. See the License for the specific language governing
permissions and limitations under
+	the License. -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://airavata.apache.org/gsi/ssh/2012/12">
+<xsl:output method="text" />
+<xsl:template match="/ns:JobDescriptor">
+<xsl:choose>
+<xsl:when test="ns:shellName">
+#!<xsl:value-of select="ns:shellName"/>
+    </xsl:when>
+    </xsl:choose>
+<xsl:choose>
+    <xsl:when test="ns:queueName">
+#SBATCH -p <xsl:value-of select="ns:queueName"/>
+    </xsl:when>
+    </xsl:choose>
+<xsl:choose>
+    <xsl:when test="ns:nodes">
+#SBATCH -n <xsl:value-of select="ns:nodes"/>
+    </xsl:when>
+    </xsl:choose>
+    <xsl:choose>
+    <xsl:when test="ns:mailAddress">
+#SBATCH -mail-user=<xsl:value-of select="ns:mailAddress"/>
+    </xsl:when>
+    </xsl:choose>
+    <xsl:choose>
+    <xsl:when test="ns:mailType">
+#SBATCH -mail-type=<xsl:value-of select="ns:mailType"/>
+    </xsl:when>
+    </xsl:choose>
+    <xsl:choose>
+<xsl:when test="ns:acountString">
+#SBATCH -A <xsl:value-of select="ns:acountString"/>
+    </xsl:when>
+    </xsl:choose>
+    <xsl:choose>
+    <xsl:when test="ns:maxWallTime">
+#SBATCH -t <xsl:value-of select="ns:maxWallTime"/>
+    </xsl:when>
+    </xsl:choose>
+    <xsl:choose>
+    <xsl:when test="ns:jobName">
+#SBATCH -J <xsl:value-of select="ns:jobName"/>
+    </xsl:when>
+    </xsl:choose>
+    <xsl:choose>
+    <xsl:when test="ns:standardOutFile">
+#SBATCH -o <xsl:value-of select="ns:standardOutFile"/>
+    </xsl:when>
+    </xsl:choose>
+    <xsl:choose>
+    <xsl:when test="ns:standardOutFile">
+#SBATCH -e <xsl:value-of select="ns:standardErrorFile"/>
+    </xsl:when>
+    </xsl:choose>
+cd <xsl:text>   </xsl:text><xsl:value-of select="ns:workingDirectory"/><xsl:text>&#xa;</xsl:text>
+    <xsl:choose><xsl:when test="ns:jobSubmitterCommand">
+<xsl:value-of select="ns:jobSubmitterCommand"/><xsl:text>   </xsl:text></xsl:when></xsl:choose><xsl:value-of
select="ns:executablePath"/><xsl:text>   </xsl:text>
+<xsl:for-each select="ns:inputs/ns:input">
+      <xsl:value-of select="."/><xsl:text>   </xsl:text>
+    </xsl:for-each>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file


Mime
View raw message