Skip to content
Snippets Groups Projects
Commit 2bb9ff62 authored by Mark Grondona's avatar Mark Grondona
Browse files

o Adjust nodelist for completing jobs to include only the nodes that

   are still in completing state.
 o Document above change in manpage along with other formatting cleanup.
parent 869fef6b
No related branches found
No related tags found
No related merge requests found
.TH SQUEUE "1" "February 2004" "squeue 0.3" "Slurm components"
.TH SQUEUE "1" "March 2004" "squeue 0.3" "Slurm components"
.SH "NAME"
squeue \- Used to view information of jobs located in the scheduling queue.
squeue \- view information about jobs located in the SLURM scheduling queue.
.SH "SYNOPSIS"
\fBsqueue\fR [\fIOPTIONS\fR...]
......@@ -37,80 +37,125 @@ subject to any constraints specified.
.TP
\fB\-o <output_format>\fR, \fB\-\-format=<output_format>\fR
Specify the information to be displayed.
The default format for jobs is "%.7i %.9P %.8j %.8u %.2t %.9M %.6D %N".
The default format for jobs is
If the \fB\-\-long\fR option is specified, the default job format is
".7i %.9P %.8j %.8u %.8T %.9M %.9l %.6D %N".
The default format for job steps is "%10i %.9P %.8u %.9M %N".
Format strings used internally by \fBsqueue\fR when running with
various options are
.RS
.TP 15
.I "default"
"%.7i %.9P %.8j %.8u %.2t %.9M %.6D %N"
.TP
.I "-l, --long"
".7i %.9P %.8j %.8u %.8T %.9M %.9l %.6D %N"
.TP
.I "-s, --steps"
"%10i %.9P %.8u %.9M %N"
.RE
.IP
The field specifications available include:
.br
\fB%b\fR Time at which the job began execution
.br
\fB%c\fR Minimum number of CPUs (processors) requested by the job
.br
\fB%C\fR Number of CPUs (processors) allocated to the job or job step
.br
\fB%d\fR Minimum size of temporary disk space (in MB) requested by the job
.br
\fB%D\fR Number of nodes allocated to the job or the minimum number of nodes
.RS
.TP 4
\fB%b\fR
Time at which the job began execution
.TP
\fB%c\fR
Minimum number of CPUs (processors) requested by the job
.TP
\fB%C\fR
Number of CPUs (processors) allocated to the job or job step
.TP
\fB%d\fR
Minimum size of temporary disk space (in MB) requested by the job
.TP
\fB%D\fR
Number of nodes allocated to the job or the minimum number of nodes
required by a pending job. The actual number of nodes allocated to a pending
job may exceed this number of the job specified a node range count or the
cluster contains nodes with varying processor counts.
.br
\fB%e\fR Time at which the job ended or is expected to end (based upon its time
limit)
.br
\fB%f\fR Features required by the job
.br
\fB%g\fR Group name
.br
\fB%G\fR Group ID
.br
\fB%h\fR Can the nodes allocated to the job be shared with other jobs
.br
\fB%i\fR Job or job step id
.br
\fB%j\fR Job name
.br
\fB%l\fR Time limit of the job in days:hours:minutes:seconds.
.TP
\fB%e\fR
Time at which the job ended or is expected to end (based upon its time limit)
.TP
\fB%f\fR
Features required by the job
.TP
\fB%g\fR
Group name
.TP
\fB%G\fR
Group ID
.TP
\fB%h\fR
Can the nodes allocated to the job be shared with other jobs
.TP
\fB%i\fR
Job or job step id
.TP
\fB%j\fR
Job name
.TP
\fB%l\fR
Time limit of the job in days:hours:minutes:seconds.
The value may be "NOT_SET" if not yet established or "UNLIMITED" for no limit.
.br
\fB%m\fR Minimum size of memory (in MB) requested by the job
.br
\fB%M\fR Time used by the job in days:hours:minutes:seconds.
.TP
\fB%m\fR
Minimum size of memory (in MB) requested by the job
.TP
\fB%M\fR
Time used by the job in days:hours:minutes:seconds.
The days and hours are printed only as needed.
.br
\fB%n\fR List of node names explicitly requested by the job
.br
\fB%N\fR List of nodes allocated to the job or job step
.br
\fB%o\fR Minimum number of nodes requested by the job
.br
\fB%O\fR Are contiguous nodes requested by the job
.br
\fB%p\fR Priority of the job (converted to a floating point number
between 0.0 and 1.0
.br
\fB%P\fR Partition of the job or job step
.br
\fB%S\fR Start time of the job or job step
.br
\fB%t\fR Job state, compact form:
.TP
\fB%n\fR
List of node names explicitly requested by the job
.TP
\fB%N\fR
List of nodes allocated to the job or job step. In the case of a
\fIcompleting\fR job, the list of nodes will comprise only those
nodes that have not yet been returned to service.
.TP
\fB%o\fR
Minimum number of nodes requested by the job
.TP
\fB%O\fR
Are contiguous nodes requested by the job
.TP
\fB%p\fR
Priority of the job (converted to a floating point number between 0.0 and 1.0
.TP
\fB%P\fR
Partition of the job or job step
.TP
\fB%S\fR
Start time of the job or job step
.TP
\fB%t\fR
Job state, compact form:
PD (pending), R (running), CG (completing), CD (completed), F (failed),
TO (timeout), and NF (node failure).
.br
\fB%T\fR Job state, extended form:
.TP
\fB%T\fR
Job state, extended form:
PENDING, RUNNING, COMPLETING, COMPLETED, FAILED, TIMEOUT, and NODE_FAIL.
.br
\fB%u\fR User name
.br
\fB%U\fR User ID
.br
\fB%x\fR List of node names explicitly excluded by the job
.br
\fB%.<*>\fR right justification of the field
.br
\fB%<Number><*>\fR size of field
.TP
\fB%u\fR
User name
.TP
\fB%U\fR
User ID
.TP
\fB%x\fR
List of node names explicitly excluded by the job
.TP
\fB%.<*>\fR
right justification of the field
.TP
\fB%<Number><*>\fR
size of field
.RE
.TP
\fB\-v\fR
Display all job information.
......
......@@ -46,26 +46,11 @@ static int _get_node_cnt(job_info_t * job);
int _nodes_in_list(char *node_list);
static int _print_str(char *str, int width, bool right, bool cut_output);
static int _adjust_completing (job_info_t *j, hostlist_t *compptr);
/*****************************************************************************
* Global Print Functions
*****************************************************************************/
int print_jobs(List jobs, List format)
{
if (!params.no_header)
print_job_from_format(NULL, format);
if (list_count(jobs) > 0) {
job_info_t *job = NULL;
ListIterator i = list_iterator_create(jobs);
while ((job = (job_info_t *) list_next(i)) != NULL) {
print_job_from_format(job, format);
}
list_iterator_destroy(i);
}
return SLURM_SUCCESS;
}
int print_steps(List steps, List format)
{
......@@ -86,11 +71,10 @@ int print_steps(List steps, List format)
int print_jobs_array(job_info_t * jobs, int size, List format)
{
int i = 0;
List job_list;
ListIterator job_iterator;
job_info_t *job_ptr;
List l;
hostlist_t comp = NULL;
job_list = list_create(NULL);
l = list_create(NULL);
if (!params.no_header)
print_job_from_format(NULL, format);
......@@ -98,18 +82,22 @@ int print_jobs_array(job_info_t * jobs, int size, List format)
for (; i < size; i++) {
if (_filter_job(&jobs[i]))
continue;
list_append(job_list, (void *) &jobs[i]);
list_append(l, (void *) &jobs[i]);
}
sort_job_list(job_list);
/*
* Adjust nodelists for any completing jobs
*/
sort_jobs_by_start_time (l);
list_for_each (l, (ListForF) _adjust_completing, (void *) &comp);
if (comp) hostlist_destroy (comp);
sort_job_list (l);
/* Print the jobs of interest */
job_iterator = list_iterator_create(job_list);
while ((job_ptr = list_next(job_iterator))) {
print_job_from_format(job_ptr, format);
}
list_iterator_destroy(job_iterator);
list_destroy(job_list);
list_for_each (l, (ListForF) print_job_from_format, (void *) format);
list_destroy (l);
return SLURM_SUCCESS;
}
......@@ -526,6 +514,7 @@ int _print_job_nodes(job_info_t * job, int width, bool right, char* suffix)
_print_str("NODELIST", width, right, false);
else
_print_nodes(job->nodes, width, right, false);
if (suffix)
printf("%s", suffix);
return SLURM_SUCCESS;
......@@ -578,9 +567,10 @@ int _print_job_num_nodes(job_info_t * job, int width, bool right_justify,
int _get_node_cnt(job_info_t * job)
{
int node_cnt = 0, round;
bool completing = job->job_state & JOB_COMPLETING;
uint16_t base_job_state = job->job_state & (~JOB_COMPLETING);
if (base_job_state == JOB_PENDING) {
if (base_job_state == JOB_PENDING || completing) {
node_cnt = _nodes_in_list(job->req_nodes);
node_cnt = MAX(node_cnt, job->num_nodes);
round = job->num_procs + params.max_procs - 1;
......@@ -1050,3 +1040,68 @@ static int _filter_step(job_step_info_t * step)
return 0;
}
static hostlist_t _completing_nodelist (void)
{
hostlist_t hl;
node_info_msg_t *ni;
int i;
if (slurm_load_node (0, &ni) < 0) {
error ("Unable to load node information: %m");
return (NULL);
}
if (!(hl = hostlist_create (NULL)))
return (NULL);
for (i = 0; i < ni->record_count; i++) {
node_info_t *n = ni->node_array + i;
uint16_t state = n->node_state ^ NODE_STATE_NO_RESPOND;
if (state == NODE_STATE_COMPLETING)
hostlist_push_host (hl, n->name);
}
slurm_free_node_info_msg (ni);
return (hl);
}
static int _adjust_completing (job_info_t *j, hostlist_t *compp)
{
hostlist_t hl = NULL;
hostlist_iterator_t i = NULL;
char buf[8192];
char *host = NULL;
if (!(j->job_state & JOB_COMPLETING))
return (0);
if (*compp == NULL)
*compp = _completing_nodelist ();
hl = hostlist_create (j->nodes);
i = hostlist_iterator_create (hl);
j->num_nodes = hostlist_count (hl);
while ((host = hostlist_next (i))) {
/*
* Delete completing nodes as they are encountered
* (a completing node is only assigned to one completing job)
*/
if (hostlist_delete_host (*compp, host) == 0)
hostlist_remove (i);
free (host);
}
hostlist_iterator_destroy (i);
hostlist_ranged_string (hl, 8192, buf);
xfree (j->nodes);
j->nodes = xstrdup (buf);
return (0);
}
......@@ -133,6 +133,13 @@ void sort_job_list(List job_list)
}
}
void sort_jobs_by_start_time (List jobs)
{
reverse_order = true;
list_sort (jobs, _sort_job_by_time_start);
return;
}
void sort_step_list(List step_list)
{
int i;
......
......@@ -91,6 +91,7 @@ extern struct squeue_parameters params;
extern void parse_command_line( int argc, char* argv[] );
extern int parse_format( char* format );
extern void sort_job_list( List job_list );
extern void sort_jobs_by_start_time( List job_list );
extern void sort_step_list( List step_list );
#endif
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