IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34604


Ignore:
Timestamp:
Oct 25, 2012, 1:02:40 PM (14 years ago)
Author:
bills
Message:

if data needed for dependent is in goto_cleaned state, set it to update
This has been running for awhile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20120802/pstamp/scripts/pstamp_checkdependent.pl

    r34238 r34604  
    137137        print "skipping $command\n";
    138138    }
    139 } elsif (($it->{state} eq 'cleaned') or ($it->{state} eq 'update')) {
     139} elsif (($it->{state} eq 'cleaned') or ($it->{state} eq 'goto_cleaned') or ($it->{state} eq 'update')) {
    140140    #       For warp and diff stages we need to call the 'queue_update' subroutines even if the
    141141    #       data_state is update in order to check the state of inputs in earlier stages in the pipeline
     
    260260            # caller will fault the jobs
    261261            return $error_code;
     262        } elsif ($chip->{state} eq 'goto_cleaned') {
     263
     264            # we don't need to check for full data_state
     265            # if ($chip->{data_state} eq 'full') {
     266            {
     267                # cleanup must not be running. Set state to update. If this chip is not 'full' it will be
     268                # set to be updated the next time this script is invoked
     269                # XXX: In the very rare case that this chip run is actually in the running cleanup pantasks
     270                # queue things may get confused but we can live with that
     271                my $command = "$chiptool -updaterun -set_state update -chip_id $chip_id";
     272                $command .= " -set_label $rlabel" if $rlabel;
     273
     274                if (!$no_update) {
     275                    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     276                                run(command => $command, verbose => $verbose);
     277                    unless ($success) {
     278                        my_die("failed to change ${stage}Run $stage_id $component from goto_cleaned to update", $PS_EXIT_UNKNOWN_ERROR);
     279                    }
     280                } else {
     281                    print "skipping $command\n";
     282                }
     283                $queued_update = 1;
     284            }
    262285        } elsif (($chip->{data_state} ne 'update') and ($chip->{data_state} ne 'full')) {
    263286
     
    344367    my $skycell = $metadata;
    345368
     369    # if ($skycell->{state} eq 'goto_cleaned' and $skycell->{data_state} eq 'full') {
     370    if ($skycell->{state} eq 'goto_cleaned') {
     371        # cleanup has been queued, but hasn't finished, probably due to an error or cleanup is not running.
     372        # It's "safe" to set the state to update. If the skycell is not full it will be set to update
     373        # the next time this task runs
     374        my $command = "$warptool -updaterun -set_state update -warp_id $warp_id";
     375        $command .= " -set_label $rlabel" if $rlabel;
     376
     377        if (!$no_update) {
     378            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     379                        run(command => $command, verbose => $verbose);
     380            unless ($success) {
     381                my_die("failed to change state of ${stage}Run $stage_id from goto_cleaned to update", $PS_EXIT_UNKNOWN_ERROR);
     382            }
     383        } else {
     384            print "skipping $command\n";
     385        }
     386        return 0;
     387    }
     388
    346389    # get the list of input chips for this skycell
    347390    my $command = "$warptool -scmap -warp_id $warp_id -skycell_id $skycell_id";
     
    428471    my $skycell = $metadata;
    429472    my $skycell_id = $skycell->{skycell_id};
     473
     474    # if ($metadata->{state} eq 'goto_cleaned' and $metadata->{data_state} eq 'full') {
     475    if ($metadata->{state} eq 'goto_cleaned') {
     476        # cleanup must not be running. Set state to update. If the skycell is not 'full' it will be
     477        # set to be updated the next time this script is invoked
     478        print "changing state of diffRun $diff_id from goto_cleaned to update. skycell $skycell_id is full\n";
     479        my $command = "$difftool -updaterun -set_state update -diff_id $diff_id";
     480        $command .= " -set_label $rlabel" if $rlabel;
     481
     482        if (!$no_update) {
     483            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     484                        run(command => $command, verbose => $verbose);
     485            unless ($success) {
     486                my_die("failed to queue ${stage}Run $stage_id $component for update", $PS_EXIT_UNKNOWN_ERROR);
     487            }
     488        } else {
     489            print "skipping $command\n";
     490        }
     491        return 0;
     492    }
    430493
    431494    if ($diff_mode == $IPP_DIFF_MODE_WARP_STACK ) {
Note: See TracChangeset for help on using the changeset viewer.