Skip to content
Snippets Groups Projects
Commit c8aaed1e authored by Morris Jette's avatar Morris Jette
Browse files

Allocate step part of job's allocation

If a job allocates whole nodes (with --core-spec or --exclusive
option) and launches a step within that allocation all in a single
command (the srun creates the allocation and step at the same time)
and requests a specific CPU count (e.g. "-ntasks=# --cpus-per-task=#")
then allocate the job step only the requested CPU count, which may
be less than the job's allocation.
Bug 843
parent 5d9dd85b
No related branches found
No related tags found
No related merge requests found
......@@ -578,13 +578,20 @@ extern void create_srun_job(srun_job_t **p_job, bool *got_alloc,
}
job = job_create_allocation(resp);
opt.exclusive = false; /* not applicable for this step */
opt.time_limit = NO_VAL;/* not applicable for step, only job */
xfree(opt.constraints); /* not applicable for this step */
if (!opt.job_name_set_cmd && opt.job_name_set_env) {
/* use SLURM_JOB_NAME env var */
opt.job_name_set_cmd = true;
}
if ((opt.core_spec_set || opt.exclusive) && opt.cpus_set) {
/* Step gets specified CPU count, which may only part
* of the job allocation. */
opt.exclusive = true;
} else {
/* Step gets all CPUs in the job allocation. */
opt.exclusive = false;
}
/*
* Become --uid user
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment