[padb-devel] [padb] r299 committed - Be rigorous when extracting process and rank information from a mpirun...

padb at googlecode.com padb at googlecode.com
Fri Oct 23 20:19:57 BST 2009


Revision: 299
Author: apittman
Date: Fri Oct 23 12:19:26 2009
Log: Be rigorous when extracting process and rank information from a mpirun  
cmd, check
all functions for errors and about with a suitable error message when a  
problem
is found rather than wildly carrying on and failing in an obscure way later  
on.

http://code.google.com/p/padb/source/detail?r=299

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Thu Oct 22 07:08:40 2009
+++ /trunk/src/padb	Fri Oct 23 12:19:26 2009
@@ -2692,10 +2692,19 @@

      my $gdb = gdb_start();
      if ( not gdb_attach( $gdb, $job ) ) {
+        if ( defined $gdb->{error} ) {
+            print "Failed to attach to process: $gdb->{error}\n";
+        } else {
+            print "Failed to attach to process\n";
+        }
          return;
      }

      my $nprocs = gdb_read_value( $gdb, 'MPIR_proctable_size' );
+    if ( not defined $nprocs ) {
+        print "No MPIR_proctable_size symbol found, cannot continue";
+        return;
+    }

      my %pt;
      foreach my $proc ( 0 .. ( $nprocs - 1 ) ) {
@@ -2715,6 +2724,11 @@

      my @hosts = keys(%pt);

+    if ( @hosts == 0 ) {
+        print "No process data found";
+        return;
+    }
+
      my $cmd = $EMPTY_STRING;
      if ( $hosts[0] ne hostname() or @hosts > 1 ) {
          my $hlist = join q{,}, @hosts;




More information about the padb-devel mailing list