Skip to content

Commit

Permalink
Fix srun -c and --threads-per-core imply --exact
Browse files Browse the repository at this point in the history
In 21.08, srun --cpus-per-task and threads-per-core wer supposed to
imply --exact. This worked when that new behavior was introduced, but
was regressed by commit 5154ed2 before 21.08 was released. That
commit did not handle setting --exact in step_req if -c was also set.

Bug 12909
  • Loading branch information
MarshallGarey authored and gaijin03 committed Dec 13, 2021
1 parent 8b7b1e7 commit 6e13352
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ documents those changes that are of interest to users and administrators.
-- Fix writing to Xauthority files on root_squash NFS exports, which was
preventing X11 forwarding from completing setup.
-- Fix regression in 21.08.0rc1 that broke --gres=none.
-- Fix srun --cpus-per-task and --threads-per-core not implicitly setting
--exact. It was meant to work this way in 21.08.

* Changes in Slurm 21.08.4
==========================
Expand Down
9 changes: 7 additions & 2 deletions src/srun/libsrun/launch.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ static job_step_create_request_msg_t *_create_job_step_create_request(
step_req->flags |= SSF_EXCLUSIVE;
if (opt_local->overcommit)
step_req->flags |= SSF_OVERCOMMIT;
if (!srun_opt->exact)
step_req->flags |= SSF_WHOLE;
if (opt_local->no_kill)
step_req->flags |= SSF_NO_KILL;
if (srun_opt->interactive) {
Expand Down Expand Up @@ -405,6 +403,13 @@ static job_step_create_request_msg_t *_create_job_step_create_request(

step_req->container = xstrdup(opt_local->container);

/*
* This must be handled *after* we potentially set srun_opt->exact
* above.
*/
if (!srun_opt->exact)
step_req->flags |= SSF_WHOLE;

return step_req;
}

Expand Down

0 comments on commit 6e13352

Please sign in to comment.