[padb] r360 committed - Clean up the way the message queue code is called on the inner process...

padb at googlecode.com padb at googlecode.com
Thu Dec 10 15:22:22 GMT 2009


Revision: 360
Author: apittman
Date: Thu Dec 10 07:21:32 2009
Log: Clean up the way the message queue code is called on the inner  
processes,
remove one function completely, rename other and add comments about what
is called from where.  Handle deadlock detection in the same way that
message queues are handled so that the code can use the same function
to read both of them.

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

Modified:
  /trunk/src/padb

=======================================
--- /trunk/src/padb	Thu Dec 10 05:01:38 2009
+++ /trunk/src/padb	Thu Dec 10 07:21:32 2009
@@ -6537,8 +6537,19 @@
      return;
  }

-sub fetch_mpi_queue {
+# Returns the MPI queues for this process given a gdb handle.
+sub fetch_mpi_queue_gdb {
+    my ( $carg, $vp, $pid, $g ) = @_;
+    my @mq = run_minfo( $carg, $g, $vp );
+    return @mq;
+}
+
+# Called as a backoff from the qsnet_show_tport_queue() function if it gets
+# called but can't show the queues for any reason - most likely because it
+# isn't actually a quadrics system.
+sub show_mpi_queue {
      my ( $carg, $vp, $pid ) = @_;
+
      my $g = gdb_start();
      my $p = gdb_attach( $g, $pid );
      if ( !$p ) {
@@ -6554,20 +6565,6 @@

      gdb_detach($g);
      gdb_quit($g);
-    return @mq;
-}
-
-# As above but take a gdb handle
-sub fetch_mpi_queue_gdb {
-    my ( $carg, $vp, $pid, $g ) = @_;
-    my @mq = run_minfo( $carg, $g, $vp );
-    return @mq;
-}
-
-sub show_mpi_queue {
-    my ( $carg, $vp, $pid ) = @_;
-
-    my @mq = fetch_mpi_queue( $carg, $vp, $pid );

      foreach my $o (@mq) {
          output( $vp, $o );
@@ -6575,6 +6572,7 @@
      return;
  }

+# The mode handler for message queue or deadlock detection mode.
  sub show_mpi_queue_one {
      my ( $carg, $proc ) = @_;

@@ -6591,19 +6589,6 @@
      }
      return;
  }
-
-sub show_mpi_queue_for_deadlock_one {
-    my ( $carg, $proc ) = @_;
-
-    my $vp  = $proc->{vp};
-    my $pid = $proc->{pid};
-    my $gdb = $proc->{gdb_handle};
-
-    return unless $gdb;
-
-    my @mq = fetch_mpi_queue_gdb( $carg, $vp, $pid, $gdb );
-    return \@mq;
-}

  sub mpi_queue_output_handler {
      my ( $carg, $lines, $three ) = @_;
@@ -6831,8 +6816,8 @@
      # XXX This is a bit of a hack to make the deadlock code work with input
      # files, the whole thing is due a tidy-up on the full-duplex branch
      # where this should be solved properly.
-    if ( defined $lines->{target_response} ) {
-        $data = $lines->{target_response};
+    if ( defined $lines->{target_output} ) {
+        $data = $lines->{target_output};
      } else {
          $data = $lines->{lines};
      }
@@ -8074,7 +8059,7 @@
      return;
  }

-sub show_queue {
+sub qsnet_show_tport_queue {
      my ( $carg, $vp, $pid ) = @_;

      # If edb isn't installed (this isn't a Quadrics system) don't even try
@@ -9295,7 +9280,7 @@
          arg_long    => 'message-queue',
          qsnet       => 1,
          arg_short   => 'q',
-        handler     => \&show_queue,
+        handler     => \&qsnet_show_tport_queue,
          help        => 'Show the message queues',
          options_i   => { mpi_dll => undef, }
      };
@@ -9324,7 +9309,7 @@
      };

      $allfns{deadlock} = {
-        handler_one  => \&show_mpi_queue_for_deadlock_one,
+        handler_one  => \&show_mpi_queue_one,
          needs_gdb    => 1,
          arg_long     => 'deadlock',
          arg_short    => 'j',




More information about the padb-devel mailing list