Skip to content
Snippets Groups Projects
Commit 61cea93e authored by Moe Jette's avatar Moe Jette
Browse files

Add squeue formatted print option %Q to print a job's integer priority.

parent 8115913c
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ documents those changes that are of interest to users and admins. ...@@ -18,6 +18,7 @@ documents those changes that are of interest to users and admins.
-- Copied job stat logic out of sacct into sstat in the future sacct -stat -- Copied job stat logic out of sacct into sstat in the future sacct -stat
will be deprecated. will be deprecated.
-- Correct sbatch processing of --nice option with negative values. -- Correct sbatch processing of --nice option with negative values.
-- Add squeue formatted print option %Q to print a job's integer priority.
* Changes in SLURM 1.3.2 * Changes in SLURM 1.3.2
======================== ========================
......
.TH SQUEUE "1" "December 2006" "squeue 1.2" "Slurm components" .TH SQUEUE "1" "May 2008" "squeue 1.3" "Slurm components"
.SH "NAME" .SH "NAME"
squeue \- view information about jobs located in the SLURM scheduling queue. squeue \- view information about jobs located in the SLURM scheduling queue.
...@@ -189,7 +189,8 @@ Minimum number of nodes requested by the job. ...@@ -189,7 +189,8 @@ Minimum number of nodes requested by the job.
Are contiguous nodes requested by the job Are contiguous nodes requested by the job
.TP .TP
\fB%p\fR \fB%p\fR
Priority of the job (converted to a floating point number between 0.0 and 1.0 Priority of the job (converted to a floating point number between 0.0 and 1.0).
Also see \fB%Q\fR.
.TP .TP
\fB%P\fR \fB%P\fR
Partition of the job or job step Partition of the job or job step
...@@ -197,6 +198,10 @@ Partition of the job or job step ...@@ -197,6 +198,10 @@ Partition of the job or job step
\fB%q\fR \fB%q\fR
Comment associated with the job Comment associated with the job
.TP .TP
\fB%Q\fR
Priority of the job (generally a very large unsigned integer).
Also see \fB%p\fR.
.TP
\fB%r\fR \fB%r\fR
The reason a job is in its current state. The reason a job is in its current state.
See the \fBJOB REASON CODES\fR section below for more information. See the \fBJOB REASON CODES\fR section below for more information.
......
...@@ -558,6 +558,11 @@ extern int parse_format( char* format ) ...@@ -558,6 +558,11 @@ extern int parse_format( char* format )
field_size, field_size,
right_justify, right_justify,
suffix ); suffix );
else if (field[0] == 'Q')
job_format_add_priority_long( params.format_list,
field_size,
right_justify,
suffix );
else if (field[0] == 'r') else if (field[0] == 'r')
job_format_add_reason( params.format_list, job_format_add_reason( params.format_list,
field_size, field_size,
......
/*****************************************************************************\ /*****************************************************************************\
* print.c - squeue print job functions * print.c - squeue print job functions
* $Id$
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 The Regents of the University of California. * Copyright (C) 2002-2007 The Regents of the University of California.
* Copyright (C) 2008 Lawrence Livermore National Security.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Joey Ekstrom <ekstrom1@llnl.gov>, * Written by Joey Ekstrom <ekstrom1@llnl.gov>,
* Morris Jette <jette1@llnl.gov>, et. al. * Morris Jette <jette1@llnl.gov>, et. al.
...@@ -525,6 +525,20 @@ int _print_job_priority(job_info_t * job, int width, bool right, char* suffix) ...@@ -525,6 +525,20 @@ int _print_job_priority(job_info_t * job, int width, bool right, char* suffix)
return SLURM_SUCCESS; return SLURM_SUCCESS;
} }
int _print_job_priority_long(job_info_t * job, int width, bool right, char* suffix)
{
char temp[FORMAT_STRING_SIZE];
if (job == NULL) /* Print the Header instead */
_print_str("PRIORITY", width, right, true);
else {
sprintf(temp, "%u", job->priority);
_print_str(temp, width, right, true);
}
if (suffix)
printf("%s", suffix);
return SLURM_SUCCESS;
}
int _print_job_nodes(job_info_t * job, int width, bool right, char* suffix) int _print_job_nodes(job_info_t * job, int width, bool right, char* suffix)
{ {
if (job == NULL) { /* Print the Header instead */ if (job == NULL) { /* Print the Header instead */
......
...@@ -115,6 +115,8 @@ int job_format_add_function(List list, int width, bool right_justify, ...@@ -115,6 +115,8 @@ int job_format_add_function(List list, int width, bool right_justify,
job_format_add_function(list,wid,right,suffix,_print_job_time_end) job_format_add_function(list,wid,right,suffix,_print_job_time_end)
#define job_format_add_priority(list,wid,right,suffix) \ #define job_format_add_priority(list,wid,right,suffix) \
job_format_add_function(list,wid,right,suffix,_print_job_priority) job_format_add_function(list,wid,right,suffix,_print_job_priority)
#define job_format_add_priority_long(list,wid,right,suffix) \
job_format_add_function(list,wid,right,suffix,_print_job_priority_long)
#define job_format_add_nodes(list,wid,right,suffix) \ #define job_format_add_nodes(list,wid,right,suffix) \
job_format_add_function(list,wid,right,suffix,_print_job_nodes) job_format_add_function(list,wid,right,suffix,_print_job_nodes)
#define job_format_add_node_inx(list,wid,right,suffix) \ #define job_format_add_node_inx(list,wid,right,suffix) \
...@@ -203,6 +205,8 @@ int _print_job_time_end(job_info_t * job, int width, bool right_justify, ...@@ -203,6 +205,8 @@ int _print_job_time_end(job_info_t * job, int width, bool right_justify,
char* suffix); char* suffix);
int _print_job_priority(job_info_t * job, int width, bool right_justify, int _print_job_priority(job_info_t * job, int width, bool right_justify,
char* suffix); char* suffix);
int _print_job_priority_long(job_info_t * job, int width, bool right_justify,
char* suffix);
int _print_job_nodes(job_info_t * job, int width, bool right_justify, int _print_job_nodes(job_info_t * job, int width, bool right_justify,
char* suffix); char* suffix);
int _print_job_node_inx(job_info_t * job, int width, bool right_justify, int _print_job_node_inx(job_info_t * job, int width, bool right_justify,
......
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