diff --git a/NEWS b/NEWS index a91dcc19410047de4639feed2f0cce819c01fc34..2eb34ebf1f15b978f1d207289821ceddb7d75b6f 100644 --- a/NEWS +++ b/NEWS @@ -103,6 +103,7 @@ documents those changes that are of interest to users and admins. * Changes in SLURM 0.6.11 ========================= -- Fix bug in sinfo partition sorting order. + -- Fix bugs in srun use of #SLURM options in batch script. * Changes in SLURM 0.6.10 ========================= diff --git a/src/srun/opt.c b/src/srun/opt.c index 3aefbfb9d4357343a0b8591ef2c9869ff75aff90..14387e0b888632afb6bcead59269eb60550c84eb 100644 --- a/src/srun/opt.c +++ b/src/srun/opt.c @@ -966,7 +966,7 @@ void set_options(const int argc, char **argv, int first) } break; case (int)'c': - if(!first && opt.cpus_per_task) + if(!first && opt.cpus_set) break; opt.cpus_set = true; opt.cpus_per_task = @@ -1053,7 +1053,7 @@ void set_options(const int argc, char **argv, int first) } break; case (int)'n': - if(!first && opt.nprocs) + if(!first && opt.nprocs_set) break; opt.nprocs_set = true; @@ -1326,6 +1326,9 @@ void set_options(const int argc, char **argv, int first) break; } } + + if (!first && !_opt_verify()) + exit(1); } /* @@ -1725,14 +1728,18 @@ static void _opt_list() info("uid : %ld", (long) opt.uid); info("gid : %ld", (long) opt.gid); info("cwd : %s", opt.cwd); - info("nprocs : %d", opt.nprocs); - info("cpus_per_task : %d", opt.cpus_per_task); + info("nprocs : %d %s", opt.nprocs, + opt.nprocs_set ? "(set)" : "(default)"); + info("cpus_per_task : %d %s", opt.cpus_per_task, + opt.cpus_set ? "(set)" : "(default)"); if (opt.max_nodes) info("nodes : %d-%d", opt.min_nodes, opt.max_nodes); - else - info("nodes : %d", opt.min_nodes); + else { + info("nodes : %d %s", opt.min_nodes, + opt.nodes_set ? "(set)" : "(default)"); + } info("partition : %s", - opt.partition == NULL ? "default" : opt.partition); + opt.partition == NULL ? "default" : opt.partition); info("job name : `%s'", opt.job_name); info("distribution : %s", format_task_dist_states(opt.distribution)); info("cpu_bind : %s",