airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject git commit: More changes to qstat monitor - AIRAVATA-1023
Date Wed, 12 Mar 2014 01:42:18 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 258b5a7dc -> 3a38bdfc3


More changes to qstat monitor - AIRAVATA-1023


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

Branch: refs/heads/master
Commit: 3a38bdfc3df85791deccc951e9b34b36fa04d92c
Parents: 258b5a7
Author: lahiru <lahiru@apache.org>
Authored: Tue Mar 11 21:42:08 2014 -0400
Committer: lahiru <lahiru@apache.org>
Committed: Tue Mar 11 21:42:08 2014 -0400

----------------------------------------------------------------------
 .../gfac/provider/impl/GSISSHProvider.java      |  2 +-
 .../gsi/ssh/api/job/PBSOutputParser.java        | 29 ++++++++++++++++----
 .../gsi/ssh/impl/GSISSHAbstractCluster.java     |  2 +-
 3 files changed, 25 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/3a38bdfc/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
index db5c29a..8610440 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GSISSHProvider.java
@@ -90,7 +90,7 @@ public class GSISSHProvider extends AbstractProvider implements GFacProvider{
             }
             // This installed path is a mandetory field, because this could change based
on the computing resource
             JobDescriptor jobDescriptor = new JobDescriptor();
-            jobDescriptor.setWorkingDirectory(app.getStaticWorkingDirectory());
+            jobDescriptor.setWorkingDirectory(app.getScratchWorkingDirectory());
             jobDescriptor.setShellName("/bin/bash");
             Random random = new Random();
             int i = random.nextInt();

http://git-wip-us.apache.org/repos/asf/airavata/blob/3a38bdfc/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java
b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java
index 7c0a261..335bbf2 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java
@@ -31,6 +31,7 @@ public class PBSOutputParser implements OutputParser {
     private static final Logger log = LoggerFactory.getLogger(PBSOutputParser.class);
 
     public void parse(JobDescriptor jobDescriptor, String rawOutput) {
+        log.info(rawOutput);
         String[] info = rawOutput.split("\n");
         String[] line;
         for (int i = 0; i < info.length; i++) {
@@ -116,18 +117,34 @@ public class PBSOutputParser implements OutputParser {
     }
 
     public String parse(String rawOutput) {
-        return rawOutput;  //In PBS stdoutu is giong to be directly the jobID
+        log.info(rawOutput);
+        return rawOutput;  //In PBS stdout is going to be directly the jobID
     }
 
     public JobStatus parse(String jobID, String rawOutput) {
+        boolean jobFount = false;
+        log.info(rawOutput);
         String[] info = rawOutput.split("\n");
         String[] line = null;
+        int index = 0;
         for (String anInfo : info) {
-            if (anInfo.contains("=")) {
-                line = anInfo.split("=", 2);
-                if (line.length != 0) {
-                    if (line[0].contains("job_state")) {
-                        return JobStatus.valueOf(line[1].replaceAll(" ", ""));
+            index++;
+            if (anInfo.contains("Job Id:")) {
+                if (anInfo.contains(jobID)) {
+                    jobFount = true;
+                    break;
+                }
+            }
+        }
+        if (jobFount) {
+            for (int i=index;i<info.length;i++) {
+                String anInfo = info[i];
+                if (anInfo.contains("=")) {
+                    line = anInfo.split("=", 2);
+                    if (line.length != 0) {
+                        if (line[0].contains("job_state")) {
+                            return JobStatus.valueOf(line[1].replaceAll(" ", ""));
+                        }
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/3a38bdfc/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
index ca9094e..1bd68d9 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
@@ -406,7 +406,7 @@ public class GSISSHAbstractCluster implements Cluster {
         String stdOutputString = jobIDReaderCommandOutput.getStdOutputString();
         String stdErrorString = jobIDReaderCommandOutput.getStdErrorString();
 
-        if ((stdOutputString == null && "".equals(stdOutputString)) &&
+        if ((stdOutputString == null || "".equals(stdOutputString)) &&
                 ((stdErrorString != null) && !("".equals(stdErrorString)))) {
             log.error("Standard Error output : " + stdErrorString);
             throw new SSHApiException(errorMsg + stdErrorString);


Mime
View raw message