diff --git a/NEWS b/NEWS index 07705f8741f9acb29208b14ec0c6d057adb273ad..70b03228f71323b30192ce880afff8009132d5ff 100644 --- a/NEWS +++ b/NEWS @@ -78,6 +78,8 @@ documents those changes that are of interest to users and admins. ========================= -- Print warning if non-privileged user requests negative "--nice" value on job submission (srun, salloc, and sbatch commands). + -- In sched/wiki and sched/wiki2,, add support for srun's + --ntasks-per-node option. * Changes in SLURM 1.2.18 ========================= diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1 index 02df4c6aef5e552d4bb2c44c38bd2a6fee76fa3a..02461ac652366c4f5cf20a394e7370482bebca38 100644 --- a/doc/man/man1/srun.1 +++ b/doc/man/man1/srun.1 @@ -995,9 +995,10 @@ stdout and/or stderr are redirected from only the task with relative id equal to \fItaskid\fR, where 0 <= \fItaskid\fR <= \fIntasks\fR, where \fIntasks\fR is the total number of tasks in the current job step. stdin is redirected from the stdin of \fBsrun\fR to this same task. +This file will be written on the node executing the task. .TP \fIfilename\fR -fBsrun\fR will redirect stdout and/or stderr to the named file from +\fBsrun\fR will redirect stdout and/or stderr to the named file from all tasks. stdin will be redirected from the named file and broadcast to all tasks in the job. \fIfilename\fR refers to a path on the host @@ -1012,7 +1013,9 @@ described above. The following list of format specifiers may be used in the format string to generate a filename that will be unique to a given jobid, stepid, node, or task. In each case, the appropriate number of files are opened and associated with -the corresponding tasks. +the corresponding tasks. Note that any format string containing +%t, %n, and/or %N will be written on the node executing the task +rather than the node where \fBsrun\fR executes. .RS 10 .TP %J diff --git a/src/plugins/sched/wiki/get_jobs.c b/src/plugins/sched/wiki/get_jobs.c index 8592fcf34c8bc7f395709b7682db0f9e1269516e..df478987d4c531109eea445934cad7ab26d293e0 100644 --- a/src/plugins/sched/wiki/get_jobs.c +++ b/src/plugins/sched/wiki/get_jobs.c @@ -326,9 +326,18 @@ static uint32_t _get_job_submit_time(struct job_record *job_ptr) static uint32_t _get_job_tasks(struct job_record *job_ptr) { + uint32_t task_cnt = 1; + if (job_ptr->num_procs) - return job_ptr->num_procs; - return (uint32_t) 1; + task_cnt = job_ptr->num_procs; + + if (job_ptr->details) { + task_cnt = MAX(task_cnt, + (_get_job_min_nodes(job_ptr) * + job_ptr->details->ntasks_per_node)); + } + + return task_cnt; } static uint32_t _get_job_time_limit(struct job_record *job_ptr) diff --git a/src/plugins/sched/wiki2/get_jobs.c b/src/plugins/sched/wiki2/get_jobs.c index 4fa6b5d3bdfd616da019a573e49bb24c5278c20a..690d9ac899b635786af9ed3eb0c859a8f197e9fe 100644 --- a/src/plugins/sched/wiki2/get_jobs.c +++ b/src/plugins/sched/wiki2/get_jobs.c @@ -454,9 +454,18 @@ static uint32_t _get_job_submit_time(struct job_record *job_ptr) static uint32_t _get_job_tasks(struct job_record *job_ptr) { + uint32_t task_cnt = 1; + if (job_ptr->num_procs) - return job_ptr->num_procs; - return (uint32_t) 1; + task_cnt = job_ptr->num_procs; + + if (job_ptr->details) { + task_cnt = MAX(task_cnt, + (_get_job_min_nodes(job_ptr) * + job_ptr->details->ntasks_per_node)); + } + + return task_cnt; } static uint32_t _get_job_time_limit(struct job_record *job_ptr)