Changeset 36460 for tags/ipp-20130712
- Timestamp:
- Jan 21, 2014, 11:27:59 AM (12 years ago)
- Location:
- tags/ipp-20130712/pstamp/scripts
- Files:
-
- 2 edited
-
pstamp_checkdependent.pl (modified) (3 diffs)
-
pstampparse.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20130712/pstamp/scripts/pstamp_checkdependent.pl
r35934 r36460 304 304 } 305 305 $queued_update = 1; 306 } elsif ($chip->{state} eq 'cleaned' and $chip->{data_state} eq 'update') { 307 # we've had a number of runs in this limbo state 308 309 my $command = "$chiptool -updaterun -set_state update -chip_id $chip_id"; 310 $command .= " -set_label $rlabel" if $rlabel; 311 312 if (!$no_update) { 313 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 314 run(command => $command, verbose => $verbose); 315 unless ($success) { 316 my_die("failed to change ${stage}Run $stage_id $component from goto_cleaned to update", $PS_EXIT_UNKNOWN_ERROR); 317 } 318 } else { 319 print "skipping $command\n"; 320 } 321 $queued_update = 1; 306 322 } elsif ($chip->{fault}) { 307 323 $fault_count++; … … 460 476 print "skipping $command\n"; 461 477 } 478 } elsif ($chips_ready and $skycell->{data_state} eq 'update' and $skycell->{state} ne 'update') { 479 my $command = "$warptool -updaterun -warp_id $warp_id -set_state update"; 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 change state of ${stage}Run $stage_id to update", $PS_EXIT_UNKNOWN_ERROR); 487 } 488 } else { 489 print "skipping $command\n"; 490 } 491 462 492 } elsif (scalar @chipsToUpdate > 0) { 463 493 my $fault = check_states_chip($chip_id, \@chipsToUpdate, $rlabel, $need_magic); … … 529 559 } 530 560 return $warp_status; 561 } elsif ($warp->{quality} != 0) { 562 print STDERR "input warp has quality error\n"; 563 faultComponent('diff', $diff_id, $skycell_id, $PSTAMP_GONE); 564 return $PSTAMP_GONE; 531 565 } 532 566 # warps are ready fall through and queue the diff update -
tags/ipp-20130712/pstamp/scripts/pstampparse.pl
r36122 r36460 31 31 my $no_update; 32 32 my $dest_requires_magic; 33 my $dump_params = 0; 33 34 34 35 # set this to true to disable update processing … … 48 49 'save-temps'=> \$save_temps, 49 50 'no-update' => \$no_update, 51 'dump-params' => \$dump_params, 50 52 ); 51 53 … … 238 240 239 241 242 # if label is for one of the high priority channels, watch for big requests 243 my $watch_for_big_requests = (!($label =~ /BIG/) and ($label =~ /PSI/ or $label =~ /WEB/)); 244 245 my $big_limit = 100; # XXX: this should be in a configuration file somewhere not hard coded 246 247 if ($watch_for_big_requests and $nRows > $big_limit) { 248 $label = change_to_lower_priority_label($label); 249 $watch_for_big_requests = 0; 250 } 240 251 241 252 my $num_jobs = 0; 242 my $imageList; 243 my $stage; 244 my $big_limit = 100; # XXX: this should be in a configuration file some where 253 245 254 foreach my $row (@$rows) { 246 247 if (!($label =~ /BIG/) and ($label =~ /PSI/ or $label =~ /WEB/) and248 ($nRows > 200 or $num_jobs > 200) and $req_id and !$no_update) {249 # This is a "big" request and it came from one of the "high priority"250 # channels and doesn't have a specific label assigned.251 # Change the label to a value that its jobs run with lower priority.252 my $old_label = $label;253 254 print "\nChanging label for big request from $old_label to $label\n";255 $label = ($label =~ /WEB/) ? 'WEB.BIG' : 'PSI.BIG';256 257 my $command = "$pstamptool -updatereq -req_id $req_id -set_label $label";258 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =259 run(command => $command, verbose => $verbose);260 unless ($success) {261 my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR);262 }263 }264 255 265 256 # validate the paramaters … … 274 265 275 266 $num_jobs += processRow($action, $row); 267 268 # see whether number of jobs limit for high priority request was exceeded 269 if ($watch_for_big_requests and $num_jobs > $big_limit) { 270 $label = change_to_lower_priority_label($label); 271 $watch_for_big_requests = 0; 272 } 276 273 } 277 274 … … 284 281 285 282 exit 0; 283 284 # end of main function 285 286 sub change_to_lower_priority_label { 287 my $label = shift; 288 my $old_label = $label; 289 $label = ($label =~ /WEB/) ? 'WEB.BIG' : 'PSI.BIG'; 290 print "\nChanging label for big $old_label request to $label\n"; 291 292 my $command = "$pstamptool -updatereq -req_id $req_id -set_label $label"; 293 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 294 run(command => $command, verbose => $verbose); 295 unless ($success) { 296 my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR); 297 } 298 return $label; 299 } 286 300 287 301 sub checkRow { … … 492 506 print "\nCalling locate_images_for_row for row: $rownum\n"; 493 507 494 $imageList = locate_images_for_row($ipprc, $image_db, $camera, $row, $verbose);508 my $imageList = locate_images_for_row($ipprc, $image_db, $camera, $row, $verbose); 495 509 496 510 my $dtime_locate = gettimeofday() - $start_locate; … … 584 598 # information required is contained there 585 599 586 $imageList = locate_images($ipprc, $image_db, $rowList, $req_type, $stage, $id, $tess_id, $component,600 my $imageList = locate_images($ipprc, $image_db, $rowList, $req_type, $stage, $id, $tess_id, $component, 587 601 $option_mask, $need_magic, $mjd_min, $mjd_max, $filter, $data_group, $verbose); 588 602 … … 775 789 print "$image->{image}\n"; 776 790 ++$firstRow->{job_num}; 791 if ($dump_params) { 792 my $rownum = $firstRow->{ROWNUM}; 793 my $jobnum = $firstRow->{job_num}; 794 my $filter = substr $image->{filter}, 0, 1; 795 my $output_base = "${rownum}_${jobnum}_${filter}"; 796 write_params($output_base, $image); 797 } 777 798 } 778 799 } elsif ($job_type eq "get_image") {
Note:
See TracChangeset
for help on using the changeset viewer.
