IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42404


Ignore:
Timestamp:
Mar 9, 2023, 2:32:14 PM (3 years ago)
Author:
eugene
Message:

more updates to rawfix

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

Legend:

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

    r42400 r42404  
    33if ($#argv < 1) then
    44  echo "USAGE: check.rawfix.sh (mode) [options]"
     5  echo "USAGE: check.rawfix.sh all"
     6  echo "USAGE: check.rawfix.sh stats"
    57  echo "USAGE: check.rawfix.sh night (YYYYMMDD)"
    6   echo "USAGE: check.rawfix.sh new"
     8  echo "USAGE: check.rawfix.sh state (state)"
     9  echo " NOTE: state = raw, rsync, md5sum.new"
    710  exit 2
    811endif
     
    6164  if ($mystate == "rsync") goto good_state
    6265  if ($mystate == "md5sum.new") goto good_state
     66  if ($mystate == "md5sum.done") goto good_state
     67  if ($mystate == "md5sum.fail") goto good_state
    6368
    6469  echo "ERROR: unknown mode $mystate"
  • trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl

    r42399 r42404  
    1212use Getopt::Long qw( GetOptions :config auto_help auto_version );
    1313
    14 # USAGE: fix_chip_locations.pl --dateobs (night)
     14# USAGE: fix_chip_locations.pl --dateobs (night) --chiplist (file)
    1515
    1616# we need to select targets for ITC copies of files currently only at ATRC:
  • trunk/tools/eam/rawfix.20230221/src/get_hosts_md5s.sh

    r42400 r42404  
    1414
    1515# report both the dateobs and the hostnames
    16 ls $dirname/*.inst.txt | awk -v dateobs=$dirname -F/ '(NR == 1){print "dateobs md5host"}{print dateobs, $2}' | sed s/.inst.txt// | head
     16ls $dirname/*.inst.txt | awk -v dateobs=$dirname -F/ '(NR == 1){print "dateobs md5host"}{print dateobs, $2}' | sed s/.inst.txt//
    1717exit 0
  • trunk/tools/eam/rawfix.20230221/src/get_md5s_instances.pl

    r42400 r42404  
    2727
    2828if ($output eq $input) { die "output file ($output) matches input file ($input)\n"; }
     29if (-e $output) {
     30    # check that all instances are in the output file?
     31    print "$output exists, skipping\n";
     32    exit 0;
     33}
     34
    2935open (OUTFILE, ">$output");
    3036
  • trunk/tools/eam/rawfix.20230221/src/rawfix.pt

    r42400 r42404  
    1313
    1414# use this to find the files in this local directory
    15 $mypath = `pwd`
     15$mypath = /home/panstarrs/eugene/rawfix.20230221
     16
     17if (not($?LOGDIR))
     18  $LOGDIR = $mypath/pantasks_logs
     19  mkdir $LOGDIR
     20end
    1621
    1722if (not($?RAWFIX_INIT))
     
    1924  book init md5host.book
    2025  $RAWFIX_INIT = 1
    21 end
    22 
    23 macro load.hosts
    24   # read the list of possible hosts from the file
    25   # for each host, create a variable $host:name = 0
    26   # when the host is running, set this to 1
    27 
    28   list allhosts -x "cat allhosts.txt"
    29 
    30   for i 0 $allhosts:n
    31     $name = $allhosts:$i
    32     $host:$name = 0
    33   end
    3426end
    3527
     
    4234  periods -timeout 30
    4335
     36  stdout $LOGDIR/md5sum.load.stdout.log 
     37  stderr $LOGDIR/md5sum.load.stderr.log
     38
    4439  # only run one of these tasks at a time
    4540  npending 1
     
    7772  periods      -timeout 60
    7873  npending 1
     74
     75  stdout $LOGDIR/md5sum.loadhosts.stdout.log 
     76  stderr $LOGDIR/md5sum.loadhosts.stderr.log
    7977
    8078  task.exec
     
    9492    option $pageName
    9593    # save the page so we can use it below
     94
     95    # write an entry point in the log for this night
     96    sprintf tmpline "%s/%s/md5sum.runhosts.log" $mypath $DATEOBS
     97    date -var mydate
     98    exec echo "# start runhosts $mydate" >> $tmpline
    9699
    97100    command get_hosts_md5s.sh $DATEOBS
     
    133136  periods      -timeout 60
    134137
     138  stdout $LOGDIR/md5sum.runhosts.stdout.log 
     139  stderr $LOGDIR/md5sum.runhosts.stderr.log
     140
    135141  task.exec
    136142    # if we are unable to run the 'exec', use a long retry time
     
    152158    # save DATEOBS so we can find the md5sum.book entry
    153159
    154     # XXX test: use test host
    155     $TESTHOST = ipp060
    156     host -required $TESTHOST
    157     if (not($?host:$TESTHOST))
    158       echo "host not defined, creating : $TESTHOST"
    159       $host:$TESTHOST = 0
     160    # XXX TEST: $USE_HOST = ipp060
     161
     162    $USE_HOST = $MD5HOST
     163    host -required $USE_HOST
     164    ## check if this host needs to be launched
     165    if (not($?host:$USE_HOST))
     166      echo "host not defined, creating : $USE_HOST"
     167      $host:$USE_HOST = 0
    160168    end
    161     if (not($host:$TESTHOST))
    162       control host add $TESTHOST
    163       $host:$TESTHOST = 1
     169    if (not($host:$USE_HOST))
     170      control host add $USE_HOST
     171      $host:$USE_HOST = 1
    164172    end
    165     # host -required $MD5HOST
    166 
    167     ## check if this host needs to be launched
    168 
     173
     174    ## even when testing, use the original hostname here:
    169175    $input = $mypath/$DATEOBS/$MD5HOST.inst.txt
    170176
    171177    # need to make sure this will work on the ipp b-nodes:
    172     # command $mypath/get_md5s_instances.pl --hostname $MD5HOST --input $input
    173     command $mypath/get_md5s_instances.pl --hostname $TESTHOST --input $input
     178    # if we are able to run the 'exec', use a short retry time to launch all outstanding jobs
     179    periods -exec 0.05
     180    command $mypath/get_md5s_instances.pl --hostname $USE_HOST --input $input
    174181  end
    175182
     
    203210  periods      -timeout 60
    204211  npending 1
     212
     213  stdout $LOGDIR/md5sum.clean.stdout.log 
     214  stderr $LOGDIR/md5sum.clean.stderr.log
    205215
    206216  task.exec
     
    214224    # look for completed nights in md5sum.book (pantaskState == DONE)
    215225    book getpage md5sum.book 0 -var pageName -key pantaskState DONE
    216     echo "checking this page: $pageName"
    217226    if ("$pageName" == "NULL") break
    218227
    219     echo "cleaning this page: $pageName"
    220     book listpage md5sum.book $pageName
     228    # book listpage md5sum.book $pageName
    221229
    222230    # book setword md5sum.book $pageName pantaskState RUN
    223231    book getword md5sum.book $pageName dateobs -var DATEOBS
    224232    book getword md5sum.book $pageName pantasksQuality -var QUALITY
    225     echo "cleaning $pageName, quality: $QUALITY"
    226233
    227234    option $pageName
     
    229236
    230237    if ("$QUALITY" == "OK")
    231        
    232238      command update.rawfix.sh $DATEOBS md5sum.done
    233239    else
     
    275281  if ("$1" != "OK")
    276282    book setword md5sum.book $options:1 pantasksQuality $1
     283    sprintf tmpline "%s/%s/md5sum.runhosts.log" $mypath $options:1
     284    exec echo "failure $1 $options:0" >> $tmpline
     285  else
     286    exec echo "success $1 $options:0" >> $tmpline
    277287  end
    278288  if ($Ndone == $Nhosts)
  • trunk/tools/eam/rawfix.20230221/src/update.bnodes.sh

    r42400 r42404  
    66endif
    77
    8 set options = "-auvn"
     8set options = "-auvn --exclude=trash"
    99if ($2 == "commit") set options = "-auv"
    1010
Note: See TracChangeset for help on using the changeset viewer.