airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata git commit: adding INPUTS_ALL to the groovy map
Date Thu, 17 Aug 2017 21:19:43 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 1a5cf4ebb -> c3262a093


adding INPUTS_ALL to the groovy map


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

Branch: refs/heads/develop
Commit: c3262a09315ef23172e1083a6a3c39a69ebe2a56
Parents: 1a5cf4e
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Thu Aug 17 17:19:39 2017 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Thu Aug 17 17:19:39 2017 -0400

----------------------------------------------------------------------
 .../apache/airavata/gfac/core/GFacUtils.java    | 35 ++++++++++++++------
 .../apache/airavata/gfac/core/GroovyMap.java    |  1 +
 .../org/apache/airavata/gfac/core/Script.java   |  1 +
 3 files changed, 27 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/c3262a09/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
index 6c4cfc8..eb8530b 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
@@ -454,10 +454,14 @@ public class GFacUtils {
         groovyMap.add(Script.JOB_NAME, "A" + String.valueOf(generateJobName()));
         groovyMap.add(Script.WORKING_DIR, processContext.getWorkingDir());
 
-        List<String> inputValues = getProcessInputValues(processModel.getProcessInputs());
-        inputValues.addAll(getProcessOutputValues(processModel.getProcessOutputs()));
+        List<String> inputValues = getProcessInputValues(processModel.getProcessInputs(),
true);
+        inputValues.addAll(getProcessOutputValues(processModel.getProcessOutputs(), true));
         groovyMap.add(Script.INPUTS, inputValues);
 
+        List<String> inputValuesAll = getProcessInputValues(processModel.getProcessInputs(),
false);
+        inputValues.addAll(getProcessOutputValues(processModel.getProcessOutputs(), false));
+        groovyMap.add(Script.INPUTS_ALL, inputValuesAll);
+
         groovyMap.add(Script.USER_NAME, processContext.getJobSubmissionRemoteCluster().getServerInfo().getUserName());
         groovyMap.add(Script.SHELL_NAME, "/bin/bash");
         // get walltime
@@ -612,7 +616,7 @@ public class GFacUtils {
         }
     }
 
-    private static List<String> getProcessOutputValues(List<OutputDataObjectType>
processOutputs) {
+    private static List<String> getProcessOutputValues(List<OutputDataObjectType>
processOutputs, boolean commandLineOnly) {
         List<String> inputValues = new ArrayList<>();
         if (processOutputs != null) {
             for (OutputDataObjectType output : processOutputs) {
@@ -620,19 +624,30 @@ public class GFacUtils {
                         && !output.getApplicationArgument().equals("")) {
                     inputValues.add(output.getApplicationArgument());
                 }
-                if (output.getValue() != null && !output.getValue().equals("") &&
output.isRequiredToAddedToCommandLine()) {
-                    if (output.getType() == DataType.URI) {
-                        String filePath = output.getValue();
-                        filePath = filePath.substring(filePath.lastIndexOf(File.separatorChar)
+ 1, filePath.length());
-                        inputValues.add(filePath);
+                if(commandLineOnly){
+                    if (output.getValue() != null && !output.getValue().equals("")
&& output.isRequiredToAddedToCommandLine()) {
+                        if (output.getType() == DataType.URI) {
+                            String filePath = output.getValue();
+                            filePath = filePath.substring(filePath.lastIndexOf(File.separatorChar)
+ 1, filePath.length());
+                            inputValues.add(filePath);
+                        }
+                    }
+                }else{
+                    if (output.getValue() != null && !output.getValue().equals(""))
{
+                        if (output.getType() == DataType.URI) {
+                            String filePath = output.getValue();
+                            filePath = filePath.substring(filePath.lastIndexOf(File.separatorChar)
+ 1, filePath.length());
+                            inputValues.add(filePath);
+                        }
                     }
                 }
+
             }
         }
         return inputValues;
     }
 
-    private static List<String> getProcessInputValues(List<InputDataObjectType>
processInputs) {
+    private static List<String> getProcessInputValues(List<InputDataObjectType>
processInputs, boolean commandLineOnly) {
         List<String> inputValues = new ArrayList<String>();
         if (processInputs != null) {
 
@@ -648,7 +663,7 @@ public class GFacUtils {
                 sortedInputSet.add(input);
             }
             for (InputDataObjectType inputDataObjectType : sortedInputSet) {
-                if (!inputDataObjectType.isRequiredToAddedToCommandLine()) {
+                if (commandLineOnly && !inputDataObjectType.isRequiredToAddedToCommandLine())
{
                     continue;
                 }
                 if (inputDataObjectType.getApplicationArgument() != null

http://git-wip-us.apache.org/repos/asf/airavata/blob/c3262a09/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GroovyMap.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GroovyMap.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GroovyMap.java
index a376fed..d34122f 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GroovyMap.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GroovyMap.java
@@ -96,6 +96,7 @@ public class GroovyMap extends HashMap<String, Object> {
                 .add(Script.JOB_SUBMITTER_COMMAND, null)
                 .add(Script.EXECUTABLE_PATH, null)
                 .add(Script.INPUTS, null)
+                .add(Script.INPUTS_ALL, null)
                 .add(Script.POST_JOB_COMMANDS, null)
                 .add(Script.USED_MEM, null)
                 .add(Script.PROCESS_PER_NODE, null)

http://git-wip-us.apache.org/repos/asf/airavata/blob/c3262a09/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/Script.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/Script.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/Script.java
index 0937c7e..c7e57de 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/Script.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/Script.java
@@ -60,6 +60,7 @@ public enum Script {
     JOB_SUBMITTER_COMMAND("jobSubmitterCommand"),
     EXECUTABLE_PATH("executablePath"),
     INPUTS("inputs"),
+    INPUTS_ALL("inputsAll"),
     POST_JOB_COMMANDS("postJobCommands"),
     USED_MEM("usedMem"),
     PROCESS_PER_NODE("processPerNode"),


Mime
View raw message