There is no sinfo option today to do what you want, although sinfo is 
relatively 
simple and could be modified to do this with a new option. If you want to do 
that and send a patch we can include it in the distribution.
________________________________________
From: [email protected] [[email protected]] On Behalf 
Of Per Lönnborg [[email protected]]
Sent: Friday, April 01, 2011 5:18 AM
To: [email protected]
Subject: [slurm-dev] sorted output with "sinfo" STATEs ?

Hello,

I have created this simple script to feed rrdtool with graphs about nodes and 
their state:

#!/bin/bash


# Fetch this:
# sinfo -p slurm1 -o "%9P %.5D %6t"
#
# PARTITION NODES STATE
# slurm1*      4    drain*
# slurm1*      2    down*
# slurm1*      2    drain
# slurm1*  115   alloc
# slurm1*      5    idle


sinfo -h -p slurm1 -o "%9P %.5D %6t"|awk '{print $2}'|tr -s '\n' ' ' > 
/tmp/rrdtool_read.txt

One of our  problems is that sinfo splits "drain" and "drain*" into 2 lines, 
and when we don´t have a "drain*" state, that line will disapperar, and my 
columns gets in the wrong order. I´m not sure, but sometimes sinfo even puts 
"down" in 2 separate lines

Is there a way to tell sinfo to put the STATE in the same line count and order? 
(For example, write a line: "slurm1*   0  down*")

Thanks,

/Per Lonnborg


Reply via email to