IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37242


Ignore:
Timestamp:
Aug 12, 2014, 3:55:38 PM (12 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20140717
Files:
2 deleted
31 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140717/ippMonitor/czartool/czartool/Plotter.pm

    r35742 r37242  
    671671        "set ylabel \"Space (TB)\";" .
    672672        "set xtic rotate by -90 scale 0;" .
     673        "set yrange [:100];" .
    673674        "plot '".$tmpFile->filename."' " .
    674675        "using 2:xtic(1) t \"Used\" lt 7," .
     
    715716        "set style data histograms;" .
    716717        "set ylabel \"Space (TB)\";" .
     718        "set yrange [:100];" .
    717719        "set xtic rotate by -90 scale 0;" .
    718720        "plot '".$tmpFile->filename."' " .
  • branches/eam_branches/ipp-20140717/ippScripts/Build.PL

    r37053 r37242  
    143143        scripts/sc_remote_exec.pl
    144144        scripts/sc_transfer_tool.pl
    145         scripts/sc_validate_files.pl
    146         scripts/sc_validate_processing.pl
    147145    )],
    148146    dist_abstract => 'Scripts for running the Pan-STARRS IPP',
  • branches/eam_branches/ipp-20140717/ippScripts/MANIFEST

    r36950 r37242  
    5656scripts/sc_remote_exec.pl
    5757scripts/sc_transfer_tool.pl
    58 scripts/sc_validate_files.pl
    59 scripts/sc_validate_processing.pl
    6058t/00_distribution.t
  • branches/eam_branches/ipp-20140717/ippScripts/scripts/dist_defineruns.pl

    r36669 r37242  
    9090    push @stages, $stage;
    9191} else {
    92     @stages = qw(chip chip_bg camera fake warp warp_bg diff stack SSdiff sky skysingle ff);
     92    @stages = qw(chip chip_bg camera fake warp warp_bg diff stack SSdiff sky skysingle skycal ff);
    9393}
    9494
  • branches/eam_branches/ipp-20140717/ippScripts/scripts/lap_science.pl

    r37073 r37242  
    3434my $qstack_threshold     = 0.05; # Only make a quickstack if more than 5% of the exposures require it.
    3535my $minimum_stack_inputs = 2;    # We can avoid magicking stack inputs if we have more than this number.
    36 my $do_updates_pv2       = 1;    # Do updates using the calls needed for PV2. 
     36my $maximum_stack_inputs = 25;   # This is the place-holder guess on how big a stack we should process locally
     37my $do_updates_pv2       = 0;    # Do updates using the calls needed for PV2. 
    3738
    3839GetOptions(
     
    189190    $chip_cmd .= " -set_label $exposure->{label} -set_data_group $data_group ";
    190191    $chip_cmd .= " -set_workdir $workdir -set_dist_group $exposure->{dist_group} ";
    191 #    $chip_cmd .= " -set_reduction LAP_SCIENCE ";
    192     $chip_cmd .= " -set_reduction LAP_POLE ";
     192    $chip_cmd .= " -set_reduction LAP_SCIENCE ";
     193#    $chip_cmd .= " -set_reduction LAP_POLE ";
    193194
    194195    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    10371038    my $data_group = "${label}.${proj_cell}.final.${lap_id}";
    10381039
     1040
     1041    ##
     1042    ## Queue the "shallow" stacks that will run at los alamos.
    10391043    my $command = "$stacktool ";
    10401044    $command .= " -pretend " if defined $debug;
     
    10431047#    $command .= " -select_label $label "; # Removed to allow exposure sharing to work
    10441048    $command .= " -set_label ${label} -set_workdir $workdir -set_data_group $data_group ";
    1045     $command .= " -min_num ${minimum_stack_inputs} -set_reduction THREEPI_STACK_1DG -set_dist_group $exposure->{dist_group} ";
     1049    $command .= " -min_num ${minimum_stack_inputs} -max_num ${maximum_stack_inputs} -set_reduction THREEPI_STACK_1DG -set_dist_group $exposure->{dist_group} ";
    10461050    $command .= " $warps ";
    10471051
     
    10541058    my $stacks_made = $mdcParser->parse_list(join "", @$stdout_buf) or
    10551059        &my_die("unable to parse metadata from stacktool -definebyquery", $lap_id, "");   
    1056    
     1060
     1061    ##
     1062    ## Queue the "deep" stacks that will run locally.
     1063    my $deep_minimum = $maximum_stack_inputs + 1;
     1064    $command = "$stacktool ";
     1065    $command .= " -pretend " if defined $debug;
     1066    $command .= " -dbname $dbname " if defined $dbname;
     1067    $command .= " -definebyquery -select_skycell_id ${proj_cell}.% -select_filter $filter ";
     1068#    $command .= " -select_label $label "; # Removed to allow exposure sharing to work
     1069    $command .= " -set_label ${label}.local -set_workdir $workdir -set_data_group $data_group ";
     1070    $command .= " -min_num ${deep_minimum} -set_reduction THREEPI_STACK_1DG -set_dist_group $exposure->{dist_group} ";
     1071    $command .= " $warps ";
     1072
     1073    ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     1074        run(command => $command, verbose => $verbose);
     1075    unless ($success) {
     1076        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     1077        &my_die("Unable to perform stacktool -definebyquery: $error_code", $lap_id);
     1078    }
     1079    $stacks_made .= $mdcParser->parse_list(join "", @$stdout_buf) or
     1080        &my_die("unable to parse metadata from stacktool -definebyquery", $lap_id, "");   
     1081
     1082
     1083    ## Determine the sass_id so we can record it in the database.
    10571084    $command = "$stacktool ";
    10581085    $command .= " -dbname $dbname " if defined $dbname;
     
    14161443
    14171444    my @clean_modes = (
    1418         'chiptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -set_label goto_cleaned -label @LABEL@ -chip_id @CHIP_ID@',
     1445#       'chiptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -set_label goto_cleaned -label @LABEL@ -chip_id @CHIP_ID@',
    14191446#       'warptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -set_label goto_cleaned -label @LABEL@ -warp_id @WARP_ID@',
    14201447        'difftool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -set_label goto_cleaned -label @LABEL@ -diff_id @DIFF_ID@',
  • branches/eam_branches/ipp-20140717/ippScripts/scripts/permcheck.pl

    r36702 r37242  
    5151my %backup_hosts = ('ippb00' => 1, 'ippb01' => 1,
    5252                    'ippb02' => 1, 'ippb03' => 1,
    53                     'ippb04' => 1, 'ippb05' => 1
     53                    'ippb04' => 1, 'ippb05' => 1,
     54                    'ippb06' => 1
    5455    );
    55 my %backup_destinations = ('ippb04' => 1,
    56                            'ippb05' => 1);
     56my %backup_destinations = (#'ippb04' => 1,
     57                           #'ippb05' => 1,
     58                           'ippb06' => 1
     59);
    5760my $backup_Nvols = 3;
    5861
     
    111114}
    112115
    113 my %components = ('camera' => ['PSASTRO.OUTPUT'],
     116my %components = ('camera' => ['PSASTRO.OUTPUT','PSASTRO.OUTPUT.MASK'],
    114117                  'stack'  => ['PPSTACK.UNCONV.COMP','PPSTACK.UNCONV.MASK.COMP','PPSTACK.UNCONV.VARIANCE.COMP',
    115118                               'PPSTACK.UNCONV.EXP','PPSTACK.UNCONV.EXPNUM','PPSTACK.UNCONV.EXPWT.COMP'],
     
    122125    my $hostname = $entry->{hostname};
    123126    foreach my $product (@{ $components{$stage} }) {
    124         my $key = $ipprc->filename($product,$path_base);
    125 
     127        my @keys = ();
     128        if (($stage eq 'camera')&&($product eq 'PSASTRO.OUTPUT.MASK')) {
     129            my @otas = ('XY01','XY02','XY03','XY04','XY05','XY06',
     130                        'XY10','XY11','XY12','XY13','XY14','XY15','XY16','XY17',
     131                        'XY20','XY21','XY22','XY23','XY24','XY25','XY26','XY27',
     132                        'XY30','XY31','XY32','XY33','XY34','XY35','XY36','XY37',
     133                        'XY40','XY41','XY42','XY43','XY44','XY45','XY46','XY47',
     134                        'XY50','XY51','XY52','XY53','XY54','XY55','XY56','XY57',
     135                        'XY60','XY61','XY62','XY63','XY64','XY65','XY66','XY67',
     136                        'XY71','XY72','XY73','XY74','XY75','XY76');
     137            foreach my $ota (@otas) {
     138                push @keys, $ipprc->filename($product,$path_base,$ota);
     139            }       
     140        }
     141        else {
     142            push @keys, $ipprc->filename($product,$path_base);
     143        }
    126144# Do validation
    127 
    128         # neb-stat level handling
    129         my $stat = $neb->stat($key);
    130         die "nebulous key: $key not found" unless $stat;   
    131         my $instances = $neb->find_instances($key, 'any');
    132         die "no instances found" unless $instances;   
    133145       
    134         my $user_copies;
    135         eval {
    136             $user_copies = $neb->getxattr($key, "user.copies");
    137         };
    138         unless(defined($user_copies)) {
    139             $user_copies = 1;
    140         }
    141 
    142         my $md5sum;
    143         my @validation;
    144         my %md5sum_uniq;
    145         my $existing_copies = 0;
    146        
    147         my @existance;
    148         my @md5sums;
    149         my @diskfiles = map {URI->new($_)->file if $_} @$instances;
    150         my @diskvols;
    151         my @diskhosts;
    152         my @quality;
    153         my $Ngood = 0;
    154         my $quality_mask = 0;
    155        
    156         for (my $i = 0; $i <= $#diskfiles; $i++) {
    157             if (-e $diskfiles[$i]) {
    158                 $existance[$i] = 1;
    159                 $existing_copies++;
    160                 $md5sums[$i] = local_md5sum($diskfiles[$i]);
    161                 $md5sum_uniq{$md5sums[$i]} = 1;
    162             }
    163             else {
    164                 $existance[$i] = 0;
    165                 $md5sums[$i] = 'NON-EXISTANT';
    166                 $md5sum_uniq{$md5sums[$i]} = 1;
    167             }
    168             ($diskhosts[$i],$diskvols[$i]) = parse_volume($diskfiles[$i]);
    169             $validation[$i] = sprintf("% 3d %32s %s %s %d",
    170                                       $existance[$i],
    171                                       $md5sums[$i],
    172                                       $diskfiles[$i],
    173                                       $diskhosts[$i],$diskvols[$i]
    174             );
    175            
    176             # Pre-parse decisions
    177             if ($existance[$i] == 0) {
    178                 $quality[$i] = 0;
    179             }
    180             elsif (is_backup_volume($diskhosts[$i])) {
    181                 $quality[$i] = 1;
    182                 $quality_mask = $quality_mask | 1;
    183                 $Ngood++;
    184             }
    185             else {
    186                 $quality[$i] = 2;
    187                 $Ngood++;
    188             }
    189         }
    190         if (scalar(keys(%md5sum_uniq)) != 1) { #unlike the raw data, we don't know the truth.
    191             die "There are multiple md5sum values for $key";
    192         }
    193         $md5sum = (keys(%md5sum_uniq))[0];
    194 
    195         print "\n$key $data_state $md5sum $hostname\n";
    196         if (1) {
    197            
    198             print
    199                 "object id:             ", @$stat[0], "\n",
    200                 "key:                   ", @$stat[1], "\n";
    201             print
    202                 "epoch:                 ", @$stat[4], "\n";
    203             print
    204                 "md5sum count:          ", scalar(keys %md5sum_uniq), "\n";
    205             print
    206                 "requested instances:   ", $user_copies, "\n",
    207                 "available instances:   ", @$stat[6], "\n",
    208                 "existing instances:    ", $existing_copies, "\n",
    209                 "total instances:       ", @$stat[7], "\n",
    210                 "instance location:\n", " " x 4;
    211             print
    212                 join("\n" . " " x 4, @validation), "\n";
    213         }
    214 
    215         # Decide what to do
    216         if ($Ngood == 0) {
    217             # DO something to attempt to fix this.
    218             my $deneb_key = $key; $deneb_key =~ s/.*?gpc/gpc/;
    219            
    220             open(DD,"/home/panstarrs/ipp/local/bin/deneb-locate.py $deneb_key 2> /dev/null |");
    221             my $good_file = '';
    222             while (<DD>) {
    223                 $_ =~ s/^\s+//;
    224                 my ($z,undef,$ff) = split /\s+/;
    225                 if (($ff)&&(-e $ff)) {
    226                     my $md_response = `md5sum $ff`;
    227                     if ($md_response =~ /$md5sum/) {
    228                         $good_file = (split /\s+/,$md_response)[1];
    229                     }
    230                 }
    231             }
    232             close(DD);
    233             if ($good_file eq '') {
    234                 die "No valid instance of key: $key";
    235             }
    236             else {
    237                 $quality[0] = 1;
    238                 print "cp $good_file $diskfiles[0]\n";
    239                 system("cp $good_file $diskfiles[0]");
    240             }
    241             # Begin my best validation thought
    242             {
    243                 my $tmpmd5 = local_md5sum($diskfiles[0]);
    244                 if ($tmpmd5 ne $md5sum) {
    245                     die "Post-replication md5sum does not match! $tmpmd5 != $md5sum";
    246                 }
    247             }
    248             # End my best validation thought.
    249            
    250             $Ngood = 1;  # We now hand off this single valid instance object to be handled by the Ngood=1 case.
    251         }
    252    
    253         if ($quality[0] == 0) { # The first instance is bad.
    254             # But since we're here, and not up there, there must be at least one good copy.  Find it.
    255             for (my $i = 0; $i <= $#md5sums; $i++) {
    256                 if ($md5sums[$i] eq $md5sum) { # Found it.
    257                     print "cp $diskfiles[$i] $diskfiles[0]\n";
    258                     system("cp $diskfiles[$i] $diskfiles[0]");
    259                     # Begin my best validation thought
    260                     {
    261                         my $tmpmd5 = local_md5sum($diskfiles[0]);
     146        foreach my $key (@keys) {
     147            # neb-stat level handling
     148            my $stat = $neb->stat($key);
     149            die "nebulous key: $key not found" unless $stat;   
     150            my $instances = $neb->find_instances($key, 'any');
     151            die "no instances found" unless $instances;   
     152           
     153            my $user_copies;
     154            eval {
     155                $user_copies = $neb->getxattr($key, "user.copies");
     156            };
     157            unless(defined($user_copies)) {
     158                $user_copies = 1;
     159            }
     160           
     161            my $md5sum;
     162            my @validation;
     163            my %md5sum_uniq;
     164            my $existing_copies = 0;
     165           
     166            my @existance;
     167            my @md5sums;
     168            my @diskfiles = map {URI->new($_)->file if $_} @$instances;
     169            my @diskvols;
     170            my @diskhosts;
     171            my @quality;
     172            my $Ngood = 0;
     173            my $quality_mask = 0;
     174           
     175            for (my $i = 0; $i <= $#diskfiles; $i++) {
     176                if (-e $diskfiles[$i]) {
     177                    $existance[$i] = 1;
     178                    $existing_copies++;
     179                    $md5sums[$i] = local_md5sum($diskfiles[$i]);
     180                    $md5sum_uniq{$md5sums[$i]} = 1;
     181                }
     182                else {
     183                    $existance[$i] = 0;
     184                    $md5sums[$i] = 'NON-EXISTANT';
     185                    $md5sum_uniq{$md5sums[$i]} = 1;
     186                }
     187                ($diskhosts[$i],$diskvols[$i]) = parse_volume($diskfiles[$i]);
     188                $validation[$i] = sprintf("% 3d %32s %s %s %d",
     189                                          $existance[$i],
     190                                          $md5sums[$i],
     191                                          $diskfiles[$i],
     192                                          $diskhosts[$i],$diskvols[$i]
     193                    );
     194               
     195                # Pre-parse decisions
     196                if ($existance[$i] == 0) {
     197                    $quality[$i] = 0;
     198                }
     199                elsif (is_backup_volume($diskhosts[$i])) {
     200                    $quality[$i] = 1;
     201                    $quality_mask = $quality_mask | 1;
     202                    $Ngood++;
     203                }
     204                else {
     205                    $quality[$i] = 2;
     206                    $Ngood++;
     207                }
     208            }
     209            if (scalar(keys(%md5sum_uniq)) != 1) { #unlike the raw data, we don't know the truth.
     210                die "There are multiple md5sum values for $key";
     211            }
     212            $md5sum = (keys(%md5sum_uniq))[0];
     213           
     214            print "\n$key $data_state $md5sum $hostname\n";
     215            if (1) {
     216               
     217                print
     218                    "object id:             ", @$stat[0], "\n",
     219                    "key:                   ", @$stat[1], "\n";
     220                print
     221                    "epoch:                 ", @$stat[4], "\n";
     222                print
     223                    "md5sum count:          ", scalar(keys %md5sum_uniq), "\n";
     224                print
     225                    "requested instances:   ", $user_copies, "\n",
     226                    "available instances:   ", @$stat[6], "\n",
     227                    "existing instances:    ", $existing_copies, "\n",
     228                    "total instances:       ", @$stat[7], "\n",
     229                    "instance location:\n", " " x 4;
     230                print
     231                    join("\n" . " " x 4, @validation), "\n";
     232            }
     233           
     234            # Decide what to do
     235            if ($Ngood == 0) {
     236                # DO something to attempt to fix this.
     237                my $deneb_key = $key; $deneb_key =~ s/.*?gpc/gpc/;
     238               
     239                open(DD,"/home/panstarrs/ipp/local/bin/deneb-locate.py $deneb_key 2> /dev/null |");
     240                my $good_file = '';
     241                while (<DD>) {
     242                    $_ =~ s/^\s+//;
     243                    my ($z,undef,$ff) = split /\s+/;
     244                    if (($ff)&&(-e $ff)) {
     245                        my $md_response = `md5sum $ff`;
     246                        if ($md_response =~ /$md5sum/) {
     247                            $good_file = (split /\s+/,$md_response)[1];
     248                        }
     249                    }
     250                }
     251                close(DD);
     252                if ($good_file eq '') {
     253                    die "No valid instance of key: $key";
     254                }
     255                else {
     256                    $quality[0] = 1;
     257                    print "cp $good_file $diskfiles[0]\n";
     258                    system("cp $good_file $diskfiles[0]");
     259                }
     260                # Begin my best validation thought
     261                {
     262                    my $tmpmd5 = local_md5sum($diskfiles[0]);
     263                    if ($tmpmd5 ne $md5sum) {
     264                        die "Post-replication md5sum does not match! $tmpmd5 != $md5sum";
     265                    }
     266                }
     267                # End my best validation thought.
     268               
     269                $Ngood = 1;  # We now hand off this single valid instance object to be handled by the Ngood=1 case.
     270            }
     271           
     272            if ($quality[0] == 0) { # The first instance is bad.
     273                # But since we're here, and not up there, there must be at least one good copy.  Find it.
     274                for (my $i = 0; $i <= $#md5sums; $i++) {
     275                    if ($md5sums[$i] eq $md5sum) { # Found it.
     276                        print "cp $diskfiles[$i] $diskfiles[0]\n";
     277                        system("cp $diskfiles[$i] $diskfiles[0]");
     278                        # Begin my best validation thought
     279                        {
     280                            my $tmpmd5 = local_md5sum($diskfiles[0]);
     281                            if ($tmpmd5 ne $md5sum) {
     282                                die "Post-replication md5sum does not match! $tmpmd5 != $md5sum";
     283                            }
     284                        }
     285                        # End my best validation thought.
     286                        last; # We're done here now.
     287                    }
     288                }       
     289            }
     290           
     291            if ($Ngood == 1) { # We have only one version
     292                if ($quality_mask & 1) { # ANd it's on a backup volume
     293                    print "neb-replicate $key\n";
     294                    if ($do_ops) {
     295                        $neb->replicate($key) or die "failed to replicate the single valid copy";
     296                        if ($@) { die $@; }
     297                    }
     298                }
     299                else { # And it's not, so put one there
     300                    my $rep_vol = get_random_backup_volume();
     301                    print "neb-replicate --volume $rep_vol  $key\n";
     302                    if ($do_ops) {
     303                        $neb->replicate($key,$rep_vol) or die "failed to replicate the single valid copy to the backup node";
     304                        if ($@) { die $@; }
     305                       
     306                        # Begin my best validation thought
     307                        system("sync") == 0 or die "Couldn't sync?";
     308                        my $uris = $neb->find_instances($key,$rep_vol);
     309                        @$uris = map {URI->new($_)->file if $_} @$uris;
     310                        my $tmpmd5 = local_md5sum(${ $uris }[0]);
    262311                        if ($tmpmd5 ne $md5sum) {
    263312                            die "Post-replication md5sum does not match! $tmpmd5 != $md5sum";
    264313                        }
    265                     }
    266                     # End my best validation thought.
    267                     last; # We're done here now.
    268                 }
    269             }   
    270         }
    271        
    272         if ($Ngood == 1) { # We have only one version
    273             if ($quality_mask & 1) { # ANd it's on a backup volume
    274                 print "neb-replicate $key\n";
    275                 if ($do_ops) {
    276                     $neb->replicate($key) or die "failed to replicate the single valid copy";
    277                     if ($@) { die $@; }
    278                 }
    279             }
    280             else { # And it's not, so put one there
    281                 my $rep_vol = get_random_backup_volume();
    282                 print "neb-replicate --volume $rep_vol  $key\n";
    283                 if ($do_ops) {
    284                     $neb->replicate($key,$rep_vol) or die "failed to replicate the single valid copy to the backup node";
    285                     if ($@) { die $@; }
    286                    
    287                     # Begin my best validation thought
    288                     system("sync") == 0 or die "Couldn't sync?";
    289                     my $uris = $neb->find_instances($key,$rep_vol);
    290                     @$uris = map {URI->new($_)->file if $_} @$uris;
    291                     my $tmpmd5 = local_md5sum(${ $uris }[0]);
    292                     if ($tmpmd5 ne $md5sum) {
    293                         die "Post-replication md5sum does not match! $tmpmd5 != $md5sum";
    294                     }
    295                     # End my best validation thought.
    296                 }           
    297             }
    298         }
    299         else { # N >= 2
    300             if (!($quality_mask & 1)) { # no backup copy
    301                 my $rep_vol = get_random_backup_volume();
    302                 print "neb-replicate --volume $rep_vol  $key\n";
    303                 if ($do_ops) {
    304                     $neb->replicate($key,$rep_vol) or die "failed to replicate a copy to the backup node";
    305                     if ($@) { die $@; }
    306                    
    307                     # Begin my best validation thought
    308                     system("sync") == 0 or die "Couldn't sync?";
    309                     my $uris = $neb->find_instances($key,$rep_vol);
    310                     @$uris = map {URI->new($_)->file if $_} @$uris;
    311                     my $tmpmd5 = local_md5sum(${ $uris }[0]);
    312                     if ($tmpmd5 ne $md5sum) {
    313                         die "Post-replication md5sum does not match! $tmpmd5 != $md5sum";
    314                     }
    315                     # End my best validation thought.
    316                 }           
    317             }
    318             if (!($quality_mask & 2)) { # no copy on the requested host, so select the first as valid.
     314                        # End my best validation thought.
     315                    }       
     316                }
     317            }
     318            else { # N >= 2
     319                if (!($quality_mask & 1)) { # no backup copy
     320                    my $rep_vol = get_random_backup_volume();
     321                    print "neb-replicate --volume $rep_vol  $key\n";
     322                    if ($do_ops) {
     323                        $neb->replicate($key,$rep_vol) or die "failed to replicate a copy to the backup node";
     324                        if ($@) { die $@; }
     325                       
     326                        # Begin my best validation thought
     327                        system("sync") == 0 or die "Couldn't sync?";
     328                        my $uris = $neb->find_instances($key,$rep_vol);
     329                        @$uris = map {URI->new($_)->file if $_} @$uris;
     330                        my $tmpmd5 = local_md5sum(${ $uris }[0]);
     331                        if ($tmpmd5 ne $md5sum) {
     332                            die "Post-replication md5sum does not match! $tmpmd5 != $md5sum";
     333                        }
     334                        # End my best validation thought.
     335                    }       
     336                }
     337                if (!($quality_mask & 2)) { # no copy on the requested host, so select the first as valid.
     338                    for (my $i = 0; $i <= $#diskfiles; $i++) {
     339                        if ($quality[$i] == 2) {
     340                            $quality[$i] = 1;
     341                            last;
     342                        }
     343                    }
     344                }
    319345                for (my $i = 0; $i <= $#diskfiles; $i++) {
    320                     if ($quality[$i] == 2) {
    321                         $quality[$i] = 1;
    322                         last;
    323                     }
    324                 }
    325             }
    326             for (my $i = 0; $i <= $#diskfiles; $i++) {
    327346#           print "$existance[$i] $quality[$i] $md5sums[$i] $md5sum $diskhosts[$i] $diskvols[$i]\n";
    328                 if ($quality[$i] != 1) {
    329                     if ($existance[$i] == 0) { # This disk file doesn't exist.
    330                         system("touch $diskfiles[$i]");
    331                     }
    332                     my $cull_vol = $diskhosts[$i] . "." . $diskvols[$i];
    333                     print "neb-cull --volume $cull_vol $key\n";
    334                     if ($do_ops) {
    335                         # The tilde here is to force hard volumes.  Don't touch it.
    336                         $neb->cull($key,"~${cull_vol}",2) or die "failed to cull a superfluous instance";
    337                         if ($@) { die "$@"; }
    338                     }
    339                 }
    340             }
    341         }
     347                    if ($quality[$i] != 1) {
     348                        if ($existance[$i] == 0) { # This disk file doesn't exist.
     349                            system("touch $diskfiles[$i]");
     350                        }
     351                        my $cull_vol = $diskhosts[$i] . "." . $diskvols[$i];
     352                        print "neb-cull --volume $cull_vol $key\n";
     353                        if ($do_ops) {
     354                            # The tilde here is to force hard volumes.  Don't touch it.
     355                            $neb->cull($key,"~${cull_vol}",2) or die "failed to cull a superfluous instance";
     356                            if ($@) { die "$@"; }
     357                        }
     358                    }
     359                }
     360            }
     361        } # end keys for this product
    342362    } # end product for this entry
    343363} # end entry for this id
  • branches/eam_branches/ipp-20140717/ippScripts/scripts/queuestaticsky.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140717/ippScripts/scripts/sc_prepare_camera.pl

    r36966 r37242  
    1818
    1919# Hard coded values
    20 my $remote_root   = '/scratch3/watersc1/';  # Far side destination base location
     20# my $remote_root   = '/scratch3/watersc1/';  # Far side destination base location
     21my $remote_root   = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location
     22$remote_root = '/scratch3/watersc1/';
    2123my $threads       = 2;                      # How many threads are we going to use?
    2224my $job_cost      = 1700 / 60 / 60;         # Estimate of how long a job runs, in hours.
     
    2729my $max_time      = 8;                      # longest allocation to ask for
    2830my $remote_hostname= "LANL/Mustang";         # Name of the remote node.
    29 my @return_component_list = ("DBINFO.EXP", "PSASTRO.CONFIG", "PSASTRO.OUTPUT", "LOG.EXP","TRACE.EXP", "PSASTRO.STATS");
     31my @return_component_list = ("DBINFO.EXP", "PSASTRO.CONFIG", "PSASTRO.OUTPUT", "LOG.EXP", "PSASTRO.STATS");
    3032# Look for programs we need
    3133my $missing_tools;
     
    186188    $psastro_command   .= " -recipe PSASTRO $recipe_psastro ";
    187189    $psastro_command   .= " -tracedest ${remote_outroot}.trace -log ${remote_outroot}.log ";
    188     $psastro_command   .= " -dumpconfig ${remote_outroot}.mdc -stats ${remote_outroot}.stats ";
     190    $psastro_command   .= " -dumpconfig ${remote_outroot}.psastro.mdc -stats ${remote_outroot}.stats ";
    189191    $psastro_command   .= " -recipe PPSTATS CAMSTATS ";
    190192   
     
    202204        my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename);
    203205        my $remote_outroot_dir = dirname($ipp_disk);
    204         print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} ";
     206        print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk ";
    205207    }
    206208    foreach my $chipInfo (@{ $inpData2 }) {
     
    208210        my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename);
    209211        my $remote_outroot_dir = dirname($ipp_disk);
    210         print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} ";
     212        print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk ";
    211213    }
    212214    print CONFIG "\n";
     
    239241    $node_req = int(($node_need * $job_cost) / ($fill_factor * $time_req)) + 1;
    240242}
     243$time_req += 1; # Safety addition.
    241244
    242245open(COMMAND,  ">$disk_command") || &my_die("Couldn't open file? $disk_command",$remote_id,$PS_EXIT_SYS_ERROR);
  • branches/eam_branches/ipp-20140717/ippScripts/scripts/sc_prepare_chip.pl

    r36966 r37242  
    1818
    1919# Hard coded values
    20 my $remote_root   = '/scratch3/watersc1/';  # Far side destination base location
     20# my $remote_root   = '/scratch3/watersc1/';  # Far side destination base location
     21my $remote_root   = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location
     22$remote_root = '/scratch3/watersc1/';
    2123my $remote_raw    = "${remote_root}/raw/";  # Directory to find raw data in.
    2224my $threads       = 2;                      # How many threads are we going to use?
     
    152154#print Dumper(%detrends);
    153155
    154 my @return_component_list = ("DBINFO.IMFILE","PPIMAGE.STATS","LOG.IMFILE","TRACE.IMFILE","PPIMAGE.BACKMDL","PPIMAGE.PATTERN");
     156my @return_component_list = ("DBINFO.IMFILE","PPIMAGE.STATS","LOG.IMFILE","PPIMAGE.BACKMDL","PPIMAGE.PATTERN");
    155157
    156158#
     
    348350            my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename );
    349351            my $remote_outroot_dir = dirname($ipp_disk);
    350             print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} ";
     352            print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk ";
    351353#           print "  $filename $ipp_disk $remote_disk\n";
    352354#           die;
     
    405407    $node_req = int(($node_need * $job_cost) / ($fill_factor * $time_req)) + 1;
    406408}
     409$time_req += 1; # Safety addition.
    407410
    408411open(COMMAND,  ">$disk_command") || &my_die("Couldn't open file? $disk_command",$chip_id,$PS_EXIT_SYS_ERROR);
  • branches/eam_branches/ipp-20140717/ippScripts/scripts/sc_prepare_stack.pl

    r36966 r37242  
    1818
    1919# Hard coded values
    20 my $remote_root   = '/scratch3/watersc1/';  # Far side destination base location
     20#my $remote_root   = '/scratch3/watersc1/';  # Far side destination base location
     21my $remote_root   = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location
     22$remote_root = '/scratch3/watersc1/';
    2123my $threads       = 2;                      # How many threads are we going to use?
    2224my $job_cost      = 1500 / 60 / 60;           # Estimate of how long a job runs, in hours.
     
    2931my @return_component_list = ("DBINFO.EXP", "PPSTACK.UNCONV","PPSTACK.UNCONV.MASK","PPSTACK.UNCONV.VARIANCE",
    3032                             "PPSTACK.UNCONV.EXP","PPSTACK.UNCONV.EXPWT","PPSTACK.UNCONV.EXPNUM","PSPHOT.OUTPUT",
    31                              "LOG.EXP","TRACE.EXP", "PSASTRO.STATS",
    32                              "PPSTACK.CONFIG","PPSTACK.TARGET.PSF");
     33                             "LOG.EXP", "PSASTRO.STATS",
     34                             "PPSTACK.CONFIG","PPSTACK.TARGET.PSF","PSPHOT.STACK.PSF.SAVE");
    3335#,"PPSTACK.CONV.KERNEL");
    3436# Look for programs we need
     
    147149    # This actually returns all the individual stack/skyfiles that comprise this run.  Because consistency.
    148150    my $command = "$stacktool -inputskyfile -stack_id $stack_id ";
    149 
     151    $command .= " -dbname $dbname " if defined($dbname);
    150152    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    151153        run(command => $command, verbose => 0);
     
    208210        my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename);
    209211        my $remote_outroot_dir = dirname($ipp_disk);
    210         print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} ";
     212        print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk ";
    211213    }
    212214
  • branches/eam_branches/ipp-20140717/ippScripts/scripts/sc_prepare_warp.pl

    r36966 r37242  
    1818
    1919# Hard coded values
    20 my $remote_root   = '/scratch3/watersc1/';  # Far side destination base location
     20# my $remote_root   = '/scratch3/watersc1/'; 
     21my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/'; # Far side destination base location
     22$remote_root = '/scratch3/watersc1/';
    2123my $threads       = 2;                      # How many threads are we going to use?
    22 my $job_cost      = 70 / 60 / 60;           # Estimate of how long a job runs, in hours.
     24my $job_cost      = 110 / 60 / 60;          # Estimate of how long a job runs, in hours.
    2325my $proc_per_node = 24;                     # processors per node
    2426my $min_nodes     = 1;                      # smallest allocation to ask for
     
    2729my $max_time      = 8;                      # longest allocation to ask for
    2830my $remote_hostname= "LANL/Mustang";         # Name of the remote node.
    29 my @return_component_list = ("DBINFO.EXP", "PSWARP.CONFIG", "PSWARP.OUTPUT", "PSWARP.OUTPUT.MASK", "PSWARP.OUTPUT.VARIANCE", "PSWARP.OUTPUT.SOURCES","PSPHOT.PSF.SAVE","LOG.EXP","TRACE.EXP");
     31my @return_component_list = ("DBINFO.EXP", "PSWARP.CONFIG", "PSWARP.OUTPUT", "PSWARP.OUTPUT.MASK", "PSWARP.OUTPUT.VARIANCE", "PSWARP.OUTPUT.SOURCES","PSPHOT.PSF.SKY.SAVE","LOG.EXP");
    3032# Look for programs we need
    3133my $missing_tools;
     
    202204        $pswarp_command    .= " -threads 4 "; # -image_id ${image_id} -source_id ${source_id} ";
    203205        $pswarp_command    .= " -recipe PPSTATS WARPSTATS ";
    204         $pswarp_command    .= " -dumpconfig ${remote_outroot}.mdc -stats ${remote_outroot}.stats ";
     206        $pswarp_command    .= " -dumpconfig ${remote_outroot}.pswarp.mdc -stats ${remote_outroot}.stats ";
    205207
    206208#       print "$pswarp_command \n";
     
    218220        # Determine which output files need to be returned
    219221        foreach my $component(@return_component_list) {
    220             my $filename = $ipprc->filename($component,$ipp_outroot);
     222            my $filename = $ipprc->filename($component,$ipp_outroot,$skycell_id);
    221223            my ($ipp_disk, $remote_disk) = uri_to_outputs_for_return( $filename);
    222224            my $remote_outroot_dir = dirname($ipp_disk);
    223             print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} ";
     225            print CONFIG " && mkdir -p ${remote_root}/tmp/${remote_outroot_dir} && ln -sf $remote_disk ${remote_root}/tmp/${ipp_disk} && touch $remote_disk ";
    224226        }
    225227
     
    255257    $node_req = int(($node_need * $job_cost) / ($fill_factor * $time_req)) + 1;
    256258}
     259$time_req += 1; # Safety addition.
    257260
    258261open(COMMAND,  ">$disk_command") || &my_die("Couldn't open file? $disk_command",$remote_id,$PS_EXIT_SYS_ERROR);
  • branches/eam_branches/ipp-20140717/ippScripts/scripts/sc_remote_exec.pl

    r36844 r37242  
    1616# Hard coded values
    1717my $DMZ_HOST = 'wtrw';
    18 my $SEC_HOST = 'mu-fe4';
     18my $SEC_HOST = 'mu-fe';
    1919my $IPP_PATH = '/turquoise/usr/projects/cosmo/mswarren/ipp/';
    2020my $remote_root  = '/scratch3/watersc1/';
     
    3131}
    3232
    33 
    3433# Options
    35 my ($remote_id,$path_base,$policy,$poll,$job_id,$dbname,$verbose,$no_update,$camera);
    36 
     34my ($remote_id,$path_base,$policy,$poll,$force,$job_id,$dbname,$verbose,$no_update,$camera);
     35$force = 0;
     36$verbose = 0;
    3737GetOptions(
    3838    'remote_id=s'   => \$remote_id,
     
    4141    'policy=s'      => \$policy,
    4242    'poll'          => \$poll,
     43    'force-poll'    => \$force,
    4344    'camera=s'      => \$camera,
    4445    'dbname=s'      => \$dbname,
     
    5354
    5455my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $remote_id);
    55 
    5656my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files                                   
    5757
     
    6161
    6262print "passed authentication challenge.\n";
     63
     64# Phase 1.5: Grab the information about this run;
     65my $rt_cmd = "$remotetool -listrun -remote_id $remote_id ";
     66$rt_cmd   .= " -dbname $dbname " if defined($dbname);
     67my ( $rt_success, $rt_error_code, $rt_full_buf, $rt_stdout_buf, $rt_stderr_buf ) =
     68    run(command => $rt_cmd, verbose => $verbose);
     69unless ($rt_success) {
     70    $rt_error_code = (($rt_error_code >> 8) or $PS_EXIT_PROG_ERROR);
     71    &my_die("UNable to run remotetool to determine remote run status",
     72            $remote_id,$rt_error_code);
     73}
     74my $rrData = $mdcParser->parse(join "", @$rt_stdout_buf) or
     75    &my_die("UNable to run remotetool to determine remote run status",
     76            $remote_id,$rt_error_code);
     77my $rrData2 = parse_md_list($rrData);
     78my $runData = ${ $rrData2 }[0]; # There should be only one
    6379
    6480# These are operations we only need to do on the first call, not on subsequent poll operations.
     
    92108    my (undef,$remote_check) = uri_convert($uri_check);
    93109    my (undef,$remote_transfer)= uri_convert($uri_transfer);
    94 #    my $ssh_check_stdout = ssh_exec_command("${remote_root}/sc_validate_files.pl --check_list $remote_check --transfer_list $remote_transfer");
     110
    95111    my $ssh_check_stdout = ssh_exec_command("${remote_root}/sc_transfer_tool.pl --input $remote_check --fetch $remote_transfer");
    96112    # We no longer need to parse this output, as it retrieves files itself.
     
    130146# Poll the job status?
    131147my $poll_count = 0;
    132 my $poll_max   = 5;
     148my $poll_max   = 1; # If it isn't finished now, it's unlikely to magically finish in the next five minutes.
    133149my $poll_sleep = 60;
    134150my $poll_response = 0;
    135 while (($poll_count < $poll_max)&&($poll_response != 1)&&($poll_response != -1)) {
     151my $poll_word  = "nothing";
     152
     153if ($force) {
     154    $poll_response = 1;
     155    $poll_word     = "Completed";
     156}
     157
     158while (($poll_count < $poll_max)&&($poll_response != 1)&&($poll_response != -1)&&($force != 1)) {
    136159    if ($verbose) {
    137160        print "Polling code.  Sleeping.  $poll_count of $poll_max $poll_response\n";
     
    140163        sleep($poll_sleep);
    141164    }
    142     $poll_response = poll_job($job_id);
     165    ($poll_response,$poll_word) = poll_job($job_id);
    143166
    144167    if ($poll_response == 1) { # This job has completed
     
    146169    }
    147170    elsif ($poll_response == -1) { # This job has an error
    148         &my_die("The job exited incorrectly.",$remote_id, $PS_EXIT_PROG_ERROR);
     171        warn("The job exited incorrectly: $remote_id $job_id $poll_word.  Attempting to recover what we can.");
     172        $poll_response = 1; # To fool the check later into proceding
    149173    }
    150174    $poll_count++;
     
    156180    &my_die("Job hasn't completed.  Ending polling.", $remote_id, 0, "run", $job_id);
    157181}
    158 # Retrieve validation summary
    159 my $fault = 0;
     182
    160183
    161184# Initialize the remote side to sync things
     
    165188my $uri_return  = $path_base . ".return";
    166189my ($ipp_return,$remote_return) = uri_convert($uri_return);
    167 scp_get($remote_return,$ipp_return);
    168 # Feed teh return list into the
    169 my $return_push_output = ssh_exec_command("${remote_root}/sc_transfer_tool.pl --input $remote_return");
    170 print "$return_push_output\n";
    171 
    172 
     190# We shouldn't need to get this file.  We made that file.
     191#scp_get($remote_return,$ipp_return);
     192
     193# Construct list of dbinfo files we'll need to execute.
     194my @returned_files = ();
     195my @dbinfo_files   = ();
     196my @dbindex        = ();
     197my $iter           = 0;
    173198open(RETURN,   "$ipp_return") || &my_die("Couldn't open file? $ipp_return", $remote_id,$PS_EXIT_SYS_ERROR);
    174 while(<RETURN>) {
     199while (<RETURN>) {
    175200    chomp;
     201    push @returned_files, $_;
    176202    if ($_ =~ /dbinfo/) {
    177         my $file = $_;
    178 #       $file =~ s/${remote_root}.tmp//; THis shouldn't be needed, as the transfer tool munges the files on that side.
    179         open(DBF,"$file") || warn "Missing file $file\n";
    180         my $cmd = <DBF>;
    181         chomp($cmd);
    182         $cmd =~ s/-/ -/g; # This is just a safety check for missing space.
    183         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    184             run(command => $cmd, verbose => $verbose);
    185         unless ($success) {
    186             # This shouldn't fail, but we also can't suddenly abort if something does fail.  Maybe retry if this looks to be a continuing issue?
    187             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    188             warn("The command that shouldn't fail has failed: $cmd $remote_id $error_code");##,$remote_id,$error_code);
     203        push @dbinfo_files, $_;
     204        push @dbindex, $iter;
     205    }
     206    $iter++;
     207
     208}
     209close(RETURN);
     210print STDERR "Expect $#dbinfo_files dbinfo files\n";
     211
     212my $first = 0;
     213my $last  = $#dbinfo_files;
     214my $mid   = 0;
     215my $range = 20;  # How wide of a chunk to look through to catch threading drops
     216my $offset = 0;  # Offset to start from.
     217
     218# Feed the return list into the transfer tool
     219# If this fails, we should go to an auth wait point.
     220if ($poll_word eq 'Completed') { 
     221    # We're complete.  All files should exist on disk
     222    my $iter = 0;
     223    my $transfer_success = 1;
     224    do {
     225        $transfer_success = 1;
     226        $iter++;
     227        check_ssh_connection();
     228        my $return_push_output = ssh_exec_command("${remote_root}/sc_transfer_tool.pl --input $remote_return --offset $offset");
     229        my $return_push_output_print = join "\n", @{ $return_push_output };
     230        if ($return_push_output_print =~ /exited with value 255/) { $transfer_success = 0; }
     231        print "$return_push_output_print\n";
     232    } while (($transfer_success != 1) &&  ($iter < 10));  # Try harder;
     233}
     234else {
     235    # Just try and fetch things, because we didn't complete correctly, it seems.
     236    my $return_push_output = ssh_exec_command("${remote_root}/sc_transfer_tool.pl --input $remote_return --offset $offset");
     237    my $return_push_output_print = join "\n", @{ $return_push_output };
     238    print "$return_push_output_print\n";
     239}
     240
     241foreach my $file (@dbinfo_files) {
     242    open(DBF,"$file") || warn "Missing file $file\n";
     243    my $cmd = <DBF>;
     244    close(DBF);
     245    chomp($cmd);
     246#    print STDERR "$file $cmd\n";
     247    $cmd =~ s/-/ -/g; # This is just a safety check for missing space.
     248    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     249        run(command => $cmd, verbose => $verbose);
     250    unless ($success) {
     251
     252        # This shouldn't fail, but we also can't suddenly abort if something does fail. 
     253        # Now we're going to drop the component that owns this dbinfo, which should force a retry.
     254        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     255        warn("The command that shouldn't fail has failed: $file $cmd $remote_id $error_code");
     256        if ($poll_word ne 'Completed') {  # If the job claims it completed, then we're fighting the network.
     257            drop_component($remote_id,$cmd,$file);
    189258        }
    190         close(DBF);
    191     }
    192 }
    193 close(RETURN);
     259    }
     260
     261}
    194262
    195263# We're done, so set the state and exit.
    196264&my_die("Finished",$remote_id,0,"full");
    197 
    198265
    199266
     
    209276        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    210277        &my_die("Authorization check failed.",$remote_id,0,'auth');
    211 
    212 #       my $update_command = "$remotetool -updaterun -remote_id $remote_id ";
    213 #       $update_command .= " -set_state auth ";
    214 #       $update_command .= " -dbname $dbname " if defined $dbname;
    215 #       system($update_command);
    216 #       exit(0);  # This isn't an error.  It's a state we monitor and move to automatically.
    217278    }
    218279}
     
    250311sub ssh_exec_command {
    251312    my $cmd = shift;
    252     $cmd = "$ssh $DMZ_HOST ssh ${SEC_HOST} $cmd";
     313    $cmd = "$ssh  $DMZ_HOST ssh  ${SEC_HOST} $cmd";
     314    print "EXEC: $cmd\n";
    253315    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    254316        run(command => $cmd, verbose => $verbose);
    255317    unless ($success) {
    256318        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     319        # If we failed, see if we failed due to authorization.
     320        check_ssh_connection();
    257321        &my_die("Failed to execute command: >>$cmd<<");
    258322    }
     
    266330   
    267331    if ($response =~ /State: Running/) {
    268         return(0);
     332        return(0,"Running");
    269333    }
    270334    elsif ($response =~ /State: Completed/) {
    271         return(1);
     335        return(1,"Completed");
    272336    }
    273337    elsif ($response =~ /State: Idle/) {
    274         return(-2);
     338        return(-2,"Idle");
    275339    }
    276340    else {
    277         return(-1);
     341        my $response_word = $response;
     342        $response_word =~ s/.*State: //;
     343        $response_word =~ s/\n.*//;
     344        return(-1,$response_word);
    278345    }
    279346}
     
    324391    return($local_uri);
    325392}
     393
     394sub drop_component {
     395    my $remote_id = shift;
     396    my $cmd = shift;
     397    my $file = shift;
     398
     399    if ($cmd eq '') {
     400        # Zero byte file.  This dbinfo was never constructed properly.
     401       
     402        # Steal the stage_id from the filename.  This isn't something I'm happy about.
     403        my $stage = $runData->{stage};
     404        my $stage_id = $file;
     405        if ($stage eq 'chip') {
     406            $stage_id =~ s/^.*ch\.//;
     407        }
     408        elsif ($stage eq 'camera') {
     409            $stage_id =~ s/^.*cm\.//;
     410        }
     411        elsif ($stage eq 'warp') {
     412            $stage_id =~ s/^.*wrp\.//;
     413        }
     414        elsif ($stage eq 'stack') {
     415            $stage_id =~ s/^.*stk\.//;
     416        }
     417        $stage_id =~ s/\..*$//;
     418       
     419        # Drop this from the database
     420        my $drop_cmd = "$remotetool -dropcomponent -remote_id $remote_id -stage_id $stage_id ";
     421        $drop_cmd   .= " -dbname $dbname " if defined($dbname);
     422        system($drop_cmd);
     423    }
     424
     425}
     426
    326427sub my_die {
    327428    my $msg = shift;
     
    347448}
    348449
    349 # I don't think I need this anymore, but I don't want to burn it until I"m sure.
    350 
    351 # exit(1);
    352 # # Read this as a metadata object
    353 # my $ssh_exec_stdout = ssh_exec_command("sc_validate_processing.pl ${path_base}.out");
    354 # my $retrieveData = $mdcParser->parse(join "", @$ssh_exec_stdout);
    355 # my $retrieveData2= parse_md_list($retrieveData);
    356 
    357 # foreach my $retrieveEntry (@$retrieveData2) {
    358 #     my $process_fault = $retrieveEntry->{fault};
    359 #     my $dbcommand = $retrieveEntry->{dbcommand};
    360 #     my $filelist  = $retrieveEntry->{filelist};
    361 
    362 #     scp_get("${filelist}",${filelist});
    363 #     open(FL,${filelist});
    364 #     while(<FL>) {
    365 #       chomp;
    366 #       my $f = $_;
    367 #       scp_get("${f}",$f);
    368 #     }
    369 #     close(FL);
    370 
    371 #     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    372 #       run(command => $dbcommand, verbose => $verbose);
    373 #     unless ($success) {
    374 #       $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    375 #       &my_die("The database command returned did not execute correctly. $dbcommand $process_fault",
    376 #               $remote_id,$error_code);
    377 #     }
    378 
    379 #     if ($process_fault != 0) {
    380 #       $fault = 1;
    381 #     }
    382 # }
    383 
    384 # if (($policy ne 'ignore')&&($fault != 0)) {
    385 #     &my_die("This job exited without all components finishing successfully.  Halting.",
    386 #           $remote_id,$fault,"halt");
    387 # }
    388 # else {
    389 #     print "This job exited without all components finishing successfully. $fault\n" if $fault;
    390 #     &my_die("This job finished.  Setting remote job to full.",
    391 #           $remote_id,0,"full");
    392 # }
    393 
    394 # Promote to finished.
    395 #&my_die(); # Not really, but I don't have the tool interface finished, so these are all just placeholders.
    396450# Quick review:
    397451# new -> pending -> run -> full
  • branches/eam_branches/ipp-20140717/ippScripts/scripts/sc_transfer_tool.pl

    r37013 r37242  
    1010use Sys::Hostname;
    1111
    12 my $local_raw = '/scratch3/watersc1/raw/';
    13 my $local_tmp = '/scratch3/watersc1/tmp/';
     12my $remote_root = '/lustre/scratch1/turquoise/watersc1/ps1/';
     13$remote_root = '/scratch3/watersc1/';
     14my $local_raw = "${remote_root}/raw/";
     15my $local_tmp = "${remote_root}/tmp/";
    1416my $threads = 10;
    1517my @hosts = ('ippc20.ipp.ifa.hawaii.edu','ippc24.ipp.ifa.hawaii.edu','ippc28.ipp.ifa.hawaii.edu',
     
    6870    }
    6971    elsif (!($fetch)) { # We are pushing
    70         print { $filehandles[$i] } "${local_tmp}/$_" . "\n";
     72        # The rsync call expects to find files of a given name in the directory specified.
     73#       print { $filehandles[$i] } "${local_tmp}/$_" . "\n";
     74        print { $filehandles[$i] } "$_" . "\n";
    7175    }
    7276}
     
    112116
    113117    # the transform bit is there because it looks like the ' gets dropped, so the * is interpreted, and why is our tar so out of date?
    114     my $command = "tar cf - --ignore-failed-read --dereference --files-from=${transfer_filelist} | /usr/projects/cosmo/amd6100/bin/ssh -o NoneSwitch=yes -o NoneEnabled=yes $destination_host tar xf - -C /data/ --transform '" . 's,^.\*/data/,,' . "' --dereference";
     118#    my $command = "tar cf - --ignore-failed-read --dereference --files-from=${transfer_filelist} | /usr/projects/cosmo/amd6100/bin/ssh -o NoneSwitch=yes -o NoneEnabled=yes $destination_host tar xf - -C /data/ --transform '" . 's,^.\*/data/,,' . "' --dereference";
     119    my $command = "rsync -Lpt -e '/usr/projects/cosmo/amd6100/bin/ssh -o NoneSwitch=yes -o NoneEnabled=yes' --files-from=${transfer_filelist} ${local_tmp} ${destination_host}:/";
    115120    print STDERR "$command\n";
    116121
     
    118123        run(command => $command, verbose => $verbose);
    119124    unless ($success) {
    120 
    121125        print STDERR "ERROR:  $error_code\n";
    122126#       my $std = join "\n", @{ $stdout_buf };
     
    125129#       print "STDERR: $std\n";
    126130
    127         foreach my $line (@{ $stderr_buf }) {  # This is a hack.  A messy ugly hack.
    128             if ($line =~ /No such file or directory/) {
    129                 my $file = (split /\s+/, $line)[1];
    130                 $file =~ s/:$//;
    131                 if ($file !~ /nebulous/) { next; }
    132                 print STDERR "Touching $file so tar can continue.\n";
    133                 system("touch $file");
    134             }
    135         }
     131#       foreach my $line (@{ $stderr_buf }) {  # This is a hack.  A messy ugly hack.
     132#           if ($line =~ /No such file or directory/) {
     133#               my $file = (split /\s+/, $line)[1];
     134#               $file =~ s/:$//;
     135#               if ($file !~ /nebulous/) { next; }
     136#               print STDERR "Touching $file so tar can continue.\n";
     137#               system("touch $file");
     138#           }
     139#       }
    136140
    137141        warn("Transfer of $transfer_filelist to $destination_host failed with error $error_code.");
  • branches/eam_branches/ipp-20140717/ippTools/share/Makefile.am

    r36981 r37242  
    484484        releasetool_definerelstack.sql \
    485485        releasetool_definerelstack_with_skycal.sql \
     486        releasetool_deleterelexp.sql \
     487        releasetool_deleterelstack.sql \
    486488        releasetool_listrelstack.sql \
     489        releasetool_setrelstackcalibratedfromskycal.sql
    487490        releasetool_summary.sql \
    488491        releasetool_definerelgroup_select_lap.sql \
  • branches/eam_branches/ipp-20140717/ippTools/src/disttool.c

    r36555 r37242  
    605605    PXOPT_COPY_TIME(config->args, where, "-time_stamp_begin", "distRun.time_stamp", ">=");
    606606    PXOPT_COPY_TIME(config->args, where, "-time_stamp_end", "distRun.time_stamp", "<=");
     607    PXOPT_COPY_S64(config->args, where, "-dist_id_min", "dist_id", ">=");
     608    PXOPT_COPY_S64(config->args, where, "-dist_id_max", "dist_id", "<=");
    607609
    608610    PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false);
  • branches/eam_branches/ipp-20140717/ippTools/src/disttoolConfig.c

    r36248 r37242  
    8585    psMetadataAddTime(updaterunArgs, PS_LIST_TAIL, "-time_stamp_begin", 0, "limit updates by time_stamp (>=)", NULL);
    8686    psMetadataAddTime(updaterunArgs, PS_LIST_TAIL, "-time_stamp_end", 0, "limit updates by time_stamp (<=)", NULL);
     87    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-dist_id_min",  0, "limit updates by dist_id (>=)", 0);
     88    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-dist_id_max",  0, "limit updates by dist_id (<=)", 0);
    8789    psMetadataAddBool(updaterunArgs, PS_LIST_TAIL,"-clean",     0, "limit updates to clean distRuns", false);
    8890    psMetadataAddBool(updaterunArgs, PS_LIST_TAIL,"-full",      0, "limit updates to not clean distRuns", false);
  • branches/eam_branches/ipp-20140717/ippTools/src/releasetool.c

    r37075 r37242  
    4444static bool updaterelexpMode(pxConfig *config);
    4545static bool listrelexpMode(pxConfig *config);
     46static bool deleterelexpMode(pxConfig *config);
    4647static bool definerelstackMode(pxConfig *config);
    4748static bool updaterelstackMode(pxConfig *config);
     49static bool setrelstackcalibratedfromskycalMode(pxConfig *config);
    4850static bool listrelstackMode(pxConfig *config);
     51static bool deleterelstackMode(pxConfig *config);
    4952static bool summaryMode(pxConfig *config);
    5053static bool definerelgroupMode(pxConfig *config);
     
    8184        MODECASE(RELEASETOOL_MODE_UPDATERELEXP,     updaterelexpMode);
    8285        MODECASE(RELEASETOOL_MODE_LISTRELEXP,       listrelexpMode);
     86        MODECASE(RELEASETOOL_MODE_DELETERELEXP,     deleterelexpMode);
    8387
    8488        MODECASE(RELEASETOOL_MODE_DEFINERELSTACK,   definerelstackMode);
    8589        MODECASE(RELEASETOOL_MODE_UPDATERELSTACK,   updaterelstackMode);
     90        MODECASE(RELEASETOOL_MODE_SETRELSTACKCALIBRATEDFROMSKYCAL, setrelstackcalibratedfromskycalMode);
    8691        MODECASE(RELEASETOOL_MODE_LISTRELSTACK,     listrelstackMode);
     92        MODECASE(RELEASETOOL_MODE_DELETERELSTACK,   deleterelstackMode);
    8793        MODECASE(RELEASETOOL_MODE_SUMMARY,          summaryMode);
    8894
     
    817823
    818824    psFree(output);
     825
     826    return true;
     827}
     828
     829static bool deleterelexpMode(pxConfig *config)
     830{
     831    PS_ASSERT_PTR_NON_NULL(config, false);
     832
     833    PXOPT_LOOKUP_S64(relexp_id, config->args,   "-relexp_id", false, false);
     834    // If relexp_id is supplied that is all that we need
     835    if (!relexp_id) {
     836        // Otherwise we need to identify the release ...
     837        PXOPT_LOOKUP_STR(release_name, config->args, "-release_name", false, false);
     838        PXOPT_LOOKUP_S32(rel_id, config->args,      "-rel_id", false, false);
     839
     840        if (!release_name && !rel_id) {
     841            psError(PXTOOLS_ERR_CONFIG, true, "at least one of -relexp_id, -release_name, or -rel_id is required\n");
     842            return false;
     843        }
     844        // ... and the exposure
     845        PXOPT_LOOKUP_STR(label, config->args,       "-label", false, false);
     846        PXOPT_LOOKUP_S64(cam_id, config->args,      "-cam_id", false, false);
     847        PXOPT_LOOKUP_S64(exp_id, config->args,      "-exp_id", false, false);
     848        PXOPT_LOOKUP_STR(exp_name, config->args,    "-exp_name", false, false);
     849        if (!label && !cam_id && !exp_id && !exp_name) {
     850            psError(PXTOOLS_ERR_CONFIG, true, "at least one of -label, -cam_id, -exp_id, -exp_name is required\n");
     851            return false;
     852        }
     853    }
     854
     855    psMetadata *where = psMetadataAlloc();
     856
     857    PXOPT_COPY_S32(config->args, where, "-relexp_id", "relExp.relexp_id", "==");
     858    PXOPT_COPY_STR(config->args, where, "-label",  "camRun.label", "==");
     859    PXOPT_COPY_S64(config->args, where, "-cam_id", "relExp.cam_id", "==");
     860    PXOPT_COPY_S64(config->args, where, "-exp_id", "relExp.exp_id", "==");
     861    PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_name", "==");
     862
     863    PXOPT_COPY_S32(config->args, where, "-rel_id",  "relExp.rel_id", "==");
     864    PXOPT_COPY_STR(config->args, where, "-release_name", "ippRelease.release_name", "==");
     865
     866    psString query = pxDataGet("releasetool_deleterelexp.sql");
     867
     868    psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     869    psStringAppend(&query, "\n    AND %s", whereClause);
     870    psFree(whereClause);
     871
     872    if (!p_psDBRunQuery(config->dbh, query)) {
     873        psError(PS_ERR_UNKNOWN, false, "database error");
     874        psFree(query);
     875        return false;
     876    }
     877
     878    psU64 affected = psDBAffectedRows(config->dbh);
     879    psLogMsg("releasetool", PS_LOG_INFO, "Deleted %" PRIu64 " relExp rows", affected);
     880
     881
     882    psFree(query);
    819883
    820884    return true;
     
    10281092    return false;
    10291093}
     1094static bool setrelstackcalibratedfromskycalMode(pxConfig *config)
     1095{
     1096    PS_ASSERT_PTR_NON_NULL(config, NULL);
     1097
     1098    psMetadata *where = psMetadataAlloc();
     1099
     1100    PXOPT_COPY_STR(config->args, where, "-skycal_label", "skycalRun.label", "==");
     1101    PXOPT_COPY_STR(config->args, where, "-skycal_data_group", "skycalRun.data_group", "LIKE");
     1102    PXOPT_COPY_S64(config->args, where, "-skycal_id",  "skycalRun.skycal_id", "==");
     1103    if (!psListLength(where->list)) {
     1104        psError(PXTOOLS_ERR_CONFIG, false, "at least one of -skycal_label, -skycal_data_group, or -skycal_id is required");
     1105        return false;
     1106    }
     1107
     1108    PXOPT_COPY_STR(config->args, where, "-tess_id",    "stackRun.tess_id", "==");
     1109    PXOPT_COPY_STR(config->args, where, "-skycell_id", "stackRun.skycell_id", "==");
     1110    pxskycellAddWhere(config, where);
     1111
     1112    // insure that at least one of these is supplied to select the release
     1113    PXOPT_LOOKUP_S64(rel_id, config->args,      "-rel_id", false, false);
     1114    PXOPT_LOOKUP_STR(release_name, config->args, "-release_name", false, false);
     1115    if (!rel_id && !release_name) {
     1116        psError(PXTOOLS_ERR_CONFIG, true, "either -rel_id or -release_name is required");
     1117        return false;
     1118    }
     1119
     1120    // limit query to the target release. (Note: this will select nothing if release_name and rel_id don't match)
     1121    // note: we add these after above to insure that search args are supplied
     1122    PXOPT_COPY_STR(config->args, where, "-release_name", "ippRelease.release_name", "==");
     1123    PXOPT_COPY_S32(config->args, where, "-rel_id", "ippRelease.rel_id", "==");
     1124
     1125    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     1126    PXOPT_LOOKUP_BOOL(replace, config->args, "-replace", false);
     1127
     1128    psString query = pxDataGet("releasetool_setrelstackcalibratedfromskycal.sql");
     1129    if (!query) {
     1130        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     1131        psFree(where);
     1132        return false;
     1133    }
     1134
     1135    if (replace) {
     1136        // don't cut on relStack.state
     1137        psStringAppend(&query, "\nWHERE ");;
     1138    } else {
     1139        // normal path only update rows in state processed
     1140        psStringAppend(&query, "\nWHERE relStack.state = 'processed'\nAND ");;
     1141    }
     1142       
     1143    // Add in the where conditions
     1144    psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     1145    psStringAppend(&query, "%s", whereClause);
     1146    psFree(whereClause);
     1147
     1148    if (limit) {
     1149        psString limitString = psDBGenerateLimitSQL(limit);
     1150        psStringAppend(&query, " %s", limitString);
     1151        psFree(limitString);
     1152    }
     1153
     1154    if (!p_psDBRunQuery(config->dbh, query)) {
     1155        psError(PS_ERR_UNKNOWN, false, "database error");
     1156        psFree(query);
     1157        return false;
     1158    }
     1159    psFree(query);
     1160
     1161    psU64 affected = psDBAffectedRows(config->dbh);
     1162    psLogMsg("releasetool", PS_LOG_INFO, "Updated %" PRIu64 " relStack rows", affected);
     1163
     1164    return true;
     1165}
     1166
     1167static bool deleterelstackMode(pxConfig *config)
     1168{
     1169    PS_ASSERT_PTR_NON_NULL(config, false);
     1170
     1171    PXOPT_LOOKUP_S64(relstack_id, config->args,   "-relstack_id", false, false);
     1172    // If relexp_id is supplied that is all that we need
     1173    if (!relstack_id) {
     1174        // Otherwise we need to identify the release ...
     1175        PXOPT_LOOKUP_STR(release_name, config->args, "-release_name", false, false);
     1176        PXOPT_LOOKUP_S32(rel_id, config->args,      "-rel_id", false, false);
     1177
     1178        if (!release_name && !rel_id) {
     1179            psError(PXTOOLS_ERR_CONFIG, true, "at least one of -relstack_id, -release_name, or -rel_id is required\n");
     1180            return false;
     1181        }
     1182        // ... and the Stack
     1183        PXOPT_LOOKUP_STR(label, config->args,       "-label", false, false);
     1184        PXOPT_LOOKUP_S64(stack_id, config->args,    "-stack_id", false, false);
     1185        if (!label && !stack_id) {
     1186            psError(PXTOOLS_ERR_CONFIG, true, "at least one of -label and  -stack_id is required\n");
     1187            return false;
     1188        }
     1189    }
     1190
     1191    psMetadata *where = psMetadataAlloc();
     1192
     1193    PXOPT_COPY_S32(config->args, where, "-relstack_id", "relStack.relstack_id", "==");
     1194    PXOPT_COPY_STR(config->args, where, "-label", "stackRun.label", "==");
     1195    PXOPT_COPY_S64(config->args, where, "-stack_id", "relStack.stack_id", "==");
     1196
     1197    PXOPT_COPY_S32(config->args, where, "-rel_id", "relStack.rel_id", "==");
     1198    PXOPT_COPY_STR(config->args, where, "-release_name", "ippRelease.release_name", "==");
     1199
     1200    psString query = pxDataGet("releasetool_deleterelstack.sql");
     1201
     1202    psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     1203    psStringAppend(&query, "\n    AND %s", whereClause);
     1204    psFree(whereClause);
     1205
     1206    if (!p_psDBRunQuery(config->dbh, query)) {
     1207        psError(PS_ERR_UNKNOWN, false, "database error");
     1208        psFree(query);
     1209        return false;
     1210    }
     1211
     1212    psU64 affected = psDBAffectedRows(config->dbh);
     1213    psLogMsg("releasetool", PS_LOG_INFO, "Deleted %" PRIu64 " relStack rows", affected);
     1214
     1215
     1216    psFree(query);
     1217
     1218    return true;
     1219}
    10301220
    10311221static bool listrelstackMode(pxConfig *config)
     
    10521242
    10531243    PXOPT_COPY_STR(config->args, where, "-surveyName",  "survey.surveyName", "LIKE");
    1054     PXOPT_COPY_S32(config->args, where, "-rel_id",      "relExp.rel_id", "==");
     1244    PXOPT_COPY_S32(config->args, where, "-rel_id",      "relStack.rel_id", "==");
    10551245    pxskycellAddWhere(config, where);
    10561246
  • branches/eam_branches/ipp-20140717/ippTools/src/releasetool.h

    r36041 r37242  
    3434    RELEASETOOL_MODE_TOCALIBEXP,
    3535    RELEASETOOL_MODE_LISTRELEXP,
     36    RELEASETOOL_MODE_DELETERELEXP,
    3637    RELEASETOOL_MODE_DEFINERELSTACK,
    3738    RELEASETOOL_MODE_UPDATERELSTACK,
     39    RELEASETOOL_MODE_SETRELSTACKCALIBRATEDFROMSKYCAL,
     40    RELEASETOOL_MODE_DELETERELSTACK,
    3841    RELEASETOOL_MODE_TOCALIBSTACK,
    3942    RELEASETOOL_MODE_LISTRELSTACK,
  • branches/eam_branches/ipp-20140717/ippTools/src/releasetoolConfig.c

    r36046 r37242  
    6767    psMetadataAddStr(definereleaseArgs, PS_LIST_TAIL, "-set_ubercal_file", 0,  "define ubercal file name", NULL);
    6868
    69     // -uptdaterelease
     69    // -updaterelease
    7070    psMetadata *updatereleaseArgs = psMetadataAlloc();
    7171
     
    183183    psMetadataAddBool(listrelexpArgs, PS_LIST_TAIL, "-simple",      0, "use the simple output format", false);
    184184
     185    // -deleterelexp
     186    psMetadata *deleterelexpArgs = psMetadataAlloc();
     187    psMetadataAddS64(deleterelexpArgs, PS_LIST_TAIL,  "-relexp_id", 0,   "select by released exposure ID", 0);
     188    psMetadataAddS64(deleterelexpArgs, PS_LIST_TAIL,  "-exp_id", 0,      "select by exposure ID", 0);
     189    psMetadataAddStr(deleterelexpArgs,  PS_LIST_TAIL, "-exp_name", 0,    "select by exposure name", NULL);
     190    psMetadataAddS32(deleterelexpArgs, PS_LIST_TAIL,  "-rel_id", 0,      "select by release ID", 0);
     191    psMetadataAddS32(deleterelexpArgs, PS_LIST_TAIL,  "-cam_id", 0,      "select by cam run ID", 0);
     192    psMetadataAddStr(deleterelexpArgs,  PS_LIST_TAIL, "-label", 0,       "select by camRun.label", NULL);
     193    psMetadataAddStr(deleterelexpArgs,  PS_LIST_TAIL, "-release_name", 0, "select by release name (LIKE comparision)", NULL);
     194
     195
    185196    // -definerelstack
    186197    psMetadata *definerelstackArgs = psMetadataAlloc();
     
    248259    psMetadataAddBool(listrelstackArgs, PS_LIST_TAIL, "-simple",      0, "use the simple output format", false);
    249260
     261    // -updaterelstack
     262    psMetadata *updaterelstackArgs = psMetadataAlloc();
     263
     264    psMetadata *calibraterelstackArgs = psMetadataAlloc();
     265
     266        // set the target release and collection of relStacks (one of these is required)
     267    psMetadataAddStr(calibraterelstackArgs,  PS_LIST_TAIL, "-release_name", 0, "define release name", NULL);
     268    psMetadataAddS32(calibraterelstackArgs, PS_LIST_TAIL,  "-rel_id", 0,      "define release ID", 0);
     269
     270        // select the processing
     271    psMetadataAddStr(calibraterelstackArgs,  PS_LIST_TAIL, "-skycal_label",  0, "select by skycalRun.label", NULL);
     272    psMetadataAddStr(calibraterelstackArgs,  PS_LIST_TAIL, "-skycal_data_group", 0,  "select by skycalRun.data_group", NULL);
     273    psMetadataAddS64(calibraterelstackArgs, PS_LIST_TAIL,  "-skycal_id", 0,      "select by skycalRun.skycal_id", 0);
     274
     275    psMetadataAddStr(calibraterelstackArgs,  PS_LIST_TAIL, "-tess_id", 0,  "select by tess_id", NULL);
     276    psMetadataAddStr(calibraterelstackArgs,  PS_LIST_TAIL, "-skycell_id", 0,  "select by skycell_id", NULL);
     277    pxskycellAddArguments(calibraterelstackArgs);
     278
     279    psMetadataAddBool(calibraterelstackArgs, PS_LIST_TAIL, "-replace",   0, "replace any existing calibrations", false);
     280    psMetadataAddU64(calibraterelstackArgs, PS_LIST_TAIL,  "-limit",   0, "limit result set to N items", 0);
     281
     282    // -deleterelstack
     283    psMetadata *deleterelstackArgs = psMetadataAlloc();
     284    psMetadataAddS64(deleterelstackArgs, PS_LIST_TAIL,  "-relstack_id", 0,   "select by released exposure ID", 0);
     285    psMetadataAddS64(deleterelstackArgs, PS_LIST_TAIL,  "-stack_id", 0,   "select by stack ID", 0);
     286//    psMetadataAddS64(deleterelstackArgs, PS_LIST_TAIL,  "-skycal_id", 0,   "select by skycal ID", 0);
     287    psMetadataAddStr(deleterelstackArgs,  PS_LIST_TAIL, "-release_name", 0, "select by release name (LIKE comparision)", NULL);
     288    psMetadataAddS32(deleterelstackArgs, PS_LIST_TAIL,  "-rel_id", 0,   "select by release ID", 0);
     289
     290    psMetadataAddStr(deleterelstackArgs,  PS_LIST_TAIL, "-label",  0,      "select by stackRun.label", NULL);
     291//    psMetadataAddStr(deleterelstackArgs,  PS_LIST_TAIL, "-data_group", 0,  "select by stackRun.data_group", NULL);
     292//    psMetadataAddStr(deleterelstackArgs,  PS_LIST_TAIL, "-skycal_label",  0, "select by skycalRun.label", NULL);
     293//    psMetadataAddStr(deleterelstackArgs,  PS_LIST_TAIL, "-skycal_data_group", 0,  "select by skycalRun.data_group", NULL);
     294
    250295    // -summary
    251296    psMetadata *summaryArgs = psMetadataAlloc();
     
    348393    PXOPT_ADD_MODE("-tocalibexp",       "list relExps pending calibration",  RELEASETOOL_MODE_TOCALIBEXP,  tocalibexpArgs);
    349394    PXOPT_ADD_MODE("-listrelexp",       "list released exposures",      RELEASETOOL_MODE_LISTRELEXP,    listrelexpArgs);
     395    PXOPT_ADD_MODE("-deleterelexp",     "delete a released exposure",   RELEASETOOL_MODE_DELETERELEXP,  deleterelexpArgs);
    350396
    351397    PXOPT_ADD_MODE("-definerelstack",     "define a released stack",    RELEASETOOL_MODE_DEFINERELSTACK,  definerelstackArgs);
    352398    PXOPT_ADD_MODE("-listrelstack",       "list released stacks",      RELEASETOOL_MODE_LISTRELSTACK,    listrelstackArgs);
     399    PXOPT_ADD_MODE("-updaterelstack",     "update parameters of released stacks",      RELEASETOOL_MODE_LISTRELSTACK,    updaterelstackArgs);
     400    PXOPT_ADD_MODE("-setrelstackcalibratedfromskycal", "update parameters of using skycalResults",      RELEASETOOL_MODE_SETRELSTACKCALIBRATEDFROMSKYCAL,    calibraterelstackArgs);
     401    PXOPT_ADD_MODE("-deleterelstack",     "update parameters of released stacks",      RELEASETOOL_MODE_DELETERELSTACK,  deleterelstackArgs);
     402
    353403    PXOPT_ADD_MODE("-summary",            "list stackSummaryes for released stacks", RELEASETOOL_MODE_SUMMARY,    summaryArgs);
    354404
  • branches/eam_branches/ipp-20140717/ippTools/src/stacktool.c

    r36361 r37242  
    260260    // these are used to build the HAVING restriction
    261261    PXOPT_COPY_S32(config->args, having, "-min_num", "num_warp", ">=");
     262    PXOPT_COPY_S32(config->args, having, "-max_num", "num_warp", "<=");
     263   
    262264    PXOPT_LOOKUP_S32(min_num,     config->args, "-min_num",  false, false);
    263265    if (min_num < 2) {
  • branches/eam_branches/ipp-20140717/ippTools/src/stacktoolConfig.c

    r36361 r37242  
    9898    psMetadataAddS32(definebyqueryArgs, PS_LIST_TAIL, "-random", 0, "use this number of random elements", 0);
    9999    psMetadataAddS32(definebyqueryArgs, PS_LIST_TAIL, "-min_num", 0, "minimum number of inputs", 0);
     100    psMetadataAddS32(definebyqueryArgs, PS_LIST_TAIL, "-max_num", 0, "maximum number of inputs", 0);
    100101    psMetadataAddS32(definebyqueryArgs, PS_LIST_TAIL, "-min_new", 0, "minimum number of new inputs", 0);
    101102    psMetadataAddF32(definebyqueryArgs, PS_LIST_TAIL, "-min_frac", 0, "minumum fraction of new inputs", NAN);
  • branches/eam_branches/ipp-20140717/ippTools/src/staticskytool.c

    r36633 r37242  
    10571057    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    10581058    PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false);
     1059    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    10591060
    10601061    psString query = pxDataGet("staticskytool_defineskycalrun.sql");
     
    10841085    }
    10851086
     1087    if (limit) {
     1088        psString limitString = psDBGenerateLimitSQL(limit);
     1089        psStringAppend(&query, "\n%s", limitString);
     1090        psFree(limitString);
     1091    }
    10861092
    10871093    if (!p_psDBRunQueryF(config->dbh, query, labelHook)) {
     
    11711177    PXOPT_COPY_S64(config->args, where, "-sky_id",   "sky_id",   "==");
    11721178    PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id",   "==");
     1179    PXOPT_COPY_STR(config->args, where, "-skycell_id",  "stackRun.skycell_id",    "==");
    11731180    PXOPT_COPY_STR(config->args, where, "-label",   "skycalRun.label",    "==");
    11741181    PXOPT_COPY_STR(config->args, where, "-state",   "skycalRun.state",    "==");
  • branches/eam_branches/ipp-20140717/ippTools/src/staticskytoolConfig.c

    r35960 r37242  
    181181    psMetadataAddBool(defineskycalrunArgs, PS_LIST_TAIL, "-check_inputs",  0, "list inputs, do not modify database", false);
    182182    psMetadataAddBool(defineskycalrunArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false);
     183    psMetadataAddU64(defineskycalrunArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0);
    183184
    184185    // -updateskycalrun
     
    188189    psMetadataAddS64(updateskycalrunArgs, PS_LIST_TAIL, "-stack_id", 0,  "search by stack ID", 0);
    189190    psMetadataAddStr(updateskycalrunArgs, PS_LIST_TAIL, "-state", 0, "search by state", NULL);
     191    psMetadataAddStr(updateskycalrunArgs, PS_LIST_TAIL, "-skycell_id", 0, "search by skycell_id", 0);
    190192    psMetadataAddStr(updateskycalrunArgs, PS_LIST_TAIL, "-label", 0, "search by label", 0);
    191193    pxskycellAddArguments(updateskycalrunArgs);
  • branches/eam_branches/ipp-20140717/ippconfig

  • branches/eam_branches/ipp-20140717/ippconfig/gpc1/psastro.config

    r37071 r37242  
    379379#  PSASTRO.CATDIR                STR     PS1.REF.20120503
    380380#  PSASTRO.CATDIR               STR     PS1.REF.20120524
    381    PSASTRO.CATDIR               STR     PS1.REF.20140605
     381#   PSASTRO.CATDIR               STR     PS1.REF.20140605
     382   PSASTRO.CATDIR                STR     PS1.REF.20140713
    382383   ZERO.POINT.USE.MEAN          BOOL    TRUE 
    383384END
  • branches/eam_branches/ipp-20140717/ippconfig/recipes/ppSub.config

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140717/ippconfig/recipes/reductionClasses.mdc

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140717/psModules

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140717/pstamp/scripts/pstamp_checkdependent.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140717/pstamp/scripts/pstamp_finish.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20140717/pstamp/scripts/pstampparse.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.