- Timestamp:
- Oct 9, 2013, 4:06:09 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130904/pstamp/scripts
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pstampparse.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130904/pstamp/scripts
- Property svn:mergeinfo changed
/trunk/pstamp/scripts (added) merged: 36104,36126,36135,36142-36143,36165-36166,36182
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130904/pstamp/scripts/pstampparse.pl
r36061 r36192 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 248 if (!($label =~ /BIG/) and ($label =~ /PSI/ or $label =~ /WEB/) and ($nRows > $big_limit or $num_jobs > $big_limit)249 and $req_id and !$no_update) {250 251 # This is a "big" request and it came from one of the "high priority" channels252 # and doesn't have a specific label assigned.253 # Change the label to a value that its jobs run with lower priority.254 255 my $old_label = $label;256 $label = ($label =~ /WEB/) ? 'WEB.BIG' : 'PSI.BIG';257 print "\nChanging label for big $old_label request to $label\n";258 259 my $command = "$pstamptool -updatereq -req_id $req_id -set_label $label";260 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =261 run(command => $command, verbose => $verbose);262 unless ($success) {263 my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR);264 }265 }266 255 267 256 # validate the paramaters … … 276 265 277 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 } 278 273 } 279 274 … … 286 281 287 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 } 288 300 289 301 sub checkRow { … … 494 506 print "\nCalling locate_images_for_row for row: $rownum\n"; 495 507 496 $imageList = locate_images_for_row($ipprc, $image_db, $camera, $row, $verbose);508 my $imageList = locate_images_for_row($ipprc, $image_db, $camera, $row, $verbose); 497 509 498 510 my $dtime_locate = gettimeofday() - $start_locate; … … 586 598 # information required is contained there 587 599 588 $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, 589 601 $option_mask, $need_magic, $mjd_min, $mjd_max, $filter, $data_group, $verbose); 590 602 … … 777 789 print "$image->{image}\n"; 778 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 } 779 798 } 780 799 } elsif ($job_type eq "get_image") {
Note:
See TracChangeset
for help on using the changeset viewer.
