airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject git commit: fixing advanced output hadnling
Date Thu, 13 Mar 2014 14:54:02 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 1c4433a98 -> 615820ac1


fixing advanced output hadnling


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

Branch: refs/heads/master
Commit: 615820ac1542de225d43cfa45739968c6a2d2817
Parents: 1c4433a
Author: lahiru <lahiru@apache.org>
Authored: Thu Mar 13 10:53:55 2014 -0400
Committer: lahiru <lahiru@apache.org>
Committed: Thu Mar 13 10:53:55 2014 -0400

----------------------------------------------------------------------
 .../apache/airavata/gfac/context/JobExecutionContext.java   | 9 +++++++++
 .../airavata/gfac/handler/AdvancedSCPOutputHandler.java     | 9 ++++++---
 .../org/apache/airavata/gfac/handler/SCPOutputHandler.java  | 5 ++---
 3 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/615820ac/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/context/JobExecutionContext.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/context/JobExecutionContext.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/context/JobExecutionContext.java
index 784d689..2a196fe 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/context/JobExecutionContext.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/context/JobExecutionContext.java
@@ -79,6 +79,7 @@ public class JobExecutionContext extends AbstractContext{
     
     private String status;
 
+    private List<String> outputFileList;
     /**
      *  Security context is used to handle authentication for input handlers and providers.
      *  There can be multiple security requirement for a single job so this allows you to
add multiple security types
@@ -90,6 +91,7 @@ public class JobExecutionContext extends AbstractContext{
         this.gfacConfiguration = gFacConfiguration;
         notifier = new GFacNotifier();
         setServiceName(serviceName);
+        outputFileList = new ArrayList<String>();
     }
 
     public String getExperimentID() {
@@ -229,4 +231,11 @@ public class JobExecutionContext extends AbstractContext{
     public void setJobDetails(JobDetails jobDetails) {
         this.jobDetails = jobDetails;
     }
+
+    public void addOutputFile(String file) {
+        outputFileList.add(file);
+    }
+    public List<String> getOutputFiles(){
+        return outputFileList;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/615820ac/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/handler/AdvancedSCPOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/handler/AdvancedSCPOutputHandler.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/handler/AdvancedSCPOutputHandler.java
index 65b430e..66d8fb4 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/handler/AdvancedSCPOutputHandler.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/handler/AdvancedSCPOutputHandler.java
@@ -95,9 +95,12 @@ public class AdvancedSCPOutputHandler extends AbstractHandler {
         ServerInfo serverInfo = new ServerInfo(this.userName, this.hostName);
         try {
             Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager("/opt/torque/torque-4.2.3.1/bin/"));
-            List<String> strings = pbsCluster.listDirectory(outputDataDirectory);
-            for(String files:strings){
-                pbsCluster.scpTo(outputDataDirectory,files);
+            outputPath = outputPath + File.separator + jobExecutionContext.getExperimentID()
+ "-" + jobExecutionContext.getTaskData().getTaskID()
+            + File.separator;
+            pbsCluster.scpTo(outputPath, standardError);
+            pbsCluster.scpTo(outputPath,standardOutput);
+            for(String files:jobExecutionContext.getOutputFiles()){
+                pbsCluster.scpTo(outputPath,files);
             }
         } catch (SSHApiException e) {
             log.error("Error transfering files to remote host : " + hostName + " with the
user: " + userName);

http://git-wip-us.apache.org/repos/asf/airavata/blob/615820ac/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/handler/SCPOutputHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/handler/SCPOutputHandler.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/handler/SCPOutputHandler.java
index 91eeb32..78bb960 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/handler/SCPOutputHandler.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/handler/SCPOutputHandler.java
@@ -124,6 +124,7 @@ public class SCPOutputHandler extends AbstractHandler{
                 } else {
 					String valueList = outputList.get(0);
                     cluster.scpFrom(app.getOutputDataDirectory() + File.separator + valueList,
outputDataDir);
+                    jobExecutionContext.addOutputFile(outputDataDir + File.separator + valueList);
 					((URIParameterType) actualParameter.getType()).setValue(valueList);
 					stringMap = new HashMap<String, ActualParameter>();
 					stringMap.put(paramName, actualParameter);
@@ -143,9 +144,7 @@ public class SCPOutputHandler extends AbstractHandler{
 
             app.setStandardError(localStdErrFile.getAbsolutePath());
             app.setStandardOutput(localStdOutFile.getAbsolutePath());
-            if (outputDataDir != null) {
-                app.setOutputDataDirectory(outputDataDir);
-            }
+            app.setOutputDataDirectory(outputDataDir);
         } catch (XmlException e) {
             throw new GFacHandlerException("Cannot read output:" + e.getMessage(), e);
         } catch (ConnectionException e) {


Mime
View raw message