Changeset 32851
- Timestamp:
- Dec 2, 2011, 11:44:07 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20111122
- Files:
-
- 38 edited
- 8 copied
-
ippMonitor (modified) (1 prop)
-
ippMonitor/Makefile.in (modified) (1 diff)
-
ippMonitor/czartool/czarplot.pl (modified) (8 diffs)
-
ippMonitor/czartool/czarpoll.pl (modified) (2 diffs)
-
ippMonitor/czartool/czartool/CzarDb.pm (modified) (7 diffs)
-
ippMonitor/czartool/czartool/Pantasks.pm (modified) (1 diff)
-
ippMonitor/czartool/czartool/Plotter.pm (modified) (14 diffs)
-
ippMonitor/raw/czartool_ipptopsps.php (copied) (copied from trunk/ippMonitor/raw/czartool_ipptopsps.php )
-
ippMonitor/raw/czartool_labels.php (modified) (4 diffs)
-
ippMonitor/raw/ipp.imfiles.dat (modified) (1 diff)
-
ippScripts/scripts/addstar_run.pl (modified) (4 diffs)
-
ippScripts/scripts/ipp_apply_burntool_single.pl (modified) (1 prop)
-
ippScripts/scripts/ipp_filename.pl (modified) (1 diff)
-
ippScripts/scripts/magic_destreak.pl (modified) (1 diff)
-
ippScripts/scripts/register_exp.pl (modified) (4 diffs)
-
ippScripts/scripts/videophot_process.pl (modified) (3 diffs)
-
ippScripts/scripts/whichimage (modified) (2 diffs)
-
ippTasks/addstar.pro (modified) (7 diffs)
-
ippTasks/survey.pro (modified) (3 diffs)
-
ippTools/share/Makefile.am (modified) (5 diffs)
-
ippTools/share/addtool_find_pendingexp_staticsky_multi.sql (copied) (copied from trunk/ippTools/share/addtool_find_pendingexp_staticsky_multi.sql )
-
ippTools/share/addtool_find_processedexp_staticsky_multi.sql (copied) (copied from trunk/ippTools/share/addtool_find_processedexp_staticsky_multi.sql )
-
ippTools/share/addtool_find_sky_id_multi.sql (copied) (copied from trunk/ippTools/share/addtool_find_sky_id_multi.sql )
-
ippTools/share/addtool_find_sky_id_multi_dvo.sql (copied) (copied from trunk/ippTools/share/addtool_find_sky_id_multi_dvo.sql )
-
ippTools/share/addtool_queue_cam_id.sql (modified) (1 diff)
-
ippTools/share/addtool_queue_sky_id.sql (modified) (1 diff)
-
ippTools/share/addtool_queue_sky_id_multi.sql (copied) (copied from trunk/ippTools/share/addtool_queue_sky_id_multi.sql )
-
ippTools/share/addtool_queue_stack_id.sql (modified) (1 diff)
-
ippTools/share/addtool_revertprocessedexp_staticsky_multi.sql (copied) (copied from trunk/ippTools/share/addtool_revertprocessedexp_staticsky_multi.sql )
-
ippTools/share/camtool_find_pendingimfile.sql (modified) (1 prop)
-
ippTools/share/disttool_listinterests.sql (modified) (1 diff)
-
ippTools/share/magicdstool_getskycells.sql (modified) (2 diffs)
-
ippTools/share/pstamptool_listfile.sql (copied) (copied from trunk/ippTools/share/pstamptool_listfile.sql )
-
ippTools/share/pxadmin_create_tables.sql (modified) (1 diff, 1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/addtool.c (modified) (13 diffs)
-
ippTools/src/disttool.c (modified) (1 diff)
-
ippTools/src/flatcorr.c (modified) (1 diff)
-
ippTools/src/magictool.c (modified) (1 prop)
-
ippTools/src/pstamptool.c (modified) (3 diffs)
-
ippTools/src/pstamptool.h (modified) (1 diff)
-
ippTools/src/pstamptoolConfig.c (modified) (2 diffs)
-
ippTools/src/pxadd.c (modified) (3 diffs)
-
ippTools/src/pxadd.h (modified) (1 diff)
-
ippTools/src/vptool.c (modified) (3 diffs)
-
ippTools/src/vptoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/ippMonitor
- Property svn:mergeinfo changed
/trunk/ippMonitor (added) merged: 32760-32763,32765-32769,32775,32782-32784,32790,32796-32797,32818
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20111122/ippMonitor/Makefile.in
r31816 r32851 60 60 $(DESTWWW)/czartool_getplot.php \ 61 61 $(DESTWWW)/czartool_exposures.php \ 62 $(DESTWWW)/czartool_ipptopsps.php \ 62 63 $(DESTWWW)/histogram.php \ 63 64 $(DESTWWW)/show_and_delete_image.php \ -
branches/eam_branches/ipp-20111122/ippMonitor/czartool/czarplot.pl
r32325 r32851 27 27 my $nebulous = undef; 28 28 my $savingToFile = undef; 29 my $analysis = undef;30 29 my $exposureId = undef; 31 30 my $log = undef; 31 my $psps = undef; 32 32 33 33 GetOptions ( … … 45 45 "nebulous|n" => \$nebulous, 46 46 "rate|r" => \$rate, 47 "analysis|a" => \$analysis,48 47 "timeseries|t" => \$timeSeries, 49 48 "verbose|v" => \$verbose, 50 49 "log|g" => \$log, 50 "psps|u" => \$psps, 51 51 ); 52 52 … … 58 58 print "* UNKNKOWN: option @ARGV\n"; 59 59 } 60 if ($analysis && !$stage) {61 $quit = 1;62 print "* REQUIRED: choose a stage for analsis -s <chip|cam|warp|etc> (default=none)\n";}63 60 if (!$histogram) { 64 61 print "* OPTIONAL: plot histogram -h (default=off)\n";} … … 71 68 if (!$rate) { 72 69 print "* OPTIONAL: plot histogram of rate -r (default=off)\n";} 73 if (!$analysis) {74 $analysis = 0;75 print "* OPTIONAL: include analysis -a (default=$analysis)\n";}76 70 if (!$log) { 77 71 $log = 0; … … 97 91 print "* OPTIONAL: choose an output location -o <path> (default=none)\n"; 98 92 } 93 if (!$psps) { 94 print "* OPTIONAL: plot ippToPsps stages -u (default=off)\n";} 99 95 print "*\n*******************************************************************************\n"; 100 96 … … 104 100 105 101 # default values 106 if (!$rate && !$magicMask && !$nebulous && !$histogram && !$ analysis && !$timeSeries) {$timeSeries = 1;}102 if (!$rate && !$magicMask && !$nebulous && !$histogram && !$timeSeries) {$timeSeries = 1;} 107 103 if (!$verbose) {$verbose = 0;} 108 104 if (!$save_temps) {$save_temps = 0;} … … 123 119 $plotter = czartool::Plotter->new_display($config, $save_temps); 124 120 } 121 122 if ($psps) {$plotter->setIppToPspsMode();} 125 123 126 124 # if a single day has been chosen … … 177 175 } 178 176 179 if($analysis) {180 181 my $stageMetrics = new czartool::StageMetrics($stage, $label, $begin, $end);182 if ($czarDb->runAnalysis($stageMetrics)) {$stageMetrics->printMe();}183 } -
branches/eam_branches/ipp-20111122/ippMonitor/czartool/czarpoll.pl
r32213 r32851 37 37 38 38 39 my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist", "pub"); 40 39 my @stages = ( 40 "burntool", 41 "chip", 42 "cam", 43 "fake", 44 "warp", 45 "stack", 46 "diff", 47 "magic", 48 "magicDS", 49 "dist", 50 "pub"); 51 52 my @ippToPspsStages = ( 53 "processed", 54 "loaded_to_datastore", 55 "loaded_to_ODM", 56 "merge_worthy", 57 "deleted_datastore", 58 "deleted_dxlayer", 59 "merged", 60 "deleted_local"); 61 62 my @allStages = (@stages, @ippToPspsStages); 41 63 42 64 timePoll($period); … … 244 266 print "* Generating plots\n"; 245 267 268 # get ippToPsps labels 269 my $ippToPspsLabels = undef; 270 $czarDb->getCurrentIppToPspsLabels($begin, $end, \$ippToPspsLabels); 271 $plotter->setIppToPspsMode(); 272 273 # create ippToPsps labels 274 foreach $stage (@ippToPspsStages) { 275 foreach $row ( @{$ippToPspsLabels} ) { 276 my ($label) = @{$row}; 277 278 chomp($label); 279 $plotter->createTimeSeries($label, $stage, $begin, $end, 1, 0, 1); 280 } 281 } 282 283 # create plots for each label for all stages for ippToPsps 284 foreach $row ( @{$ippToPspsLabels} ) { 285 my ($label) = @{$row}; 286 287 $plotter->createTimeSeries($label, undef, $begin, $end, 1, 1, 1); 288 } 289 290 246 291 # create plots for each label for each stage 292 $plotter->setStandardMode(); 247 293 foreach $stage (@stages) { 248 294 foreach $row ( @{$rows} ) { -
branches/eam_branches/ipp-20111122/ippMonitor/czartool/czartool/CzarDb.pm
r32735 r32851 8 8 use File::Temp; 9 9 10 my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist", "pub"); # TODO put elsewhere 10 my @stages = ( 11 "burntool", 12 "chip", 13 "cam", 14 "fake", 15 "warp", 16 "stack", 17 "diff", 18 "magic", 19 "magicDS", 20 "dist", 21 "pub"); # TODO put elsewhere 22 23 my @ippToPspsStages = ( 24 "processed", 25 "loaded_to_datastore", 26 "loaded_to_ODM", 27 "merge_worthy", 28 "deleted_datastore", 29 "deleted_dxlayer", 30 "merged", 31 "deleted_local"); 32 33 my @allStages = (@stages, @ippToPspsStages); 11 34 12 35 use base 'czartool::MySQLDb'; … … 33 56 ########################################################################### 34 57 # 35 # Gets current_labels table 58 # Gets current ippToPsps labels 59 # 60 ########################################################################### 61 sub getCurrentIppToPspsLabels { 62 my ($self, $begin, $end, $labels) = @_; 63 64 my $query = $self->{_db}->prepare(<<SQL); 65 66 SELECT DISTINCT label 67 FROM processed 68 WHERE timestamp >= '$begin' 69 AND timestamp <= '$end' 70 SQL 71 72 if (!$query->execute) {return 0;} 73 74 ${$labels} = $query->fetchall_arrayref(); 75 76 return 1; 77 } 78 79 ########################################################################### 80 # 81 # Gets current labels from the current_labels table 36 82 # 37 83 ########################################################################### … … 672 718 # times 673 719 $timeSep = $self->diffTimesInSecs($thisTimestamp, $lastTimestamp); 720 if ($timeSep == 0) {$timeSep = 1;}; # HACK to prevent divide-by-zero 721 674 722 $middleTime = $self->getMiddleTime($lastTimestamp, $thisTimestamp); 675 723 $formattedMiddleTimestamp = $self->getFormattedDate($middleTime); … … 681 729 # added, and store value to subtract from linear value below. If > 1000 682 730 # processed per hour, then it must be wrong 683 if (($thisProcessed - $lastProcessed)/( ($timeSep/3600)+1) > 1000) {731 if (($thisProcessed - $lastProcessed)/($timeSep/3600) > 1000) { 684 732 $positiveJump = $thisProcessed - $lastProcessed; 685 733 } … … 701 749 702 750 # calculate first derivative in units of images per hour 703 $derivPending = $diffPending/($timeSep/3600 +1);704 $derivFaults = $diffFaults/($timeSep/3600 +1);705 $derivProcessed = $diffProcessed/($timeSep/3600 +1);751 $derivPending = $diffPending/($timeSep/3600); 752 $derivFaults = $diffFaults/($timeSep/3600); 753 $derivProcessed = $diffProcessed/($timeSep/3600); 706 754 707 755 } … … 1107 1155 my $stage = undef; 1108 1156 $totalDeleted = 0; 1109 foreach $stage (@ stages) {1157 foreach $stage (@allStages) { 1110 1158 1111 1159 if (!$self->getLabelsInThisTimePeriod($stage, $fromTime, $toTime, \$labels)) {next;} … … 1213 1261 1214 1262 my $stage = undef; 1215 foreach $stage (@ stages) {1263 foreach $stage (@allStages) { 1216 1264 1217 1265 $self->optimizeTable($stage); -
branches/eam_branches/ipp-20111122/ippMonitor/czartool/czartool/Pantasks.pm
r32102 r32851 10 10 "addstarlap", 11 11 "cleanup", 12 "deepstack", 12 13 "detrend", 13 14 "distribution", -
branches/eam_branches/ipp-20111122/ippMonitor/czartool/czartool/Plotter.pm
r32093 r32851 10 10 use czartool::Config; 11 11 12 my @allStages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist", "pub"); 12 my @allStages = ( 13 "burntool", 14 "chip", 15 "cam", 16 "fake", 17 "warp", 18 "stack", 19 "diff", 20 "magic", 21 "magicDS", 22 "dist", 23 "pub"); 24 25 my @allIppToPspsStages = ( 26 "processed", 27 "loaded_to_datastore", 28 "loaded_to_ODM", 29 "merge_worthy", 30 "deleted_datastore", 31 "deleted_dxlayer", 32 "merged", 33 "deleted_local"); 34 13 35 14 36 ########################################################################### … … 75 97 ########################################################################### 76 98 # 99 # Sets plotter to use standard IPP mode, i.e. chip, cam etc 100 # 101 ########################################################################### 102 sub setStandardMode { 103 my ($self) = @_; 104 105 $self->{allStages} = \@allStages; 106 } 107 108 ########################################################################### 109 # 110 # Sets plotter to use ippToPsps mode, i.e. processed, loaded_to_datastore etc 111 # 112 ########################################################################### 113 sub setIppToPspsMode { 114 my ($self) = @_; 115 116 $self->{allStages} = \@allIppToPspsStages; 117 } 118 119 ########################################################################### 120 # 77 121 # Some initialisation code common to all constructors 78 122 # … … 83 127 $self->{_gpc1Db} = $self->{_config}->getGpc1Instance(); 84 128 $self->{_czarDb} = $self->{_config}->getCzarDbInstance(); 129 $self->setStandardMode(); 85 130 } 86 131 … … 140 185 my $stages = undef; 141 186 if (!$selectedStage) { 142 $stages = \@ allStages;187 $stages = \@{$self->{allStages}}; 143 188 $selectedStage = 'all_stages'; 144 189 } … … 203 248 "set style histogram rowstacked;" . 204 249 "set style fill solid border -1;" . 205 "set ylabel \" Exposures processed per $interval\";" .250 "set ylabel \"Items processed per $interval\";" . 206 251 "set boxwidth 0.75;" . 207 252 "plot "; 208 253 209 254 my $first = 1; 210 foreach my $stage (@ allStages) {255 foreach my $stage (@{$self->{allStages}}) { 211 256 212 257 … … 226 271 ########################################################################### 227 272 # 228 # Plots a time series for all stagesfor this label273 # Plots a time series for all or one stage for this label 229 274 # 230 275 ########################################################################### … … 238 283 my $stages = undef; 239 284 240 if (!$selectedStage) {$stages = \@ allStages;}285 if (!$selectedStage) {$stages = \@{$self->{allStages}};} 241 286 else {$stages = ["$selectedStage"]}; 242 287 … … 297 342 $timeDiff, 298 343 "", 299 " Exposures");344 "Items"); 300 345 } 301 346 … … 314 359 $timeDiff, 315 360 "", 316 "Log( Exposures)");361 "Log(Items)"); 317 362 } 318 363 … … 331 376 $timeDiff, 332 377 "", 333 " Exposures per hour");378 "Items per hour"); 334 379 } 335 380 } … … 351 396 my $stage = undef; 352 397 my $pendingMinusFaults = undef; 353 foreach $stage (@ allStages) {398 foreach $stage (@{$self->{allStages}}) { 354 399 355 400 if (!$self->{_czarDb}->countProcessedPendingAndFaults( … … 381 426 "set style histogram rowstacked;" . 382 427 "set style fill solid border -1;" . 383 "set ylabel \" Exposures\";" .428 "set ylabel \"Items\";" . 384 429 "set boxwidth 0.75;" . 385 430 "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" . … … 520 565 my $firstIn = 1; 521 566 # loop through stages array so that they are ordered properly (not maintained in hash) 522 foreach my $stage (@allStages) { 567 #foreach my $stage (@allStages) { 568 foreach my $stage (@{$self->{allStages}}) { 523 569 524 570 if(!$gnuplotFiles->{$stage}) {next;} … … 620 666 "set title \"Nebulous disk use across IPP cluster ($totalPercent of total allocated)\";" . 621 667 "set style fill solid 1.00 border -1;" . 668 "set key center top;" . 622 669 "set style histogram rowstacked;" . 623 670 "set style data histograms;" . -
branches/eam_branches/ipp-20111122/ippMonitor/raw/czartool_labels.php
r32644 r32851 27 27 menu($myMenu, 'Czartool on '.$lastUpdateTime, 'ipp.css', $ID['link'], $ID['proj']); 28 28 29 $states=array("full","new","drop","wait"); 30 $stages=array("burntool", "chip","cam","fake","warp","stack","diff","magic","magicDS","dist", "pub"); 29 $stages=array( 30 "burntool", 31 "chip", 32 "cam", 33 "fake", 34 "warp", 35 "stack", 36 "diff", 37 "magic", 38 "magicDS", 39 "dist", 40 "pub"); 41 31 42 $servers=array( 32 43 "addstar", … … 150 161 echo "<br>"; 151 162 echo $table; 152 #"<table width=\"$width\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n"; 163 153 164 createTableTitle("Status and links", 3); 154 165 echo "<tr>\n"; … … 180 191 $pubLabels, 181 192 $stages, 182 $states,183 193 "new", 184 194 $selectedLabel, … … 349 359 $pubLabels, 350 360 $stages, 351 $states,352 361 $selectedState, 353 362 $selectedLabel, $selectedStage, $plotType) { -
branches/eam_branches/ipp-20111122/ippMonitor/raw/ipp.imfiles.dat
r29481 r32851 21 21 menutop | menutop | link | simple plot - chip (to remove?) | simplePlot.php 22 22 menutop | menutop | link | simple plot - cam (to remove?) | simplePlotcam.php 23 menutop | menutop | link | czartool | czartool_labels.php 23 menutop | menutop | link | czartool - standard | czartool_labels.php 24 menutop | menutop | link | czartool - ipptopsps | czartool_ipptopsps.php 24 25 menutop | menutop | link | mask stats | maskStats.php 25 26 -
branches/eam_branches/ipp-20111122/ippScripts/scripts/addstar_run.pl
r31377 r32851 37 37 } 38 38 my $minidvodb_path; 39 my ( $add_id, $camera, $stage, $ outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update,39 my ( $add_id, $camera, $stage, $multi_num, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update, 40 40 $no_op, $redirect, $save_temps); 41 41 GetOptions( … … 43 43 'camera|c=s' => \$camera, # Camera 44 44 'stage|s=s' => \$stage, # Camera 45 45 'multi_num|w=s' => \$multi_num, # the number for a staticskymulti (for finding cmf) 46 46 'dbname|d=s' => \$dbname, # Database name 47 47 'outroot|w=s' => \$outroot, # output file base name … … 114 114 115 115 } 116 117 if ($stage =~/staticsky_multi/) { 118 $fpaObjects =~ s/smf$/cmf/; #this should do nothing because it was already modded above 119 &my_die( "can't find the filter_num for staticsky_multi, giving up.", $add_id, $PS_EXIT_SYS_ERROR) unless (defined $multi_num); 120 my $nice_num = sprintf ("%03d", $multi_num); 121 $fpaObjects =~ s/cmf$/$nice_num.cmf/; #this make it look for .001.cmf, etc 122 123 } 124 116 125 my $traceDest = $ipprc->filename("TRACE.EXP", $outroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR); 117 126 … … 190 199 $command .= " -use-name $fpaObjects"; # DVO wants the neb-name as a file reference 191 200 $command .= " -image" if $image_only; 192 if ($stage = ~/staticsky/) {201 if ($stage =~ /staticsky/) { 193 202 $command .= " -accept-astrom "; 194 } 203 } #careful here - this matches staticsky and staticsky_multi 195 204 my $mjd_addstar_start = DateTime->now->mjd; # MJD of starting script 196 205 -
branches/eam_branches/ipp-20111122/ippScripts/scripts/ipp_apply_burntool_single.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20111122/ippScripts/scripts/ipp_filename.pl
r18087 r32851 10 10 #print "$ENV{'PATH'}\n"; 11 11 #print "$ENV{'PERL5LIB'}\n"; 12 13 # CZW: This is a horrible hack, but I don't want to have to debug all of ippMonitor to figure out why it's not working. 14 unless (defined($ENV{'NEB_SERVER'})) { 15 $ENV{'NEB_SERVER'} = 'http://nebserver.ipp.ifa.hawaii.edu:80/nebulous'; 16 } 17 12 18 13 19 use PS::IPP::Config; -
branches/eam_branches/ipp-20111122/ippScripts/scripts/magic_destreak.pl
r32650 r32851 254 254 if ($skycell->{data_state} eq "full" and $skycell->{quality} == 0) { 255 255 $skycell_uri = $ipprc->filename("PPSUB.OUTPUT", $skycell->{path_base}); 256 my $skycell_id = $skycell->{skycell_id}; 256 257 $diff_skycells{$skycell_id} = $skycell_uri; 257 258 } else { -
branches/eam_branches/ipp-20111122/ippScripts/scripts/register_exp.pl
r32379 r32851 121 121 my ($data_group,$dist_group,$chip_workdir,$reduction); 122 122 ($label,$data_group,$dist_group,$end_stage, 123 $tess_id,$chip_workdir,$reduction) = advance_decisions(&value_for_flag($cmdflags,"-dateobs"), 123 $tess_id,$chip_workdir,$reduction) = advance_decisions(&value_for_flag($cmdflags,"-exp_name"), 124 &value_for_flag($cmdflags,"-dateobs"), 124 125 &value_for_flag($cmdflags,"-exp_type"), 125 126 &value_for_flag($cmdflags,"-obs_mode"), … … 170 171 ### Pau. 171 172 sub advance_decisions { 173 my $exp_name = shift; 172 174 my $dateobs = shift; 173 175 my $exptype = shift; … … 178 180 179 181 # The strings come pre-quoted. 182 $exp_name =~ s/\'//g; 180 183 $dateobs =~ s/\'//g; 181 184 $exptype =~ s/\'//g; … … 188 191 my $target; 189 192 193 if ($exp_name =~ /^c/) { 194 print "Skipping because this is a camera commanded exposure: $exp_name\n"; 195 return(undef,undef,undef,"reg",undef,undef,undef); 196 } 197 190 198 if ($exptype ne 'OBJECT') { 191 199 print "Skipping because exptype doesn't claim to be OBJECT: $exptype\n"; -
branches/eam_branches/ipp-20111122/ippScripts/scripts/videophot_process.pl
r32749 r32851 32 32 my $listvideocells = can_run('listvideocells.pl') or (warn "Can't find listvideocells.pl" and $missing_tools = 1); 33 33 my $dsreg = can_run('dsreg') or (warn "Can't find dsreg" and $missing_tools = 1); 34 my $nebrepair = can_run('neb-repair') or (warn "Can't find neb-repair" and $missing_tools = 1); 34 35 if ($missing_tools) { 35 36 warn("Can't find required tools."); … … 116 117 run(command => $command, verbose => $verbose); 117 118 unless ($success) { 119 check_input_file($uri, $vp_id, $class_id, 'nocell'); 118 120 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 119 121 &my_die("Unable to perform $command: $error_code", $vp_id, $error_code); … … 244 246 exit 0; 245 247 248 sub check_input_file { 249 my $uri = shift; 250 my $vp_id = shift; 251 my $class_id = shift; 252 my $cell_id = shift; 253 my $resolved = $ipprc->file_resolve($uri); 254 255 my $tryrepair = 0; 256 if (!-e $resolved) { 257 printf STDERR "instance $resolved for $uri does not exist\n"; 258 $tryrepair = 1; 259 } elsif (-s $resolved == 0) { 260 printf STDERR "instance $resolved for $uri is empty\n"; 261 $tryrepair = 1; 262 } 263 if ($tryrepair) { 264 my $scheme = file_scheme($uri); 265 if ($scheme and ($scheme = 'neb')) { 266 my $command = "$nebrepair $uri"; 267 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 268 run(command => $command, verbose => $verbose); 269 unless ($success) { 270 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 271 my $err_message = "Unable to perform nebrepair"; 272 &my_die("$err_message: $error_code", $vp_id, $error_code); 273 } 274 } 275 } 276 } 277 246 278 sub my_die 247 279 { -
branches/eam_branches/ipp-20111122/ippScripts/scripts/whichimage
r31710 r32851 60 60 61 61 my $sign = 1; 62 if ($h < 0) {62 if ($h =~ /-/) { 63 63 $sign = -1; 64 64 $h = - $h; … … 76 76 77 77 my $sign = 1; 78 if ($d < 0) {78 if ($d =~ /-/) { 79 79 $sign = -1; 80 80 $d = - $d; -
branches/eam_branches/ipp-20111122/ippTasks/addstar.pro
r31376 r32851 26 26 active true 27 27 end 28 task addstar.exp.load.staticsky_multi 29 active true 30 end 28 31 task addstar.exp.run 29 32 active true … … 39 42 end 40 43 task addstar.exp.load.staticsky 44 active false 45 end 46 task addstar.exp.load.staticsky_multi 41 47 active false 42 48 end … … 175 181 end 176 182 end 183 177 184 task addstar.exp.load.staticsky 178 185 host local … … 229 236 end 230 237 end 238 239 task addstar.exp.load.staticsky_multi 240 host local 241 242 periods -poll $LOADPOLL 243 periods -exec $LOADEXEC 244 periods -timeout 30 245 npending 1 246 247 stdout NULL 248 stderr $LOGDIR/addstar.exp.log 249 250 task.exec 251 # if ($LABEL:n == 0) break 252 $run = addtool -pendingexp -stage staticsky_multi 253 if ($DB:n == 0) 254 option DEFAULT 255 else 256 # save the DB name for the exit tasks 257 option $DB:$addstar_DB 258 $run = $run -dbname $DB:$addstar_DB 259 $addstar_DB ++ 260 if ($addstar_DB >= $DB:n) set addstar_DB = 0 261 end 262 add_poll_args run 263 add_poll_labels run 264 command $run 265 end 266 267 # success 268 task.exit 0 269 # convert 'stdout' to book format 270 ipptool2book stdout addPendingExp -key add_id -uniq -setword dbname $options:0 -setword pantaskState INIT 271 if ($VERBOSE > 2) 272 book listbook addPendingExp 273 end 274 275 # delete existing entries in the appropriate pantaskStates 276 process_cleanup addPendingExp 277 end 278 279 # default exit status 280 task.exit default 281 showcommand failure 282 end 283 284 task.exit crash 285 showcommand crash 286 end 287 288 # operation times out? 289 task.exit timeout 290 showcommand timeout 291 end 292 end 293 294 231 295 # run the addstar script on pending exposures 232 296 task addstar.exp.run … … 252 316 book getword addPendingExp $pageName exp_tag -var EXP_TAG 253 317 book getword addPendingExp $pageName add_id -var ADD_ID 318 book getword addPendingExp $pageName stage_extra1 -var STAGE_EXTRA1 254 319 book getword addPendingExp $pageName stageroot -var STAGEROOT 255 320 book getword addPendingExp $pageName stage -var STAGE … … 285 350 sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID 286 351 end 352 if ("$STAGE" == "staticsky_multi") 353 sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID 354 end 287 355 if ("$STAGE" == "stack") 288 356 sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID … … 296 364 if ("$REDUCTION" != "NULL") 297 365 $run = $run --reduction $REDUCTION 366 end 367 if ("$STAGE" == "staticsky_multi") 368 $run = $run --multi_num $STAGE_EXTRA1 298 369 end 299 370 if ("$IMAGE_ONLY" == "T") -
branches/eam_branches/ipp-20111122/ippTasks/survey.pro
r32680 r32851 33 33 book create SURVEY_WARP_BG 34 34 book create SURVEY_PUBLISH 35 book create SURVEY_STATICSKYSINGLE 35 book create SURVEY_STATICSKYSINGLE 36 36 $haveSurveyBooks = TRUE 37 37 end … … 48 48 $SURVEY_PUBLISH_DB = 0 49 49 $SURVEY_STATICSKYSINGLE_DB = 0 50 51 50 $SURVEY_EXEC = 120 52 51 $SURVEY_POLL = 10 … … 839 838 $run = $run -uncensored 840 839 end 840 if ("$stage" == "staticsky_multi") 841 #only queue uncensored staticsky (multi filter) 842 $run = $run -uncensored 843 end 844 841 845 if ("$stage" == "stack") 842 846 #only queue uncensored stacks -
branches/eam_branches/ipp-20111122/ippTools/share/Makefile.am
r32703 r32851 10 10 addtool_find_sky_id_dvo.sql \ 11 11 addtool_find_sky_id.sql \ 12 addtool_find_sky_id_multi_dvo.sql \ 13 addtool_find_sky_id_multi.sql \ 12 14 addtool_find_stack_id_dvo.sql \ 13 15 addtool_find_stack_id.sql \ … … 16 18 addtool_find_pendingexp_stack.sql \ 17 19 addtool_find_pendingexp_staticsky.sql \ 20 addtool_find_pendingexp_staticsky_multi.sql \ 18 21 addtool_find_pendingmergeprocess.sql \ 19 22 addtool_find_processedexp_cam.sql \ 20 23 addtool_find_processedexp_stack.sql \ 21 24 addtool_find_processedexp_staticsky.sql \ 25 addtool_find_processedexp_staticsky_multi.sql \ 22 26 addtool_find_minidvodbprocessed.sql \ 23 27 addtool_find_minidvodbrun.sql \ … … 27 31 addtool_queue_stack_id.sql \ 28 32 addtool_queue_sky_id.sql \ 33 addtool_queue_sky_id_multi.sql \ 29 34 addtool_queue_minidvodbrun.sql \ 30 35 addtool_revertminidvodbprocessed.sql \ … … 32 37 addtool_revertprocessedexp_stack.sql \ 33 38 addtool_revertprocessedexp_staticsky.sql \ 39 addtool_revertprocessedexp_staticsky_multi.sql \ 34 40 bgtool_advancechip.sql \ 35 41 bgtool_advancewarp.sql \ … … 308 314 pstamptool_getdependent.sql \ 309 315 pstamptool_listjob.sql \ 316 pstamptool_listfile.sql \ 310 317 pstamptool_pendingcleanup.sql \ 311 318 pstamptool_pendingdependent.sql \ -
branches/eam_branches/ipp-20111122/ippTools/share/addtool_queue_cam_id.sql
r31375 r32851 4 4 'cam', -- stage 5 5 cam_id, -- stage_id 6 %d, -- stage_extra1 6 7 '%s', -- state 7 8 '%s', -- workdir -
branches/eam_branches/ipp-20111122/ippTools/share/addtool_queue_sky_id.sql
r31375 r32851 4 4 'staticsky', -- stage 5 5 sky_id, -- stage_id 6 %d, -- stage_extra1 6 7 '%s', -- state 7 8 '%s', -- workdir -
branches/eam_branches/ipp-20111122/ippTools/share/addtool_queue_stack_id.sql
r31375 r32851 4 4 'stack', -- stage 5 5 stack_id, -- stage_id 6 %d, --stage_extra1 6 7 '%s', -- state 7 8 '%s', -- workdir -
branches/eam_branches/ipp-20111122/ippTools/share/camtool_find_pendingimfile.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20111122/ippTools/share/disttool_listinterests.sql
r26266 r32851 9 9 stage, 10 10 clean, 11 target_id, 11 12 distTarget.state as target_state 12 13 FROM rcInterest -
branches/eam_branches/ipp-20111122/ippTools/share/magicdstool_getskycells.sql
r27518 r32851 5 5 diffSkyfile.skycell_id, 6 6 diffSkyfile.path_base, 7 diffSkyfile.data_state 7 diffSkyfile.data_state, 8 diffSkyfile.quality 8 9 FROM magicDSRun 9 10 JOIN magicRun USING(magic_id) … … 37 38 diffSkyfile.skycell_id, 38 39 diffSkyfile.path_base, 39 diffSkyfile.data_state 40 diffSkyfile.data_state, 41 diffSkyfile.quality 40 42 FROM magicDSRun 41 43 JOIN magicRun USING(magic_id) -
branches/eam_branches/ipp-20111122/ippTools/share/pxadmin_create_tables.sql
- Property svn:mergeinfo changed
/trunk/ippTools/share/pxadmin_create_tables.sql (added) merged: 32771
r32695 r32851 1479 1479 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1480 1480 1481 CREATE TABLE pstampFile ( 1482 file_id BIGINT AUTO_INCREMENT, 1483 job_id BIGINT NOT NULL, 1484 path VARCHAR(255), 1485 PRIMARY KEY(file_id), 1486 KEY(job_id) 1487 ) ENGINE=innodb DEFAULT CHARSET=latin1; 1488 1481 1489 CREATE TABLE pstampWebRequest ( 1482 1490 num BIGINT AUTO_INCREMENT, - Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20111122/ippTools/src
- Property svn:mergeinfo changed
/trunk/ippTools/src (added) merged: 32764,32770-32771,32786,32832-32833
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20111122/ippTools/src/addtool.c
r32711 r32851 143 143 pxAddLabelSearchArgs (config, where, "-filter", "stackRun.filter", "=="); // define using camRun label 144 144 } 145 145 if (strcmp(stage, "staticsky_multi")== 0) { 146 147 pxAddLabelSearchArgs (config, where, "-label", "staticskyRun.label", "=="); // define using camRun label 148 pxAddLabelSearchArgs (config, where, "-data_group","staticskyRun.data_group", "=="); // define using camRun label 149 PXOPT_COPY_STR(config->args, where, "-reduction", "staticskyyRun.reduction", "=="); 150 //no filter here 151 } 146 152 if (!psListLength(where->list)) { 147 153 psFree(where); … … 237 243 } 238 244 239 245 if (strcmp(stage,"staticsky_multi") == 0) { 246 if (dvodb ) { 247 psTrace("addtool.c", PS_LOG_INFO, "dvodb argument found (%s) using addtool_find_sky_id_multi_dvo.sql\n%s\n", dvodb,stage); 248 // find the cam_id of all the exposures that we want to queue up. 249 bare_query = pxDataGet("addtool_find_sky_id_multi_dvo.sql"); 250 // user supplied dvodb 251 psStringAppend(&dvodb_string, "addRun.dvodb = '%s'", dvodb); 252 } else { 253 psTrace("addtool.c", PS_LOG_INFO, "dvodb argument not found using addtool_find_sky_id_multi.sql\n%s\n",stage); 254 // find the cam_id of all the exposures that we want to queue up. 255 bare_query = pxDataGet("addtool_find_sky_id_multi.sql"); 256 // inherit dvodb from camRun, avoid matching NULL 257 psStringAppend(&dvodb_string, "(staticskyRun.dvodb IS NOT NULL AND previous_dvodb = staticskyRun.dvodb)"); 258 } 259 } 240 260 241 261 if (!bare_query) { … … 292 312 psStringAppend(&query, " GROUP BY stack_id"); 293 313 } 294 314 if (strcmp(stage,"staticsky_multi") == 0) { 315 psStringAppend(&query, " GROUP BY sky_id"); //some reason it needs this 316 } 295 317 296 318 … … 405 427 } 406 428 } 429 if (strcmp(stage,"staticsky_multi") == 0) { 430 for (long i = 0; i < psArrayLength(output); i++) { 431 psMetadata *md = output->data[i]; 432 bool status = false; 433 psS32 num_inputs = psMetadataLookupS32(&status, md, "num_inputs"); 434 if (!status) { 435 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item num_inputs"); 436 return false; 437 } 438 if (num_inputs < 0) { 439 psError(PS_ERR_UNKNOWN, true, "invalid value for num_inputs"); 440 return false; 441 } 442 443 staticskyRunRow *row = staticskyRunObjectFromMetadata(md); 444 445 if (!row) { 446 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into camRun"); 447 psFree(output); 448 return false; 449 } 450 451 if (!dvodb) { //there's no staticsky.dvodb 452 psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined dvodb: label: %s, sky_id %" PRId64, row->label, row->sky_id); 453 psFree(output); 454 return false; 455 } 456 if (!workdir && !row->workdir) { 457 psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined workdir: label: %s, sky_id %" PRId64, row->label, row->sky_id); 458 psFree(output); 459 return false; 460 } 461 462 psFree(row); 463 } 464 } 465 466 467 407 468 408 469 // start a transaction so we don't end up with an exp without any associted … … 438 499 stage, 439 500 stage_id, 501 0, 440 502 workdir ? workdir : row->workdir, 441 503 reduction ? reduction : row->reduction, … … 479 541 stage, 480 542 stage_id, 543 0, 481 544 workdir ? workdir : row->workdir, 482 545 reduction ? reduction : row->reduction, … … 520 583 stage, 521 584 stage_id, 585 0, 522 586 workdir ? workdir : row->workdir, 523 587 reduction ? reduction : row->reduction, … … 544 608 } 545 609 610 if (strcmp(stage,"staticsky_multi") == 0) { 611 for (long i = 0; i < psArrayLength(output); i++) { 612 psMetadata *md = output->data[i]; 613 psS64 stage_id =0; 614 bool status = false; 615 psS32 num_inputs = psMetadataLookupS32(&status, md, "num_inputs"); 616 if (!status) { 617 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item num_inputs"); 618 return false; 619 } 620 staticskyRunRow *row = staticskyRunObjectFromMetadata(md); 621 stage_id = row->sky_id; 622 623 if (!row) { 624 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into camRun"); 625 psFree(output); 626 return false; 627 } 628 629 // queue the exp 630 for (int filter_id = 0; filter_id < num_inputs; filter_id++) { 631 if (!pxaddQueueByCamID(config, 632 stage, 633 stage_id, 634 filter_id, 635 workdir ? workdir : row->workdir, 636 reduction ? reduction : row->reduction, 637 label ? label : row->label, 638 data_group ? data_group : (row->data_group ? row->data_group : (label ? label : row->label)), 639 dvodb ? dvodb : NULL, 640 note ? note : NULL, 641 image_only, 642 minidvodb, 643 minidvodb_group, 644 minidvodb_name 645 )) { 646 if (!psDBRollback(config->dbh)) { 647 psError(PS_ERR_UNKNOWN, false, "database error sfg"); 648 } 649 psError(PS_ERR_UNKNOWN, false, 650 "failed to trying to queue stage %s %" PRId64,stage, stage_id); 651 psFree(row); 652 psFree(output); 653 return false; 654 } 655 } 656 psFree(row); 657 } 658 } 659 660 661 662 546 663 psFree(output); 547 664 … … 585 702 } 586 703 if (strcmp(stage, "staticsky")==0) { 704 query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id"); 705 } 706 if (strcmp(stage, "staticsky_multi")==0) { 587 707 query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id"); 588 708 } … … 626 746 query = pxDataGet("addtool_find_pendingexp_staticsky.sql"); 627 747 } 628 748 if (strcmp(stage, "staticsky_multi")==0) { 749 query = pxDataGet("addtool_find_pendingexp_staticsky_multi.sql"); 750 } 751 629 752 630 753 if (!query) { … … 648 771 psStringAppend(&query, " GROUP BY %s", "sky_id"); 649 772 } 650 773 if (strcmp(stage, "staticsky_multi") == 0) { 774 //this group by is needed to join against all the warps (to get camera) 775 psStringAppend(&query, " GROUP BY %s", "sky_id, stage_extra1"); 776 } 651 777 // treat limit == 0 as "no limit" 652 778 if (limit) { … … 838 964 query = pxDataGet("addtool_find_processedexp_staticsky.sql"); 839 965 } 966 if (strcmp (stage,"staticsky_multi") == 0) { 967 query = pxDataGet("addtool_find_processedexp_staticsky_multi.sql"); 968 } 969 840 970 841 971 if (!query) { … … 948 1078 query = pxDataGet("addtool_revertprocessedexp_staticsky.sql"); 949 1079 } 1080 if (strcmp(stage, "staticsky_multi") == 0) { 1081 query = pxDataGet("addtool_revertprocessedexp_staticsky_multi.sql"); 1082 } 1083 1084 1085 950 1086 if (!query) { 951 1087 // rollback -
branches/eam_branches/ipp-20111122/ippTools/src/disttool.c
r32696 r32851 419 419 } 420 420 421 if (!strcmp(stage, "sky") && single) { 422 psStringAppend(&query, "\nGROUP BY sky_id HAVING count(stack_id) = 1"); 421 if (!strcmp(stage, "sky")) { 422 if (single) { 423 psStringAppend(&query, "\nGROUP BY sky_id HAVING count(stack_id) = 1"); 424 } else { 425 psStringAppend(&query, "\nGROUP BY sky_id HAVING count(stack_id) > 1"); 426 } 423 427 } 424 428 -
branches/eam_branches/ipp-20111122/ippTools/src/flatcorr.c
r31375 r32851 666 666 "cam", 667 667 row->cam_id, 668 0, 668 669 row->workdir, 669 670 row->reduction, -
branches/eam_branches/ipp-20111122/ippTools/src/magictool.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20111122/ippTools/src/pstamptool.c
r32360 r32851 56 56 static bool revertdependentMode(pxConfig *config); 57 57 static bool getwebrequestnumMode(pxConfig *config); 58 static bool addfileMode(pxConfig *config); 59 static bool listfileMode(pxConfig *config); 60 static bool deletefileMode(pxConfig *config); 58 61 59 62 # define MODECASE(caseName, func) \ … … 103 106 MODECASE(PSTAMPTOOL_MODE_REVERTDEPENDENT, revertdependentMode); 104 107 MODECASE(PSTAMPTOOL_MODE_GETWEBREQUESTNUM, getwebrequestnumMode); 108 MODECASE(PSTAMPTOOL_MODE_ADDFILE, addfileMode); 109 MODECASE(PSTAMPTOOL_MODE_LISTFILE, listfileMode); 110 MODECASE(PSTAMPTOOL_MODE_DELETEFILE, deletefileMode); 105 111 default: 106 112 psAbort("invalid option (this should not happen)"); … … 1476 1482 return true; 1477 1483 } 1484 1485 static bool addfileMode(pxConfig *config) 1486 { 1487 PS_ASSERT_PTR_NON_NULL(config, false); 1488 1489 PXOPT_LOOKUP_S64(job_id, config->args, "-job_id", true, false); 1490 PXOPT_LOOKUP_STR(path, config->args, "-path", true, false); 1491 1492 if (!pstampFileInsert(config->dbh, 1493 0, // file_id 1494 job_id, 1495 path 1496 )) { 1497 psError(PS_ERR_UNKNOWN, false, "database error"); 1498 return false; 1499 } 1500 1501 psU64 affected = psDBAffectedRows(config->dbh); 1502 if (affected != 1) { 1503 psError(PS_ERR_UNKNOWN, false, 1504 "should have affected one row but %" PRIu64 " rows were modified", 1505 affected); 1506 return false; 1507 } 1508 1509 psS64 file_id = psDBLastInsertID(config->dbh); 1510 printf("%" PRId64 "\n", file_id); 1511 1512 return true; 1513 } 1514 1515 static bool listfileMode(pxConfig *config) 1516 { 1517 PS_ASSERT_PTR_NON_NULL(config, false); 1518 1519 psMetadata *where = psMetadataAlloc(); 1520 PXOPT_COPY_S64(config->args, where, "-job_id", "job_id", "=="); 1521 PXOPT_COPY_S64(config->args, where, "-req_id", "req_id", "=="); 1522 PXOPT_COPY_S64(config->args, where, "-file_id", "file_id", "=="); 1523 1524 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 1525 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 1526 1527 if (!psListLength(where->list)) { 1528 fprintf(stderr, "search arguments are required\n"); 1529 exit (1); 1530 } 1531 1532 psString query = pxDataGet("pstamptool_listfile.sql"); 1533 if (!query) { 1534 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 1535 return false; 1536 } 1537 1538 // use psDBGenerateWhereSQL because the SQL yields an intermediate table 1539 if (psListLength(where->list)) { 1540 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1541 psStringAppend(&query, " WHERE %s", whereClause); 1542 psFree(whereClause); 1543 } 1544 psFree(where); 1545 1546 // treat limit == 0 as "no limit" 1547 if (limit) { 1548 psString limitString = psDBGenerateLimitSQL(limit); 1549 psStringAppend(&query, " %s", limitString); 1550 psFree(limitString); 1551 } 1552 1553 if (!p_psDBRunQuery(config->dbh, query)) { 1554 psError(PS_ERR_UNKNOWN, false, "database error"); 1555 psFree(query); 1556 return false; 1557 } 1558 psFree(query); 1559 1560 psArray *output = p_psDBFetchResult(config->dbh); 1561 if (!output) { 1562 psError(PS_ERR_UNKNOWN, false, "database error"); 1563 return false; 1564 } 1565 if (!psArrayLength(output)) { 1566 psTrace("pstamptool", PS_LOG_INFO, "no rows found"); 1567 psFree(output); 1568 return true; 1569 } 1570 1571 // negative simple so the default is true 1572 if (!ippdbPrintMetadatas(stdout, output, "pstampFile", !simple)) { 1573 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 1574 psFree(output); 1575 return false; 1576 } 1577 1578 psFree(output); 1579 1580 return true; 1581 } 1582 1583 static bool deletefileMode(pxConfig *config) 1584 { 1585 PS_ASSERT_PTR_NON_NULL(config, false); 1586 1587 PXOPT_LOOKUP_S64(job_id, config->args, "-job_id", true, false); 1588 1589 psString query = NULL; 1590 psStringAppend(&query, "DELETE FROM pstampFile WHERE job_id = %" PRId64, job_id); 1591 1592 if (!p_psDBRunQuery(config->dbh, query)) { 1593 psError(PS_ERR_UNKNOWN, false, "database error"); 1594 psFree(query); 1595 return false; 1596 } 1597 psFree(query); 1598 1599 psU64 affected = psDBAffectedRows(config->dbh); 1600 psLogMsg("pstamptool", PS_LOG_INFO, "Deleted %" PRIu64 " rows from pstampFile", affected); 1601 1602 return true; 1603 } -
branches/eam_branches/ipp-20111122/ippTools/src/pstamptool.h
r29248 r32851 50 50 PSTAMPTOOL_MODE_REVERTDEPENDENT, 51 51 PSTAMPTOOL_MODE_GETWEBREQUESTNUM, 52 PSTAMPTOOL_MODE_ADDFILE, 53 PSTAMPTOOL_MODE_LISTFILE, 54 PSTAMPTOOL_MODE_DELETEFILE, 52 55 } pstamptoolMode; 53 56 -
branches/eam_branches/ipp-20111122/ippTools/src/pstamptoolConfig.c
r30543 r32851 274 274 psMetadata *modes = psMetadataAlloc(); 275 275 276 // -addfile 277 psMetadata *addfileArgs = psMetadataAlloc(); 278 psMetadataAddS64(addfileArgs, PS_LIST_TAIL, "-job_id", 0, "define job ID for file (required)", 0); 279 psMetadataAddStr(addfileArgs, PS_LIST_TAIL, "-path", 0, "define path for file (required)", NULL); 280 281 // -listfile 282 psMetadata *listfileArgs = psMetadataAlloc(); 283 psMetadataAddS64(listfileArgs, PS_LIST_TAIL, "-file_id", 0, "select by file ID", 0); 284 psMetadataAddS64(listfileArgs, PS_LIST_TAIL, "-job_id", 0, "select by job ID", 0); 285 psMetadataAddS64(listfileArgs, PS_LIST_TAIL, "-req_id", 0, "select by request ID", 0); 286 psMetadataAddU64(listfileArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 287 psMetadataAddBool(listfileArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 288 289 // -deletefile 290 psMetadata *deletefileArgs = psMetadataAlloc(); 291 psMetadataAddS64(deletefileArgs, PS_LIST_TAIL, "-job_id", 0, "select by job ID (required)", 0); 292 276 293 PXOPT_ADD_MODE("-addreq", "", PSTAMPTOOL_MODE_ADDREQ, addreqArgs); 277 294 PXOPT_ADD_MODE("-pendingreq", "", PSTAMPTOOL_MODE_PENDINGREQ, pendingreqArgs); … … 302 319 PXOPT_ADD_MODE("-project", "", PSTAMPTOOL_MODE_PROJECT, projectArgs); 303 320 PXOPT_ADD_MODE("-getwebrequestnum","", PSTAMPTOOL_MODE_GETWEBREQUESTNUM, getwebrequestnumArgs); 321 PXOPT_ADD_MODE("-addfile", "", PSTAMPTOOL_MODE_ADDFILE, addfileArgs); 322 PXOPT_ADD_MODE("-listfile", "", PSTAMPTOOL_MODE_LISTFILE, listfileArgs); 323 PXOPT_ADD_MODE("-deletefile", "", PSTAMPTOOL_MODE_DELETEFILE, deletefileArgs); 304 324 305 325 if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) { -
branches/eam_branches/ipp-20111122/ippTools/src/pxadd.c
r31375 r32851 131 131 char *stage, 132 132 psS64 stage_id, 133 psS32 stage_extra1, 133 134 char *workdir, 134 135 char *reduction, … … 159 160 psMemSetPersistent(query, true); 160 161 } 162 if (strcmp(stage,"staticsky_multi") == 0) { 163 query = pxDataGet("addtool_queue_sky_id_multi.sql"); 164 psMemSetPersistent(query, true); 165 } 161 166 if (!query) { 162 167 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); … … 170 175 // on 32/64 171 176 if (!p_psDBRunQueryF(config->dbh, query, 177 stage_extra1 ? stage_extra1 : 0, 172 178 "new", // state 173 179 workdir ? workdir : "NULL", -
branches/eam_branches/ipp-20111122/ippTools/src/pxadd.h
r31375 r32851 33 33 char *stage, 34 34 psS64 stage_id, 35 psS32 stage_extra1, 35 36 char *workdir, 36 37 char *reduction, -
branches/eam_branches/ipp-20111122/ippTools/src/vptool.c
r32750 r32851 178 178 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", false, false); 179 179 180 psMetadata *where = psMetadataAlloc();181 pxchipGetSearchArgs (config, where); // rawExp only182 pxAddLabelSearchArgs (config, where, "-label", "newExp.label", "LIKE"); // define using newExp label183 184 if (!psListLength(where->list)) {185 psFree(where);186 psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required");187 return false;188 }189 180 190 181 PXOPT_LOOKUP_STR(label, config->args, "-set_label", true, false); … … 195 186 196 187 // default 197 PXOPT_LOOKUP_BOOL( unique, config->args, "-unique", false);188 PXOPT_LOOKUP_BOOL(rerun, config->args, "-rerun", false); 198 189 PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false); 199 190 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 191 192 psMetadata *where = psMetadataAlloc(); 193 pxchipGetSearchArgs (config, where); // rawExp only 194 pxAddLabelSearchArgs (config, where, "-label", "newExp.label", "="); // define using newExp label 195 196 if (!psListLength(where->list)) { 197 psFree(where); 198 psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required"); 199 return false; 200 } 200 201 201 202 // find the exp_id of all the exposures that we want to queue up. … … 213 214 psFree(where); 214 215 215 if ( unique) {216 psStringAppend(&query, " AND vp_id IS NULL");216 if (!rerun) { 217 psStringAppend(&query, "\n AND vp_id IS NULL\n AND (vpRun.label = '%s' OR vpRun.label IS NULL)", label); 217 218 } 218 219 -
branches/eam_branches/ipp-20111122/ippTools/src/vptoolConfig.c
r32511 r32851 50 50 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by newExp label (LIKE comparison)", NULL); 51 51 52 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_label", 0, "define label ", NULL);52 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_label", 0, "define label (required)", NULL); 53 53 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_data_group", 0, "define data group", NULL); 54 54 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_workdir", 0, "define workdir (required)", NULL); … … 56 56 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-set_dest_id", 0, "define destination", 0); 57 57 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-pretend", 0, "do not actually modify the database", false); 58 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "- unique", 0, "only queue exposures that have no previous vpRun", false);58 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-rerun", 0, "queue exposures even if a previous vpRun exists", false); 59 59 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 60 60 // -pendingrun
Note:
See TracChangeset
for help on using the changeset viewer.
