[padb-devel] [padb] r292 committed - Use gdb_string to read the hostname string in setup_mpirun_pcmd.

codesite-noreply at google.com codesite-noreply at google.com
Fri Oct 16 11:53:43 BST 2009


Revision: 292
Author: apittman
Date: Fri Oct 16 03:52:39 2009
Log: Use gdb_string to read the hostname string in setup_mpirun_pcmd.

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

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Fri Oct 16 03:31:48 2009
+++ /trunk/src/padb	Fri Oct 16 03:52:39 2009
@@ -2699,14 +2699,14 @@

      my %pt;
      foreach my $proc ( 0 .. ( $nprocs - 1 ) ) {
-        my $hostd = gdb_read_value(  
$gdb, "MPIR_proctable[$proc].host_name" );
-
-        if ( $hostd =~ m{\"([\w\d\-\.]+)\"\z}x ) {
-            my $host = $1;
-            my $pid = gdb_read_value( $gdb, "MPIR_proctable[$proc].pid" );
+        my $hostp =
+          gdb_read_value( $gdb, "(void *)MPIR_proctable[$proc].host_name"  
);
+        my $host = gdb_string( $gdb, 1024, $hostp );
+        my $pid = gdb_read_value( $gdb, "MPIR_proctable[$proc].pid" );
+        if ( defined $host and defined $pid ) {
              $pt{$host}{$proc} = $pid;
          } else {
-            print "Failed to extract hostname from $hostd\n";
+            print "Failed to extract process info for rank $proc\n";
          }
      }





More information about the padb-devel mailing list