Changeset 29561 for trunk/pstamp/scripts/pstamp_checkdependent.pl
- Timestamp:
- Oct 26, 2010, 8:39:32 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstamp_checkdependent.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstamp_checkdependent.pl
r29348 r29561 197 197 if (!$job_fault and ($stage eq 'chip')) { 198 198 # chip processing is done, start destreaking. 199 $job_fault = check_states_magicDSRun($stage, $stage_id, $rlabel, $need_magic, $it->{raw_magicked}, $it->{dsRun_state}); 199 my @chips; 200 push @chips, $it->{class_id}; 201 $job_fault = check_states_magicDSRun($stage, $stage_id, \@chips, $rlabel, $need_magic, $it->{raw_magicked}, $it->{magic_ds_id}, $it->{dsRun_state}); 200 202 } 201 203 if ($job_fault) { … … 217 219 my $dsRun_state; 218 220 my $raw_all_magicked = 1; # this gets cleared if any of the inputs aren't destreaked 221 my @chips; 222 my $magic_ds_id; 219 223 if (!$whole_run) { 220 224 foreach my $chip (@$metadatas) { 221 225 $dsRun_state = $chip->{dsRun_state}; 222 226 $raw_all_magicked &= ($chip->{raw_magicked} > 0); 227 $magic_ds_id = $chip->{magic_ds_id}; 228 229 push @chips, $chip->{class_id}; 223 230 224 231 if (($chip->{state} =~ /error/) or ($chip->{state} =~ /purged/) or ($chip->{state} =~ /scrubbed/)) { … … 273 280 } 274 281 275 my $status = check_states_magicDSRun('chip', $chip_id, $rlabel, $need_magic, $raw_all_magicked, $dsRun_state);282 my $status = check_states_magicDSRun('chip', $chip_id, \@chips, $rlabel, $need_magic, $raw_all_magicked, $magic_ds_id, $dsRun_state); 276 283 277 284 return $status; … … 633 640 my $stage = shift; 634 641 my $stage_id = shift; 642 my $components = shift; 635 643 my $rlabel = shift; 636 644 my $need_magic = shift; 637 645 my $input_magicked = shift; 646 my $magic_ds_id = shift; 638 647 my $dsRun_state = shift; 639 648 640 649 # XXX: this code assumes that destreaking is handled at the chip stage 641 my_die ("check_states_magicDSRun only works for stage chip", $PS_EXIT_PROG_ERROR) if $stage ne 'chip';650 my_die ("check_states_magicDSRun only implemented for chip stage", $PS_EXIT_PROG_ERROR) if $stage ne 'chip'; 642 651 643 652 # if called from check_states_warp dsRun_state is unknown. Go find it. … … 654 663 print "No magicDSRun for chipRun $stage_id and magic is required\n"; 655 664 faultJobs('stop', undef, undef, $PSTAMP_NOT_DESTREAKED); 656 } elsif ($dsRun_state eq 'cleaned') { 657 my $command = "$magicdstool -updaterun -set_state new -stage $stage -stage_id $stage_id"; 658 $command .= " -set_label $rlabel" if $rlabel; 659 if (!$no_update) { 660 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 661 run(command => $command, verbose => $verbose); 662 unless ($success) { 663 my_die("failed to set destreak run to 'new' for ${stage}Run $stage_id", 664 $PS_EXIT_UNKNOWN_ERROR); 665 } elsif (($dsRun_state eq 'cleaned') or ($dsRun_state eq 'update')) { 666 foreach my $c (@$components) { 667 my $command = "$magicdstool -setfiletoupdate -magic_ds_id $magic_ds_id -component $c"; 668 $command .= " -set_label $rlabel" if $rlabel; 669 if (!$no_update) { 670 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 671 run(command => $command, verbose => $verbose); 672 unless ($success) { 673 my_die("failed to set destreaked component to 'update' for ${stage}Run $stage_id $c", 674 $PS_EXIT_UNKNOWN_ERROR); 675 } 676 } else { 677 print "skipping $command\n"; 665 678 } 666 } else {667 print "skipping $command\n";668 679 } 669 680 } elsif ($dsRun_state eq 'failed_revert') {
Note:
See TracChangeset
for help on using the changeset viewer.
