Changeset 27805 for trunk/pstamp/scripts/pstamp_checkdependent.pl
- Timestamp:
- Apr 29, 2010, 1:25:33 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstamp_checkdependent.pl (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstamp_checkdependent.pl
r27795 r27805 124 124 ($whole_run or ($it->{data_state} eq 'cleaned'))) { 125 125 126 # Update has not been queued for this component yet. 127 126 128 # XXX: if $whole_run this is going to repeatedly call -setimfiletoupdate. This will be a no-op 127 129 # but is wasteful. … … 140 142 } 141 143 } else { 144 # update for this component has been queued by hasn't completed yet 145 # XXX: in this state we aren't checking the dependents anymore. If something goes wrong this 146 # will never complete. Consider calling the 'queue_update' functions again just to check. They are relatively cheap 147 148 142 149 print "${stage}Run $stage_id state is $it->{state} $component data_state is $it->{data_state}\n"; 143 150 … … 169 176 } 170 177 if (!$job_fault and ($stage eq 'chip')) { 178 # chip processing is done, start destreaking. 171 179 $job_fault = queue_update_magicDSRun($stage, $stage_id, $rlabel, $it->{raw_magicked}, $it->{dsRun_state}); 172 180 } … … 256 264 if !$data or scalar @$data == 0; 257 265 258 my $ good_to_go= 1;266 my $chips_ready = 1; 259 267 my @chipsToUpdate; 260 268 my $chip_id; … … 262 270 $chip_id = $chip->{chip_id}; 263 271 if (($chip->{data_state} ne 'full') or ($need_magic and ($chip->{magicked} <= 0))) { 264 $ good_to_go= 0;272 $chips_ready = 0; 265 273 push @chipsToUpdate, $chip; 266 274 } else { … … 269 277 } 270 278 271 if ($ good_to_go) {279 if ($chips_ready) { 272 280 # the reason we defer setting the warp to update is so that we can handle error conditions at previous 273 281 # stages more easily. … … 335 343 my $need_magic = shift; 336 344 337 # XXXX This is not ready to go yet XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXxx338 339 345 my $diff_id = $metadata->{diff_id}; 340 346 my $diff_mode = $metadata->{diff_mode}; … … 346 352 my $IPP_DIFF_MODE_WARP_WARP = 1; 347 353 my $IPP_DIFF_MODE_WARP_STACK = 2; 348 my $IPP_DIFF_MODE_STACK_WARP = 2;354 my $IPP_DIFF_MODE_STACK_WARP = 3; 349 355 my $IPP_DIFF_MODE_STACK_STACK = 4; 350 356 if ($diff_mode == $IPP_DIFF_MODE_WARP_STACK ) { … … 364 370 $command = "$warptool -warped -warp_id $skycell->{warp1} -skycell_id $skycell_id"; 365 371 my $warp = runToolAndParseExpectOne($command, $verbose); 366 my_die("failed to find warpSkyfile for warpRun $skycell->{warp _id} skycell_id $skycell_id", $PS_EXIT_UNKNOWN_ERROR) if !$warp;372 my_die("failed to find warpSkyfile for warpRun $skycell->{warp1} skycell_id $skycell_id", $PS_EXIT_UNKNOWN_ERROR) if !$warp; 367 373 368 374 if ($warp->{data_state} ne 'full') { … … 373 379 my $command = "$warptool -warped -warp_id $skycell->{warp1} -skycell_id $skycell_id"; 374 380 my $warp1 = runToolAndParseExpectOne($command, $verbose); 375 my_die("failed to find warpSkyfile for warpRun $skycell->{warp_id} skycell_id $skycell_id", $PS_EXIT_UNKNOWN_ERROR) if !$warp1; 376 381 my_die("failed to find warpSkyfile for warpRun $skycell->{warp1} skycell_id $skycell_id", $PS_EXIT_UNKNOWN_ERROR) if !$warp1; 382 383 my $warps_ready = 1; 384 my $status = 0; 377 385 if ($warp1->{data_state} ne 'full') { 378 my $status = queue_update_warp($warp1, 0, $rlabel, $need_magic); 386 $warps_ready = 0; 387 $status = queue_update_warp($warp1, 0, $rlabel, $need_magic); 379 388 if ($status) { 380 389 return $status; … … 383 392 $command = "$warptool -warped -warp_id $skycell->{warp2} -skycell_id $skycell_id"; 384 393 my $warp2 = runToolAndParseExpectOne($command, $verbose); 385 my_die("failed to find warpSkyfile for warpRun $skycell->{warp _id} skycell_id $skycell_id", $PS_EXIT_UNKNOWN_ERROR) if !$warp2;394 my_die("failed to find warpSkyfile for warpRun $skycell->{warp2} skycell_id $skycell_id", $PS_EXIT_UNKNOWN_ERROR) if !$warp2; 386 395 387 396 if ($warp2->{data_state} ne 'full') { 388 return queue_update_warp($warp2, 0, $rlabel, $need_magic); 389 } 390 # fall through to queue the diff update 397 $warps_ready = 0; 398 $status = queue_update_warp($warp2, 0, $rlabel, $need_magic); 399 } 400 401 if (!$warps_ready) { 402 # don't queue the diff update yet 403 return $status; 404 } 405 406 } elsif ($diff_mode == $IPP_DIFF_MODE_STACK_STACK ) { 407 # check the state of the input stack 408 my $command = "$stacktool -sumkskyfile -stack_id $skycell->{stack2}"; 409 my $stack1 = runToolAndParseExpectOne($command, $verbose); 410 my_die("failed to find stackSumSkyfile for stack_id $skycell->{stack2}", $PS_EXIT_UNKNOWN_ERROR) if !$stack1; 411 412 if ($stack1->{state} ne 'full') { 413 print STDERR "input stack for diffRun $diff_id $skycell_id is not in full state faulting jobs\n"; 414 # this faults all jobs depending on this dep_id 415 faultJobs('stop', 'diff', $diff_id, $PSTAMP_GONE); 416 return $PSTAMP_GONE; 417 } 418 # check the state of the template stack 419 $command = "$stacktool -sumkskyfile -stack_id $skycell->{stack2}"; 420 my $stack2 = runToolAndParseExpectOne($command, $verbose); 421 my_die("failed to find stackSumSkyfile for stack_id $skycell->{stack2}", $PS_EXIT_UNKNOWN_ERROR) if !$stack2; 422 423 if ($stack2->{state} ne 'full') { 424 print STDERR "template stack for diffRun $diff_id $skycell_id is not in full state faulting jobs\n"; 425 # this faults all jobs depending on this dep_id 426 faultJobs('stop', 'diff', $diff_id, $PSTAMP_GONE); 427 return $PSTAMP_GONE; 428 } 429 430 # inputs are ready fall through and queue the diff update 431 } elsif ($diff_mode == $IPP_DIFF_MODE_STACK_WARP ) { 432 # check the state of the input stack 433 my $command = "$stacktool -sumkskyfile -stack_id $skycell->{stack1}"; 434 my $stack = runToolAndParseExpectOne($command, $verbose); 435 my_die("failed to find stackSumSkyfile for stack_id $skycell->{stack1}", $PS_EXIT_UNKNOWN_ERROR) if !$stack; 436 437 if ($stack->{state} ne 'full') { 438 print STDERR "input stack for diffRun $diff_id $skycell_id is not in full state faulting jobs\n"; 439 # this faults all jobs depending on this dep_id 440 faultJobs('stop', 'diff', $diff_id, $PSTAMP_GONE); 441 return $PSTAMP_GONE; 442 } 443 444 # now check the template warp 445 $command = "$warptool -warped -warp_id $skycell->{warp2} -skycell_id $skycell_id"; 446 my $warp = runToolAndParseExpectOne($command, $verbose); 447 my_die("failed to find warpSkyfile for warpRun $skycell->{warp2} skycell_id $skycell_id", $PS_EXIT_UNKNOWN_ERROR) if !$warp; 448 449 if ($warp->{data_state} ne 'full') { 450 return queue_update_warp($warp, 0, $rlabel, $need_magic); 451 } 452 # warps are ready fall through and queue the diff update 391 453 } else { 392 # XXX: check stack stack 393 print STDERR "unexpected diff_mode found: $diff_mode\n"; 394 return $PS_EXIT_PROG_ERROR; 454 my_die("unexpected diff_mode found: $diff_mode", $PS_EXIT_PROG_ERROR); 395 455 } 396 456 … … 411 471 return $PS_EXIT_PROG_ERROR; 412 472 } 413 # return value may be the return status of script so zero is good 473 474 # return value is a unix style exit status so zero is good 414 475 return 0; 415 476 }
Note:
See TracChangeset
for help on using the changeset viewer.
