[padb] r384 committed - Allow a value of 'localhost' in the MPIR_proctable interface....

padb at googlecode.com padb at googlecode.com
Sun Jan 10 15:06:41 GMT 2010


Revision: 384
Author: apittman
Date: Sun Jan 10 07:02:48 2010
Log: Allow a value of 'localhost' in the MPIR_proctable interface.
I'd prefer it if this entry used hostnames but it's also
allowed to include resolvable names which may not actually
be hostnames.  This probably means there are cases where
padb doesn't work, this commit adds in a hack for localhost
which is probably the most common of these cases.

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

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Sun Jan 10 06:59:28 2010
+++ /trunk/src/padb	Sun Jan 10 07:02:48 2010
@@ -3108,6 +3108,13 @@
              my $struct_base = $base + ( $table_size * $proc );
              my $hostp = gdb_read_pointer( $gdb, $struct_base +  
$host_offset );
              my $host = gdb_string( $gdb, 1024, $hostp );
+
+	    # Ideally this won't happen but it can and does, for example if
+	    # the user supplies a hostsfile with localhost specified the
+	    # resource manager can leave this value unmodified.
+	    if ( defined $host and $host eq 'localhost' ) {
+                $host = hostname();
+            }

              my $pid = gdb_read_int( $gdb, $struct_base + $pid_offset );
              if ( defined $host and defined $pid ) {




More information about the padb-devel mailing list