You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sh...@apache.org on 2015/06/26 18:07:08 UTC

airavata git commit: Use jobmanager commands in slurm job configuraiton

Repository: airavata
Updated Branches:
  refs/heads/master 2c9427715 -> 525e9e4b9


Use jobmanager commands in slurm job configuraiton


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

Branch: refs/heads/master
Commit: 525e9e4b92d52a3d149ce4fa2ffb315b7fe4854e
Parents: 2c94277
Author: Shameera Rathanyaka <sh...@gmail.com>
Authored: Fri Jun 26 12:07:01 2015 -0400
Committer: Shameera Rathanyaka <sh...@gmail.com>
Committed: Fri Jun 26 12:07:01 2015 -0400

----------------------------------------------------------------------
 .../gfac/impl/job/SlurmJobConfiguration.java    | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/525e9e4b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/SlurmJobConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/SlurmJobConfiguration.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/SlurmJobConfiguration.java
index 157b77c..0feac74 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/SlurmJobConfiguration.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/job/SlurmJobConfiguration.java
@@ -30,7 +30,7 @@ import java.io.File;
 import java.util.Map;
 
 public class SlurmJobConfiguration implements JobManagerConfiguration {
-	private final Map<JobManagerCommand, String> jobManagerCommands;
+	private final Map<JobManagerCommand, String> jMCommands;
     private String jobDescriptionTemplateName;
     private String scriptExtension;
     private String installedPath;
@@ -47,11 +47,11 @@ public class SlurmJobConfiguration implements JobManagerConfiguration {
         } else {
             this.installedPath = installedPath + "/";
         }
-	    this.jobManagerCommands = jobManagerCommands;
+	    this.jMCommands = jobManagerCommands;
     }
 
     public RawCommandInfo getCancelCommand(String jobID) {
-        return new RawCommandInfo(this.installedPath + "scancel " + jobID);
+        return new RawCommandInfo(this.installedPath + jMCommands.get(JobManagerCommand.DELETION) + " " + jobID);
     }
 
     public String getJobDescriptionTemplateName() {
@@ -63,7 +63,7 @@ public class SlurmJobConfiguration implements JobManagerConfiguration {
     }
 
     public RawCommandInfo getMonitorCommand(String jobID) {
-        return new RawCommandInfo(this.installedPath + "squeue -j " + jobID);
+        return new RawCommandInfo(this.installedPath + jMCommands.get(JobManagerCommand.JOB_MONITORING) + " -j " + jobID);
     }
 
     public String getScriptExtension() {
@@ -71,7 +71,7 @@ public class SlurmJobConfiguration implements JobManagerConfiguration {
     }
 
     public RawCommandInfo getSubmitCommand(String workingDirectory,String pbsFilePath) {
-          return new RawCommandInfo(this.installedPath + "sbatch " +
+          return new RawCommandInfo(this.installedPath + jMCommands.get(JobManagerCommand.SUBMISSION) + " " +
                 workingDirectory + File.separator + FilenameUtils.getName(pbsFilePath));
     }
 
@@ -92,26 +92,26 @@ public class SlurmJobConfiguration implements JobManagerConfiguration {
     }
 
     public RawCommandInfo getUserBasedMonitorCommand(String userName) {
-        return new RawCommandInfo(this.installedPath + "squeue -u " + userName);
+        return new RawCommandInfo(this.installedPath + jMCommands.get(JobManagerCommand.JOB_MONITORING) + " -u " + userName);
     }
 
     @Override
     public RawCommandInfo getJobIdMonitorCommand(String jobName, String userName) {
-        return new RawCommandInfo(this.installedPath + "squeue -n " + jobName + " -u " + userName);
+        return new RawCommandInfo(this.installedPath + jMCommands.get(JobManagerCommand.JOB_MONITORING) + " -n " + jobName + " -u " + userName);
     }
 
     @Override
     public String getBaseCancelCommand() {
-        return "scancel";
+	    return jMCommands.get(JobManagerCommand.DELETION);
     }
 
     @Override
     public String getBaseMonitorCommand() {
-        return "squeue";
+        return jMCommands.get(JobManagerCommand.JOB_MONITORING);
     }
 
     @Override
     public String getBaseSubmitCommand() {
-        return "sbatch";
+        return jMCommands.get(JobManagerCommand.SUBMISSION);
     }
 }