IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29659


Ignore:
Timestamp:
Nov 3, 2010, 6:28:17 PM (16 years ago)
Author:
watersc1
Message:

backport of split stack queuing automation

Location:
tags/ipp-20101029
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20101029/ippScripts/scripts/automate_stacks.pl

    r29266 r29659  
    12671267    my $stack_done_sth = "SELECT * from stackRun LEFT JOIN stackSumSkyfile USING(stack_id) WHERE $where ";
    12681268    $stack_done_sth .= " AND ((state = 'full') OR (state = 'new' && fault != 0)) ";
    1269 
     1269    if ($debug == 1) {
     1270        print STDERR "post_stack_queue: database queries:\n";
     1271        print STDERR "$stack_full_sth\n";
     1272        print STDERR "$stack_done_sth\n";
     1273    }
    12701274    my $stack_full_ref = $db->selectall_arrayref( $stack_full_sth );
    12711275    my $stack_done_ref = $db->selectall_arrayref( $stack_done_sth );
     
    12811285        if ($stackable_list{$target} == 1) {
    12821286            my ($Nstacks, $Nattempted) = post_stack_queue($date,$target);
     1287            if ($debug == 1) {
     1288                print STDERR "confirm_stacks: Target $target on $date has $Nattempted attempts on $Nstacks.\n";
     1289            }
    12831290            if ($Nstacks != $Nattempted) {
    12841291                if ($debug == 1) {
    1285                     print STDERR "confirm_stacks: Target $target on $date is not done stacking. $Nstacks $Nattempted\n"
     1292                    print STDERR "confirm_stacks: Target $target on $date is not done stacking. $Nstacks $Nattempted\n";
    12861293                }
    12871294                if ($metadata_out{nsState} eq 'CONFIRM_STACKING') {
    12881295                    $metadata_out{nsState} = 'STACKING';
    12891296                }
    1290                    
     1297                next;
     1298            }
     1299            if ($Nstacks == 0) {
     1300                if ($debug == 1) {
     1301                    print STDERR "confirm_stacks: Target $target on $date has no stacks. Skipping.\n";
     1302                }
    12911303                next;
    12921304            }
     
    13071319################################################################################
    13081320
     1321sub verify_uniqueness_diff {
     1322    my $warp_id_1 = shift;
     1323    my $warp_id_2 = shift;
     1324    my $date = shift;
     1325    my $target = shift;
     1326
     1327    my $db = init_gpc_db();
     1328    $date =~ s/-//g;
     1329    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target);
     1330
     1331    my $sth = "SELECT diff_id from diffRun JOIN diffInputSkyfile USING(diff_id) where data_group = '$data_group' AND warp1 = $warp_id_1 AND warp2 = $warp_id_2";
     1332    my $data_ref = $db->selectall_arrayref( $sth );
     1333
     1334    return($#{ $data_ref } + 1);
     1335}
     1336
    13091337sub do_extra_processing {
    13101338    my $date = shift;
     
    13321360            if (($#{ $warps } + 1) % 2 != 0) {
    13331361                print STDERR "Number of input warps to make OSS diffs is not even! $#{ $warps }\n";
    1334                 die;
     1362                last;
    13351363            }
    13361364           
     
    13411369                my $template_exp_id = ${ $template_warp }[0];
    13421370               
     1371                my $input_warp_id = ${ $input_warp }[1];
     1372                my $template_warp_id = ${ $template_warp }[1];
     1373
     1374                if (verify_uniqueness_diff($input_warp_id,$template_warp_id,$date,$target) != 0) {
     1375                    print STDERR "Diffs already queued for this $date $target $input_exp_id $template_exp_id\n";
     1376                    next;
     1377                }
     1378
    13431379                my $cmd = "$difftool -dbname $dbname  -definewarpwarp ";
    13441380                $cmd .= "-input_label $label  -template_label $label ";
     
    15071543        my $N = $metadata_out{N_MACROS};
    15081544        $metadata_out{"ns${N}Macro"} = $macro_formats{$proc_mode};
    1509 #       print STDERR "WORKING ON A MACRO: ns${N}Macro $proc_mode $macro_formats{$proc_mode}\n";
     1545        if ($debug == 1) {
     1546            print STDERR "WORKING ON A MACRO: ns${N}Macro $proc_mode $macro_formats{$proc_mode}\n";
     1547        }
    15101548        if (defined($date)&&(defined($target))) {
    15111549
     
    15281566            $metadata_out{"ns${N}Macro"} =~ s/\@DATE\@/$date/;
    15291567        }
     1568        if ($debug == 1) {
     1569            print STDERR "DONE WITH A MACRO: ns${N}Macro $proc_mode $macro_formats{$proc_mode}\n";
     1570        }
    15301571        $metadata_out{N_MACROS} ++;
    15311572    }
  • tags/ipp-20101029/ippTasks/nightly_stacks.pro

    r29156 r29659  
    8383macro ns.stacks.on
    8484  task ns.stacks.load
    85     active true
     85    active false
    8686  end
    8787  task ns.stacks.run
     
    617617     option $date
    618618
    619      if ("$ns_STATE" != "QUEUESTACKS") break
     619     if (("$ns_STATE" != "QUEUESTACKS")&&("$ns_STATE" != "TOWARP")&&("$ns_STATE" != "FORCETOWARP")) break
    620620     $run = automate_stacks.pl --queue_stacks --date $date
    621621     command $run
Note: See TracChangeset for help on using the changeset viewer.