IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 24, 2012, 4:40:12 PM (14 years ago)
Author:
bills
Message:

more work on detectability queries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/dqueryparse.pl

    r33126 r33141  
    118118{
    119119    my $command = "$detectresponse --input $req_file --output $response_file --workdir $outdir";
     120    if ($job_id) {
     121        $command .= " --job_id $job_id";
     122    } else {
     123        $command .= " --ignore-wisdom";
     124    }
    120125    $command .= " --save-temps" if $save_temps;
    121126    $command .= " --verbose" if $verbose;
    122     $command .= " --ignore-wisdom" if !$job_id;
    123127
    124128    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    133137            my_die ("Update request indicated, but unable to find actual request!", $PS_EXIT_PROG_ERROR);
    134138        }
     139        warn("Some inputs are not available must be updated.";
    135140    }   
    136141   
     
    139144my $result;
    140145unless ($job_id) {
     146    # We are running as a parse job
    141147    # If we returned correctly with a valid response file, get a job ID
    142148    # for the completed work, and move the response to a standardized name.
     
    152158            chomp $job_id;
    153159            if ($job_id && -e $response_file) {
    154                 rename $response_file, "$outdir/response${job_id}.fits";
     160                rename $response_file, "$outdir/response.${job_id}.fits";
    155161            }
    156162            $result = 0;
     
    222228        my_die ("Parse fault!!", $fault);
    223229    }
     230    # This does not set the request state to stop.  That will happen with the request_finish.pl script,
     231    # which will notice that we've inserted the stopped job and decide we're finished. Easy enough.
     232    {
     233        my $command = "$pstamptool -updatereq -req_id $req_id -set_name $req_name -set_outProduct $product";
     234        $command .= " -set_fault $result" if $result;
     235
     236        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     237            run(command => $command, verbose => $verbose);
     238        unless ($success) {
     239            my_die("$command failed",$PS_EXIT_UNKNOWN_ERROR);
     240        }
     241    }
    224242} else {
     243    # We are running as a job presumably because an input needed
     244    # to be regenerated
     245    if ($fault) {
    225246        # in some cases we will need to finish off the request
    226247        my_die ("Run fault!!", $fault);
    227 }
    228 
    229 # This does not set the request state to stop.  That will happen with the request_finish.pl script,
    230 # which will notice that we've inserted the stopped job and decide we're finished. Easy enough.
    231 {
    232     my $command = "$pstamptool -updatereq -req_id $req_id -set_name $req_name -set_outProduct $product";
    233     $command .= " -set_fault $result" if $result;
    234 
    235     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    236         run(command => $command, verbose => $verbose);
    237     unless ($success) {
    238         my_die("$command failed",$PS_EXIT_UNKNOWN_ERROR);
    239     }
    240 }
     248    }
     249    if (-e $response_file) {
     250        rename $response_file, "$outdir/response.${job_id}.fits";
     251    }
     252}
     253
    241254 
    242255exit 0;
Note: See TracChangeset for help on using the changeset viewer.