[Swift-commit] cog r3609
swift at ci.uchicago.edu
swift at ci.uchicago.edu
Fri Feb 15 16:25:04 CST 2013
------------------------------------------------------------------------
r3609 | davidkelly999 | 2013-02-15 16:21:59 -0600 (Fri, 15 Feb 2013) | 2 lines
User control of exclusive vs. shared nodes (#933)
------------------------------------------------------------------------
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 3608)
+++ modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/slurm/SlurmExecutor.java (working copy)
@@ -113,6 +113,8 @@
Task task = getTask();
JobSpecification spec = getSpec();
Properties properties = Properties.getProperties();
+ boolean exclusive_defined=false;
+
validate(task);
writeHeader(wr);
@@ -123,7 +125,6 @@
wr.write("#SBATCH --output=" + quote(stdout) + '\n');
wr.write("#SBATCH --error=" + quote(stderr) + '\n');
wr.write("#SBATCH --nodes=" + count + '\n');
- wr.write("#SBATCH --exclusive\n");
wr.write("#SBATCH --ntasks-per-node=1\n");
writeNonEmptyAttr("ppn", "--cpus-per-task", wr);
writeNonEmptyAttr("project", "--account", wr);
@@ -134,10 +135,24 @@
for (String a : spec.getAttributeNames()) {
if (a != null && a.startsWith("slurm.")) {
String attributeName[] = a.split("slurm.");
- wr.write("#SBATCH --" + attributeName[1] + "=" + spec.getAttribute(a) + '\n');
+ if (attributeName[1].equals("exclusive")) {
+ exclusive_defined=true;
+ if(spec.getAttribute(a).equals("true")) {
+ wr.write("#SBATCH --exclusive");
+ } else {
+ wr.write("#SBATCH --share");
+ }
+
+ } else {
+ wr.write("#SBATCH --" + attributeName[1] + "=" + spec.getAttribute(a) + '\n');
+ }
}
}
-
+
+ if(!exclusive_defined) {
+ wr.write("#SBATCH --exclusive\n");
+ }
+
wr.write("\n");
for (String name : spec.getEnvironmentVariableNames()) {
wr.write("export " + name + '=' + quote(spec.getEnvironmentVariable(name)) + '\n');
More information about the Swift-commit
mailing list