Changeset 36165 for trunk/pstamp/scripts/pstampparse.pl
- Timestamp:
- Oct 1, 2013, 10:04:02 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r36143 r36165 240 240 241 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 } 242 251 243 252 my $num_jobs = 0; 244 my $imageList; 245 my $stage; 246 my $big_limit = 100; # XXX: this should be in a configuration file some where 253 247 254 foreach my $row (@$rows) { 248 249 250 if (!($label =~ /BIG/) and ($label =~ /PSI/ or $label =~ /WEB/) and ($nRows > $big_limit or $num_jobs > $big_limit)251 and $req_id and !$no_update) {252 253 # This is a "big" request and it came from one of the "high priority" channels254 # and doesn't have a specific label assigned.255 # Change the label to a value that its jobs run with lower priority.256 257 my $old_label = $label;258 $label = ($label =~ /WEB/) ? 'WEB.BIG' : 'PSI.BIG';259 print "\nChanging label for big $old_label request to $label\n";260 261 my $command = "$pstamptool -updatereq -req_id $req_id -set_label $label";262 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =263 run(command => $command, verbose => $verbose);264 unless ($success) {265 my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR);266 }267 }268 255 269 256 # validate the paramaters … … 278 265 279 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 } 280 273 } 281 274 … … 288 281 289 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 } 290 300 291 301 sub checkRow { … … 496 506 print "\nCalling locate_images_for_row for row: $rownum\n"; 497 507 498 $imageList = locate_images_for_row($ipprc, $image_db, $camera, $row, $verbose);508 my $imageList = locate_images_for_row($ipprc, $image_db, $camera, $row, $verbose); 499 509 500 510 my $dtime_locate = gettimeofday() - $start_locate; … … 588 598 # information required is contained there 589 599 590 $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, 591 601 $option_mask, $need_magic, $mjd_min, $mjd_max, $filter, $data_group, $verbose); 592 602
Note:
See TracChangeset
for help on using the changeset viewer.
