[Swift-commit] cog r3545

swift at ci.uchicago.edu swift at ci.uchicago.edu
Wed Jan 9 13:05:05 CST 2013


------------------------------------------------------------------------
r3545 | davidkelly999 | 2013-01-09 13:01:40 -0600 (Wed, 09 Jan 2013) | 4 lines

A few tweaks to get the slurm provider working on Stampede
Stampede uses 'ibrun' instead of srun, so make srun a property can you can override by setting slurm.properties
Remove leading whitespace from squeue output

------------------------------------------------------------------------
Index: modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/slurm/SlurmExecutor.java
===================================================================
--- modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/slurm/SlurmExecutor.java	(revision 3544)
+++ modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/slurm/SlurmExecutor.java	(working copy)
@@ -9,7 +9,7 @@
 import org.apache.log4j.Logger;
 import org.globus.cog.abstraction.impl.common.execution.WallTime;
 import org.globus.cog.abstraction.impl.scheduler.common.AbstractExecutor;
-import org.globus.cog.abstraction.impl.scheduler.common.AbstractProperties;
+import org.globus.cog.abstraction.impl.scheduler.slurm.Properties;
 import org.globus.cog.abstraction.impl.scheduler.common.AbstractQueuePoller;
 import org.globus.cog.abstraction.impl.scheduler.common.Job;
 import org.globus.cog.abstraction.impl.scheduler.common.ProcessListener;
@@ -166,7 +166,7 @@
 			}
 		}
 		
-		wr.write("srun /bin/bash -c \'");
+		wr.write(getProperties().getRunCommand() + " /bin/bash -c \'");
 		if (spec.getDirectory() != null) {
 			wr.write("cd " + quote(spec.getDirectory()) + " && ");
 		}
@@ -199,7 +199,7 @@
 	}
 
 	@Override
-	protected AbstractProperties getProperties() {
+	protected Properties getProperties() {
 		return Properties.getProperties();
 	}
 
Index: modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/slurm/QueuePoller.java
===================================================================
--- modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/slurm/QueuePoller.java	(revision 3544)
+++ modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/slurm/QueuePoller.java	(working copy)
@@ -84,9 +84,9 @@
 		do {
 			line = br.readLine();
 			if(line != null) {
-				String words[] = line.split("\\s+");
-				String jobid = words[0].trim();
-				String state = words[4].trim();
+				String words[] = line.trim().split("\\s+");
+				String jobid = words[0];
+				String state = words[4];
 				if (jobid == null || jobid.equals("") || state == null || state.equals("")) {
 					throw new IOException("Failed to parse squeue line: " + line);
 				}
Index: modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/slurm/Properties.java
===================================================================
--- modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/slurm/Properties.java	(revision 3544)
+++ modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/slurm/Properties.java	(working copy)
@@ -9,6 +9,7 @@
 	
 	public static final String POLL_INTERVAL = "poll.interval";
 	public static final String SBATCH = "sbatch";
+	public static final String SRUN = "srun";
 	public static final String SQUEUE = "squeue";
 	public static final String SCANCEL = "scancel";
 
@@ -27,19 +28,29 @@
 		setSubmitCommand("sbatch");
 		setPollCommand("squeue");
 		setRemoveCommand("scancel");
+		setRunCommand("srun");
 	}
 
+	public void setRunCommand(String val) {
+		setProperty(getRunCommandName(), val);
+	}
 
+	public String getRunCommandName() {
+		return SRUN;
+	}
+
+	public String getRunCommand() {
+		return getProperty(getRunCommandName());
+	}
+	
 	public String getPollCommandName() {
 		return SQUEUE;
 	}
 
-
 	public String getRemoveCommandName() {
 		return SCANCEL;
 	}
 
-
 	public String getSubmitCommandName() {
 		return SBATCH;
 	}



More information about the Swift-commit mailing list