http://qs321.pair.com?node_id=679766


in reply to Re: Finding Usable Nodes in our Cluster
in thread Finding Usable Nodes in our Cluster

Awesome, it works great! I updated it to include some formatting of the output to make everything pretty.
#!/usr/bin/perl #Andrew Levenson #2:13PM EST #Thursday, April 10th, 2008 #Displays nodes on Deli with 0 or 1 used processors use strict; use warnings; print "\n"; my @open=("\n", "One Active Processor:\n\n"); foreach ( `ganglia proc_run` ) { unshift @open, $_ if /\s0\s+$/; push @open, $_ if /\s1\s+$/; } print "Zero Active Processors:\n\n"; print $_ foreach(@open); print "\n";
C(qw/74 97 104 112/);sub C{while(@_){$c**=$C;print (map{chr($C!=$c?shift:pop)}$_),$C+=@_%2!=1?1:0}}