| Subject: | Re: [GE users] Getting Number of Free Execution Nodes | |
|---|---|---|
| From: | snosov (serg...@gmail.com) | |
| Date: | Apr 3, 2009 10:31:53 am | |
| List: | net.sunsource.gridengine.users | |
I wrote a simple script that I use to show idle (-i) and busy (-b) hosts:
#!/usr/bin/perl -w
use strict; use Getopt::Std; use File::Basename; use XML::Simple;
unless ( $ENV{SGE_CELL} ) { print "SGE environment is not set\n"; exit 1; }
our ( $opt_i, $opt_b ); getopts ( "ib" );
unless ( ( $opt_i && ! $opt_b ) || ( ! $opt_i && $opt_b ) ) { $0 = basename $0; print STDERR "Usage: $0 { -i (idle) | -b (busy) }\n"; exit 2; }
my $xml = `qhost -j -xml`; my $status = XMLin ($xml); foreach my $host ( sort keys %{$status->{host}}) { next if ( $host eq "global"); my $job_counter = 0; foreach my $job ( keys %{$status->{host}->{$host}->{job}} ) { $job_counter++; } if ( $job_counter == 0 && $opt_i ) { print "$host\n"; } if ( $job_counter > 0 && $opt_b ) { print "$host\n"; }
}
On Fri, Apr 3, 2009 at 12:12 AM, arc_g <arch...@persistent.co.in>wrote:
I want to find out the number of execution nodes which are free at a given time.
Command 'qconf -sel' will show all the execution hosts, but how will I check if they are free?
Is there any command for that?
------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=154632
To unsubscribe from this discussion, e-mail: [ user...@gridengine.sunsource.net].
------------------------------------------------------ http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=155218
To unsubscribe from this discussion, e-mail:
[user...@gridengine.sunsource.net].





