[padb-devel] [padb commit] r91 - Send the rank list (if supplied) over with individual requests rather than

codesite-noreply at google.com codesite-noreply at google.com
Thu Jul 2 13:45:55 BST 2009


Author: apittman
Date: Thu Jul  2 04:54:46 2009
New Revision: 91

Modified:
    branches/full-duplex/src/padb

Log:
Send the rank list (if supplied) over with individual requests rather than
as part of the signon function.  This is where it belongs really going  
forward
and is needed for the initial signon tests to work properly.


Modified: branches/full-duplex/src/padb
==============================================================================
--- branches/full-duplex/src/padb	(original)
+++ branches/full-duplex/src/padb	Thu Jul  2 04:54:46 2009
@@ -3195,10 +3195,6 @@
      $req->{jobconfig}{jobid} = $comm_data->{jobid};
      $req->{jobconfig}{rmgr}  = $conf{rmgr};

-    if ( $#ranks != -1 ) {
-        @{ $req->{ranks} } = @ranks;
-    }
-
      if ( $conf{rmgr} eq "orte" ) {
          $req->{jobconfig}{"orte-data"} = $open_jobs{ $comm_data->{jobid} };
      }
@@ -3247,6 +3243,12 @@
          $req->{cargs} = $cmd->{args};
      }

+    # XXX: Should only send this list over if it makes sense, for example
+    # the deadlock code only works when targetting all ranks.
+    if ( $#ranks != -1 ) {
+        @{ $req->{ranks} } = @ranks;
+    }
+
      if ( defined $cmd->{out_format} ) {
          $req->{out_format} = $cmd->{out_format};
      }
@@ -3301,7 +3303,7 @@
          $target_state{ $data->{target_responce}{$proc}{state} }++;
      }
      if ( $#missing != -1 ) {
-        printf( "Warning, failed to locates ranks %s\n",  
compress(@missing) );
+        printf( "Warning, failed to locate ranks %s\n", compress(@missing)  
);
      }
      return if ( $conf{"check-signon"} eq "missing" );
      my $exe_count = keys(%target_exe);
@@ -6061,32 +6063,16 @@
      return \%res;
  }

-sub show_pid {
+sub maybe_show_pid {
      my ( $vp, $pid ) = @_;

-    debug( $vp, "Looking at $vp, pid: $pid" );
+    debug( $vp, "maybe_show_pid vp $vp, pid: $pid" );

      my %d;
-    $d{pid} = $pid;
      $d{vp}  = $vp;
+    $d{pid} = $pid;
      push( @{ $confInner{"all-pids"} }, \%d );
-}
-
-sub maybe_show_pid {
-    my ( $vp, $pid ) = @_;
-
-    debug( $vp, "maybe_show_pid vp $vp, pid: $pid" );

-    if ( $#ranks == -1 ) {
-        show_pid( $vp, $pid );
-    }
-
-    foreach my $rank (@ranks) {
-        if ( $rank eq $vp ) {
-            show_pid( $vp, $pid );
-            return;
-        }
-    }
  }

  sub find_from_status {
@@ -6477,15 +6463,6 @@
          $confInner{"orte-data"} = $cmd->{jobconfig}{"orte-data"};
      }

-# Save the rank list if supplied, if there is no list then assume all,  
should probably
-# be sent over as part of the request rather than the header ready for  
when padb
-# can handle multiple commands over one run.
-# XXX: We also need to handle the case where modes don't accept partial  
input, for example
-# deadlock detect where this shouldn't be passed.
-    if ( exists( $cmd->{ranks} ) ) {
-        @ranks = @{ $cmd->{ranks} };
-    }
-
  # Query the resource manager to find the pids, they'll be added to  
the "all-pids" field.
      $rmgr{ $cmd->{jobconfig}{rmgr} }{find_pids}( $cmd->{jobconfig}{jobid}  
);

@@ -6565,14 +6542,31 @@

      $confInner{mode} = $cmd->{mode};

+    my $pid_list;
+
+    # If supplied with a rank list then use it now to generate a list of
+    # processes to inspect.
+    if ( exists( $cmd->{ranks} ) ) {
+        my @ranks = @{ $cmd->{ranks} };
+        foreach my $proc ( @{ $confInner{"all-pids"} } ) {
+            my $vp  = $proc->{vp};
+            my $pid = $proc->{pid};
+            foreach my $rank (@ranks) {
+                if ( $vp == $rank ) {
+                    push @{$pid_list}, $proc;
+                }
+            }
+        }
+    } else {
+        $pid_list = $confInner{"all-pids"};
+    }
+
      # Now do the work.
      my $res;
      if ( defined $allfns{ $cmd->{mode} }{handler_all} ) {
-        $res =
-          $allfns{ $cmd->{mode} }{handler_all}( $cmd->{cargs},
-            $confInner{"all-pids"} );
+        $res = $allfns{ $cmd->{mode} }{handler_all}( $cmd->{cargs},  
$pid_list );
      } else {
-        $res = default_handler_all( $cmd, $confInner{"all-pids"} );
+        $res = default_handler_all( $cmd, $pid_list );
      }
      $netdata->{target_responce} = $res;
      $netdata->{all_replys}{target_responce} = $res;




More information about the padb-devel mailing list