[padb] Réf. : Re: Réf. : Re: Réf. : Re: Réf. : Re: Réf. : Re: [padb-devel] Patch for Support of PBS Pro resource manager

thipadin.seng-long at bull.net thipadin.seng-long at bull.net
Thu Nov 26 09:27:16 GMT 2009


Hi,
I'm agree with what you said below.
Nproc is just one value not a list, it should be stored as it is.
My coding was just to follow the same method as for 'hosts' which is a 
list.
I have given a try with the new patch on the Pbs system. It's OK.

More later.
Thipadin.





Ashley Pittman <ashley at pittman.co.uk>
11/25/2009 07:51 PM

 
        Pour :  thipadin.seng-long at bull.net
        cc :    florence.vallee at bull.net, francois.wellenreiter at bull.net, 
padb-devel at pittman.org.uk, Sylvain.JEAUGEY at bull.net
        Objet : Re: Réf. : Re: Réf. : Re: Réf. : Re: Réf. : Re: [padb-devel] Patch for 
Support of PBS Pro resource manager

On Wed, 2009-11-25 at 11:15 +0100, thipadin.seng-long at bull.net wrote:
> 
> Thanks you to accept to commit. 

How does the following look to you?  nproc is only ever set once so it
can be stored as a value rather than a array with only one entry which
simplifies the code slightly.  I would just commit it from here but
without access to a pbs system I can't test it.

Re: coding standards take a look at the 'tidy' and 'report' make
targets, I try and ensure my code has as few errors as reported by
perlcritic as possible.  This isn't always easy but is worth doing now
and again.  I also try and avoid implicitly using $_ where-ever possible
as it tends to make the code easier to read.

ashley at alpha:~/code/padb/trunk/src$ svn diff
Index: padb
===================================================================
--- padb                 (revision 338)
+++ padb                 (working copy)
@@ -2662,8 +2662,7 @@
             my @champs = split(/\s+/);    # split by space
             if ( $champs[9] eq 'R' ) {    # take only Running
                 ($job) = split qr{\.}, $champs[0];
-                $nprocess = $champs[6];
-                push( @{ $pbs_tabjobs{$job}{nproc} }, $nprocess );
+                $pbs_tabjobs{$job}{nproc} = $champs[6];
             } else {
                 $job = undef;
             }
@@ -2732,15 +2731,13 @@
     my $job = shift;
     my $d   = pbs_get_data($target_user);
 
-    my @hosts  = @{ $d->{$job}{hosts} };
-    my @nprocs = @{ $d->{$job}{nproc} };
-    my $nprocs = $nprocs[0];
+    my @hosts = @{ $d->{$job}{hosts} };
 
     config_set_internal( 'pbs_server', $d->{$job}{server} );
 
     my %pcmd;
 
-    $pcmd{nprocesses} = $nprocs;
+    $pcmd{nprocesses} = $d->{$job}{nproc};
     $pcmd{nhosts}     = @hosts;
     @{ $pcmd{host_list} } = @hosts;
 


-- 

Ashley Pittman, Bath, UK.

Padb - A parallel job inspection tool for cluster computing
http://padb.pittman.org.uk



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pittman.org.uk/pipermail/padb-devel_pittman.org.uk/attachments/20091126/362759e3/attachment.html>


More information about the padb-devel mailing list