Changeset 28164 for branches/czw_branch/20100519/pstamp/scripts
- Timestamp:
- May 28, 2010, 3:09:59 PM (16 years ago)
- Location:
- branches/czw_branch/20100519
- Files:
-
- 6 edited
- 1 copied
-
. (modified) (1 prop)
-
pstamp/scripts/pstamp_checkdependent.pl (modified) (19 diffs)
-
pstamp/scripts/pstamp_finish.pl (modified) (3 diffs)
-
pstamp/scripts/pstamp_request_file (modified) (1 diff)
-
pstamp/scripts/pstamp_results_file.pl (modified) (1 diff)
-
pstamp/scripts/pstampparse.pl (modified) (1 diff)
-
pstamp/scripts/pstamprequest (copied) (copied from trunk/pstamp/scripts/pstamprequest )
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20100519
- Property svn:mergeinfo changed
/trunk (added) merged: 28046-28057,28062-28069,28072-28076,28079-28100
- Property svn:mergeinfo changed
-
branches/czw_branch/20100519/pstamp/scripts/pstamp_checkdependent.pl
r27921 r28164 80 80 my $whole_run = ($component eq 'all'); 81 81 82 # XXX: whole_run was a concept that isn't practical. Having one dependent for 83 # a whole run makes finding errors too hard. We always have a dependent for each 84 # component. 85 # XXX: remove the unneeded code 86 my_die("component = 'all' not supported", $PS_EXIT_PROG_ERROR) if $whole_run;; 87 82 88 if ($whole_run) { 83 89 if ($stage eq "chip") { … … 135 141 print "skipping $command\n"; 136 142 } 137 } elsif (($it->{state} eq 'cleaned') or ($it->{state} eq 'update') and 138 ($whole_run or ($it->{data_state} eq 'cleaned'))) { 139 140 # Update has not been queued for this component yet. 141 142 # XXX: if $whole_run this is going to repeatedly call -setimfiletoupdate. This will be a no-op 143 # but is wasteful. 144 # Maybe we should deal with having three states for pstampDependent.state. 'new', 'run', 'full' 145 # need to queue the updates 143 } elsif (($it->{state} eq 'cleaned') or ($it->{state} eq 'update')) { 144 # For warp and diff stages we need to call the 'queue_update' subroutines even if the 145 # data_state is update in order to check the earlier stages in the pipeline 146 # For example if warpSkyfile is in update state but the chip run that it depends on hasn't 147 # been updated we need to go and queue it. 148 149 if ($it->{fault}) { 150 my_die("Component faulted on update dep_id: $dep_id", 151 $PS_EXIT_SYS_ERROR); 152 } 153 146 154 if ($stage eq 'chip') { 147 # queue_update_chip takes an array so that queue_update_warp can pass it set of chips155 # check_states_chip takes an array so that check_states_warp can pass it set of chips 148 156 my $chips = [$it]; 149 $status = queue_update_chip($it->{chip_id}, $whole_run, $chips, $rlabel, $need_magic);157 $status = check_states_chip($it->{chip_id}, $whole_run, $chips, $rlabel, $need_magic); 150 158 } elsif ($stage eq 'warp') { 151 $status = queue_update_warp($it, $whole_run, $rlabel, $need_magic);159 $status = check_states_warp($it, $whole_run, $rlabel, $need_magic); 152 160 } elsif ($stage eq 'diff') { 153 $status = queue_update_diff($it, $whole_run, $rlabel, $need_magic);161 $status = check_states_diff($it, $whole_run, $rlabel, $need_magic); 154 162 } else { 155 163 my_die("Unexpected stage found $stage", $PS_EXIT_PROG_ERROR); 156 164 } 157 165 } else { 158 # update for this component has been queued by hasn't completed yet or the state is an error state159 # XXX: in this state we aren't checking the dependents anymore. If something goes wrong this160 # will never complete. Consider calling the 'queue_update' functions again just to check. They are relatively cheap161 162 163 166 print "${stage}Run $stage_id state is $it->{state} $component data_state is $it->{data_state}\n"; 164 167 … … 170 173 my $job_fault = 0; 171 174 172 # temporary hack to deal with data with old burntool tables. This check is now done by pstampparse.pl 173 # so runs in this state should not get queued 175 if (0) { 174 176 if ($stage eq 'chip') { 177 # XXX: There is no need to check this anymore. All magicked chipRuns have abs(burntool_state) >= 13 178 # If something changes that causes an error, we will figure that out from the chip failure 175 179 my $burntool_state = $it->{burntool_state}; 176 if ($burntool_state and (abs($burntool_state) < 14)) { 180 # XXX: get the value of 13 from the ppImage recipe 181 if ($burntool_state and (abs($burntool_state) < 13)) { 177 182 print STDERR "chip $it->{chip_id} $it->{class_id} has burntool_state $burntool_state. Not avaiable.\n"; 178 183 $job_fault = $PSTAMP_NOT_AVAILABLE; 179 184 } 180 185 } 186 } 181 187 if ($state eq 'error_cleaned') { 182 188 $job_fault = $PSTAMP_NOT_AVAILABLE; … … 191 197 if (!$job_fault and ($stage eq 'chip')) { 192 198 # chip processing is done, start destreaking. 193 $job_fault = queue_update_magicDSRun($stage, $stage_id, $rlabel, $need_magic, $it->{raw_magicked}, $it->{dsRun_state});199 $job_fault = check_states_magicDSRun($stage, $stage_id, $rlabel, $need_magic, $it->{raw_magicked}, $it->{dsRun_state}); 194 200 } 195 201 if ($job_fault) { … … 201 207 202 208 203 sub queue_update_chip {209 sub check_states_chip { 204 210 my $chip_id = shift; 205 211 my $whole_run = shift; # if true queue entire run for update … … 216 222 $raw_all_magicked &= ($chip->{raw_magicked} > 0); 217 223 218 if ($chip->{state} =~ /error/) { 224 if (($chip->{state} =~ /error/) or ($chip->{state} =~ /purged/) or ($chip->{state} =~ /scrubbed/)) { 225 print "chipRun state is $chip->{chip_id} is in state $chip->{state} cannot update\n"; 219 226 faultJobs('stop', undef, undef, $PSTAMP_GONE); 227 return; 220 228 } elsif (($chip->{data_state} ne 'update') and ($chip->{data_state} ne 'full')) { 221 229 my $command = "$chiptool -setimfiletoupdate -chip_id $chip_id -class_id $chip->{class_id}"; … … 237 245 $dsRun_state = $run->{dsRun_state}; 238 246 $raw_all_magicked = ($run->{raw_magicked} > 0); 247 my $state = $run->{state}; 248 if (($state =~ /error/) or ($state =~ /purged/) or ($state =~ /scrubbed/)) { 249 print "chipRun state is $run->{chip_id} is in state $state cannot update\n"; 250 faultJobs('stop', undef, undef, $PSTAMP_GONE); 251 return; 252 } 239 253 240 254 # providing no -class_id arguments changes all imfiles with data_state = 'cleaned' to 'update' … … 253 267 } 254 268 255 my $status = queue_update_magicDSRun('chip', $chip_id, $rlabel, $need_magic, $raw_all_magicked, $dsRun_state);269 my $status = check_states_magicDSRun('chip', $chip_id, $rlabel, $need_magic, $raw_all_magicked, $dsRun_state); 256 270 257 271 return $status; 258 272 } 259 273 260 sub queue_update_warp {274 sub check_states_warp { 261 275 # check status of input chips. If state is not updatable set error code for job 262 276 263 # if chipProcessedImfile.state is cleaned call queue_update_chip277 # if chipProcessedImfile.state is cleaned call check_states_chip 264 278 265 279 # need to code warptool -setskyfiletoupdate … … 301 315 } 302 316 303 if ($chips_ready ) {317 if ($chips_ready and $skycell->{data_state} ne 'update') { 304 318 # the reason we defer setting the warp to update is so that we can handle error conditions at previous 305 319 # stages more easily. … … 317 331 } 318 332 } elsif (scalar @chipsToUpdate > 0) { 319 return queue_update_chip($chip_id, 0, \@chipsToUpdate, $rlabel, $need_magic);333 return check_states_chip($chip_id, 0, \@chipsToUpdate, $rlabel, $need_magic); 320 334 } 321 335 } else { … … 354 368 (($chipRun->{state} eq 'full') and ($need_magic and ($chipRun->{magicked} < 0) and ($chipRun->{dsRun_state} ne 'new')))) { 355 369 my $data = [$chipRun]; 356 return queue_update_chip($chipRun->{chip_id}, 1, $data, $rlabel, $need_magic);370 return check_states_chip($chipRun->{chip_id}, 1, $data, $rlabel, $need_magic); 357 371 } 358 372 } … … 361 375 return 0; 362 376 } 363 sub queue_update_diff {377 sub check_states_diff { 364 378 my $metadata = shift; 365 379 my $whole_run = shift; # if true queue entire run for update … … 392 406 393 407 if ($warp->{data_state} ne 'full') { 394 return queue_update_warp($warp, 0, $rlabel, $need_magic);408 return check_states_warp($warp, 0, $rlabel, $need_magic); 395 409 } 396 410 # warps are ready fall through and queue the diff update … … 404 418 if ($warp1->{data_state} ne 'full') { 405 419 $warps_ready = 0; 406 $status = queue_update_warp($warp1, 0, $rlabel, $need_magic);420 $status = check_states_warp($warp1, 0, $rlabel, $need_magic); 407 421 if ($status) { 408 422 return $status; … … 415 429 if ($warp2->{data_state} ne 'full') { 416 430 $warps_ready = 0; 417 $status = queue_update_warp($warp2, 0, $rlabel, $need_magic);431 $status = check_states_warp($warp2, 0, $rlabel, $need_magic); 418 432 } 419 433 … … 467 481 468 482 if ($warp->{data_state} ne 'full') { 469 return queue_update_warp($warp, 0, $rlabel, $need_magic);483 return check_states_warp($warp, 0, $rlabel, $need_magic); 470 484 } 471 485 # warps are ready fall through and queue the diff update … … 474 488 } 475 489 476 my $command = "$difftool -setskyfiletoupdate -diff_id $diff_id -skycell_id $skycell_id"; 477 $command .= " -set_label $rlabel" if $rlabel; 478 479 if (!$no_update) { 480 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 481 run(command => $command, verbose => $verbose); 482 unless ($success) { 483 my_die("failed to queue ${stage}Run $stage_id $component for update", $PS_EXIT_UNKNOWN_ERROR); 484 } 485 } else { 486 print "skipping $command\n"; 490 if ($skycell->{data_state} ne 'update') { 491 my $command = "$difftool -setskyfiletoupdate -diff_id $diff_id -skycell_id $skycell_id"; 492 $command .= " -set_label $rlabel" if $rlabel; 493 494 if (!$no_update) { 495 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 496 run(command => $command, verbose => $verbose); 497 unless ($success) { 498 my_die("failed to queue ${stage}Run $stage_id $component for update", $PS_EXIT_UNKNOWN_ERROR); 499 } 500 } else { 501 print "skipping $command\n"; 502 } 487 503 } 488 504 } else { … … 599 615 } 600 616 601 sub queue_update_magicDSRun {617 sub check_states_magicDSRun { 602 618 my $stage = shift; 603 619 my $stage_id = shift; … … 608 624 609 625 # XXX: this code assumes that destreaking is handled at the chip stage 610 my_die (" queue_update_magicDSRun only works for stage chip", $PS_EXIT_PROG_ERROR) if $stage ne 'chip';611 612 # if called from queue_update_warp dsRun_state is unknown. Go find it.626 my_die ("check_states_magicDSRun only works for stage chip", $PS_EXIT_PROG_ERROR) if $stage ne 'chip'; 627 628 # if called from check_states_warp dsRun_state is unknown. Go find it. 613 629 if (!$dsRun_state) { 614 630 my $command = "$chiptool -listrun -chip_id $stage_id"; -
branches/czw_branch/20100519/pstamp/scripts/pstamp_finish.pl
r27896 r28164 176 176 my $exp_id = $job->{exp_id}; 177 177 178 my $error_string = get_error_string($fault); 179 178 180 if (($fault eq $PSTAMP_DUP_REQUEST) and ($req_name eq "NULL")) { 179 181 # this request had a duplicate request name yet the parser didn't give … … 220 222 221 223 # add line to the table definition file 222 print $tdf "$rownum|$fault|$ img_name|$job_id|";224 print $tdf "$rownum|$fault|$error_string|$img_name|$job_id|"; 223 225 224 226 # ra_deg and dec_deg are the coordinates of center of the stamp … … 241 243 } else { 242 244 print STDERR "no reglist file for job $job_id\n" if $verbose; 243 print $tdf "$rownum|$fault| 0|$job_id|";245 print $tdf "$rownum|$fault|$error_string|0|$job_id|"; 244 246 print $tdf "0|0|"; # center of (non-existent) stamp 245 247 print $tdf "$exp_info|"; -
branches/czw_branch/20100519/pstamp/scripts/pstamp_request_file
r27751 r28164 29 29 30 30 printhelp($0) if $help; 31 31 32 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 32 pod2usage( -msg => "Required options: --input", 33 -exitval => 3) unless defined $input; 33 34 unless (defined $input) { 35 print STDERR "Required options: --input\n"; 36 printhelp($0); 37 } 34 38 35 39 # The header kewords -
branches/czw_branch/20100519/pstamp/scripts/pstamp_results_file.pl
r26289 r28164 54 54 # error code from processing this image 55 55 { name => 'ERROR_CODE',type => 'V', writetype => TULONG }, 56 # error string correspoding to ERROR_CODE 57 { name => 'ERROR_STR',type => '24A', writetype => TSTRING }, 56 58 # name of the postage stamp image 57 59 { name => 'IMG_NAME', type => '64A', writetype => TSTRING }, -
branches/czw_branch/20100519/pstamp/scripts/pstampparse.pl
r28021 r28164 811 811 # chipRun's can be in full state if destreaking is necessary 812 812 if (($state ne 'cleaned') and ($state ne 'update') and ($state ne 'goto_cleaned') and 813 ($stage eq'chip' and $state eq 'full')) {813 ($stage ne 'chip' and $state eq 'full')) { 814 814 my_die("$stage $stage_id is in unexpected state $state", $PS_EXIT_PROG_ERROR); 815 815 }
Note:
See TracChangeset
for help on using the changeset viewer.
