IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42415 for trunk/tools


Ignore:
Timestamp:
Mar 16, 2023, 12:48:31 PM (3 years ago)
Author:
eugene
Message:

various updates : adding stage 2

Location:
trunk/tools/eam/rawfix.20230221/src
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/rawfix.20230221/src/check.rawfix.sh

    r42411 r42415  
    6767  if ($mystate == "fixchip.done")  goto good_state
    6868  if ($mystate == "fixchip.fail")  goto good_state
    69   if ($mystate == "rsync_s1.new")  goto good_state
    70   if ($mystate == "rsync_s1.done") goto good_state
    71   if ($mystate == "rsync_s1.fail") goto good_state
    7269  if ($mystate == "md5sum.new")    goto good_state
    7370  if ($mystate == "md5sum.done")   goto good_state
    7471  if ($mystate == "md5sum.fail")   goto good_state
    75   if ($mystate == "rsync_s2.new")  goto good_state
    76   if ($mystate == "rsync_s2.done") goto good_state
    77   if ($mystate == "rsync_s2.fail") goto good_state
    7872  if ($mystate == "md5chk.new")    goto good_state
    7973  if ($mystate == "md5chk.done")   goto good_state
    8074  if ($mystate == "md5chk.fail")   goto good_state
     75
     76  # stage 2:
     77  if ($mystate == "fixchip_s2.new")   goto good_state
     78  if ($mystate == "fixchip_s2.done")  goto good_state
     79  if ($mystate == "fixchip_s2.fail")  goto good_state
     80  if ($mystate == "md5sum_s2.new")    goto good_state
     81  if ($mystate == "md5sum_s2.done")   goto good_state
     82  if ($mystate == "md5sum_s2.fail")   goto good_state
     83  if ($mystate == "md5chk_s2.new")    goto good_state
     84  if ($mystate == "md5chk_s2.done")   goto good_state
     85  if ($mystate == "md5chk_s2.fail")   goto good_state
     86
     87# disable the rsyncs stages: run in directory from b-node
     88#  if ($mystate == "rsync_s1.new")  goto good_state
     89#  if ($mystate == "rsync_s1.done") goto good_state
     90#  if ($mystate == "rsync_s1.fail") goto good_state
     91#  if ($mystate == "rsync_s2.new")  goto good_state
     92#  if ($mystate == "rsync_s2.done") goto good_state
     93#  if ($mystate == "rsync_s2.fail") goto good_state
    8194
    8295  echo "ERROR: unknown mode $mystate"
  • trunk/tools/eam/rawfix.20230221/src/check_chip_locations.pl

    r42406 r42415  
    6767        my ($Nmain, $Nback, $Ndead) = &check_instance_xattr ($inforows, $ext_id, $data_st, $md5_sum);
    6868
    69         &check_instance_state ($outfh, $ext_id, $Nmain, $Nback, $Ndead);
     69        &check_instance_state ($outfh, $ext_id, $data_st, $md5_sum, $Nmain, $Nback, $Ndead);
    7070    }
    7171
     
    249249    my $outfh = $_[0];
    250250    my $extID = $_[1];
    251     my $Nmain = $_[2];
    252     my $Nback = $_[3];
    253     my $Ndead = $_[4];
    254 
    255     # SKIP : already fixed
     251    my $data_st = $_[2];
     252    my $md5_sum = $_[3];
     253    my $Nmain = $_[4];
     254    my $Nback = $_[5];
     255    my $Ndead = $_[6];
     256
     257    my $outinfo = "$extID $data_st $md5_sum";
     258
     259    # GOOD : already fixed
    256260    if (($Nmain == 1) && ($Nback == 1)) {
    257         print $outfh "GOOD: $extID\n";
    258         return;
    259     }
    260 
    261     # single copy @ ITC, no backup
     261        print $outfh "GOOD: $outinfo\n";
     262        return;
     263    }
     264
     265    # SING : single copy @ ITC, no backup
    262266    # make a backup
    263267    if (($Nmain == 1) && ($Nback == 0)) {
    264         print $outfh "SING: $extID\n";
    265         return;
    266     }
    267 
    268     # ITC files with a single backup copies need to be culled
    269     # cull Nmain - 1
    270     if (($Nmain > 1) && ($Nback == 1)) {
    271         print $outfh "CULL: $extID\n";
    272         return;
    273     }
    274 
    275     # multiple copies @ ITC
     268        print $outfh "SING: $outinfo\n";
     269        return;
     270    }
     271
     272    # SBCK : single copy @ ATRC, no main copy
     273    # make a backup @ ITC
     274    if (($Nmain == 0) && ($Nback == 1)) {
     275        print $outfh "SBCK: $outinfo\n";
     276        return;
     277    }
     278
     279    # DUPS : multiple copies @ ITC, none at ATRC
    276280    # make a backup and cull Nmain - 1
    277281    if (($Nmain > 1) && ($Nback == 0)) {
    278         print $outfh "DUPS: $extID\n";
    279         return;
    280     }
    281 
    282     # no more valid instances
    283     if (($Nmain == 0) && ($Nback == 0) && $Ndead) {
    284         print $outfh "DEAD: $extID\n";
    285         return;
    286     }
    287     if (($Nmain == 0) && ($Nback == 0) && ($Ndead == 0)) {
    288         print $outfh "GONE: $extID\n";
    289         return;
    290     }
    291 
    292     # single copy @ ATRC
    293     # make a backup @ ITC
    294     if (($Nmain == 0) && ($Nback == 1)) {
    295         print $outfh "SBCK: $extID\n";
    296         return;
    297     }
    298 
    299     # multiple copies @ ATRC, but none at ITC
     282        print $outfh "DUPS: $outinfo\n";
     283        return;
     284    }
     285
     286    # XBCK : multiple copies @ ATRC, but none at ITC
    300287    # make a backup at ITC, cull ATRC extras
    301288    if (($Nmain == 0) &&  ($Nback > 1)) {
    302         print $outfh "XBCK: $extID\n";
     289        print $outfh "XBCK: $outinfo\n";
     290        return;
     291    }
     292
     293    # DEAD : no more valid instances
     294    if (($Nmain == 0) && ($Nback == 0) && $Ndead) {
     295        print $outfh "DEAD: $outinfo\n";
     296        return;
     297    }
     298    # GONE : no more valid instances
     299    if (($Nmain == 0) && ($Nback == 0) && ($Ndead == 0)) {
     300        print $outfh "GONE: $outinfo\n";
     301        return;
     302    }
     303
     304    # CUL1 : multiple ITC files, single backup
     305    # cull only ITC
     306    if (($Nmain > 1) && ($Nback == 1)) {
     307        print $outfh "CUL1: $outinfo\n";
     308        return;
     309    }
     310
     311    # CUL2 : multiple ATRC files, single ITC
     312    # cull only ATRC
     313    if (($Nback > 1) && ($Nmain == 1)) {
     314        print $outfh "CUL2: $outinfo\n";
     315        return;
     316    }
     317
     318    # CUL3 : excess ATRC & ITC files, cull from both?
     319    # cull Nmain - 1
     320    if (($Nback > 1) && ($Nmain > 1)) {
     321        print $outfh "CUL3: $outinfo\n";
    303322        return;
    304323    }
    305324
    306325    # unexpected state:
    307     print $outfh "OOPS: $extID\n";
     326    print $outfh "OOPS: $outinfo\n";
    308327    return;
    309328}
  • trunk/tools/eam/rawfix.20230221/src/check_md5s_dateobs.pl

    r42411 r42415  
    11#! /usr/bin/env perl
    22
    3 my $DEBUG = 4;
     3my $DEBUG = 1;
    44my $time = time();
    55
     
    8282            print STDOUT "FAIL: $inst $state $md5tru $md5obs\n";
    8383            $Nfail ++;
     84        } else {
     85            if ($DEBUG > 2) {
     86                print STDOUT "$inst $state $md5tru = $md5obs\n";
     87            }
    8488        }
    8589    }
  • trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl

    r42406 r42415  
    3636my $Nxbck = 0;
    3737
     38my $Ncul1 = 0;
     39my $Ncul2 = 0;
     40my $Ncul3 = 0;
     41
    3842foreach my $chip_id (@chip_ids) {
    3943
     
    4953
    5054        # we expect lines of the form: STATE PATH
    51         # e.g., GOOD: gpc1/20100502/o5318g0002d/o5318g0002d.ota76.fits
    52         if (@words != 2) { die "error in URI list $urifile, line: $line\n"; }
     55        # e.g., GOOD: gpc1/20100502/o5318g0002d/o5318g0002d.ota76.fits DataState MD5sum
     56        if (@words != 4) { die "error in URI list $urifile, line: $line\n"; }
    5357
    5458        my $state  = $words[0];
    5559        my $ext_id = $words[1];
     60        my $datast = $words[2];
     61        my $md5sum = $words[3];
    5662
    5763        if ($state eq "GOOD:") { $Ngood++; next; }
    5864        if ($state eq "DEAD:") { $Ndead++; next; }
    5965        if ($state eq "GONE:") { $Ngone++; next; }
    60         if ($state eq "DUPS:") { $Ndups++; next; }
    61         if ($state eq "XBCK:") { $Nxbck++; next; }
    6266
    6367        # one copy at ITC: neb-replicate will create a copy at ATRC
     
    6872            unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; }
    6973            open (OUTFILE, ">>$dateword/$newhost.inst.txt");
    70             print OUTFILE "$newfile\n";
     74            print OUTFILE "$newfile $datast $md5sum\n";
    7175            close (OUTFILE);
    7276            $Nsing ++;
     
    8286            unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; }
    8387            open (OUTFILE, ">>$dateword/$newhost.inst.txt");
    84             print OUTFILE "$newfile\n";
     88            print OUTFILE "$newfile $datast $md5sum\n";
    8589            close (OUTFILE);
    8690            $Nsbck ++;
    8791            next;
    8892        }
     93
     94        # these are done in stage 2:
     95        if ($state eq "DUPS:") { $Ndups++; next; }
     96        if ($state eq "XBCK:") { $Nxbck++; next; }
     97
     98        # these are done in stage 3:
     99        if ($state eq "CUL1:") { $Ncul1++; next; }
     100        if ($state eq "CUL2:") { $Ncul2++; next; }
     101        if ($state eq "CUL3:") { $Ncul3++; next; }
    89102    }
    90103    $volnum ++;
     
    98111print "Nsbck: $Nsbck\n";
    99112print "Nxbck: $Nxbck\n";
     113print "Ncul1: $Ncul1\n";
     114print "Ncul2: $Ncul2\n";
     115print "Ncul3: $Ncul3\n";
    100116
    101117exit 0;
  • trunk/tools/eam/rawfix.20230221/src/rawfix.pt

    r42411 r42415  
    99
    1010# use this to find the files in this local directory
    11 $mypath = /home/panstarrs/eugene/rawfix.20230221
     11# $mypath = /home/panstarrs/eugene/rawfix.20230221
     12
     13# NOTE: use a directory located on a b-node so the results can
     14# be seen by both ATRC and ITC machines
     15$mypath = /data/ippb07.0/home/eugene/rawfix.20230221
    1216
    1317if (not($?LOGDIR))
     
    1923# order is this file is not determinative, only the
    2024# change of state from STAGE1.new -> STAGE1.done -> STAGE2.new
    21 input rawfix.ckchip.pt
    22 input rawfix.fixchip.pt
    23 input rawfix.rsync_s1.pt
    24 input rawfix.md5sum.pt
    25 input rawfix.rsync_s2.pt
    26 input rawfix.md5chk.pt
     25# input rawfix.ckchip.pt
     26# input rawfix.fixchip.pt
     27# input rawfix.md5sum.pt
     28# input rawfix.md5chk.pt
     29# input rawfix.fixchip_s2.pt
     30input rawfix.md5sum_s2.pt
     31#input rawfix.md5chk_s2.pt
     32
     33# no need to run rsync if we use the b-node working directory:
     34# input rawfix.rsync_s1.pt
     35# input rawfix.rsync_s2.pt
    2736
    2837######################### UTILITIES #################################
Note: See TracChangeset for help on using the changeset viewer.