IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 12, 2006, 11:58:21 PM (19 years ago)
Author:
eugene
Message:

added global logdirs, VERBOSE output, failure tracking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/detrend.stack.pro

    r9506 r10692  
    99# detrend_stack.pl 1 0 mc bias
    1010
    11 ## these tasks use the queue DetrendClassIDtoStack
    12 
    13 ## these tasks use the queue DetrendImfilesToProcess
    14 ## the DetrendClassIDtoStack queue contains:
     11## these tasks use the queue DetrendStackClass
     12## the DetrendStackClass queue contains:
    1513## STATE DET_ID ITER TYPE CLASS_ID CAMERA
    1614
     
    2321end
    2422
     23$DetrendStackClassFail = 0
     24
     25if ($?VERBOSE == 0)
     26  echo "VERBOSE not defined: load pantasks.pro first"
     27  break
     28end
     29if ($?LOGDIR == 0)
     30  echo "LOGDIR not defined: load pantasks.pro first"
     31  break
     32end
     33$LOGSUBDIR = $LOGDIR/detrend
     34exec mkdir -p $LOGSUBDIR
     35
     36macro detstack.status
     37  queueprint DetrendStackClass
     38  echo "DetrendStackClassFail: $DetrendStackClassFail"
     39end
     40
    2541# select images ready for copy
    2642# new entries are added to queue DetrendStackClass
    2743# compare the new list with the ones already selected
    2844task           dettool.stack.load
    29   command      dettool -tostacked -simple
    3045  host         local
    3146
     
    3449  periods      -timeout 30
    3550
    36   stdout dettool.stack.log
    37   stderr dettool.stack.log
     51  stdout $LOGSUBDIR/detstack.log
     52  stderr $LOGSUBDIR/detstack.log
     53
     54  task.exec
     55    command dettool -tostacked -simple -limit {$DetrendStackClassFail + 20}
     56  end
    3857
    3958  # success
     
    4665    for i 0 $Nqueue
    4766      queuepop stdout -var line
     67      if ($VERBOSE > 2)
     68        echo $line
     69      end
    4870      list word -split $line
    4971      $DET_ID   = $word:0
     
    6183  # locked list
    6284  task.exit    default
    63     echo       "detrend.stack: failure"
     85    if ($VERBOSE)
     86      echo       "detrend.stack: failure"
     87    end
    6488  end
    6589
    6690  # operation times out?
    6791  task.exit    timeout
    68     echo       "detrend.stack: timeout"
     92    if ($VERBOSE)
     93      echo       "detrend.stack: timeout"
     94    end
    6995  end
    7096end
     
    78104  task.exec
    79105    queuesize DetrendStackClass -var N
    80    
    81106    if ($N == 0) break
    82107    if ($network == 0) break
     
    103128
    104129    # XXX add $WORKDIR/$LOG_DIR
    105     stdout $CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log
    106     stderr $CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log
     130    stdout $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log
     131    stderr $LOGSUBDIR/$CAMERA.$DET_TYPE.$DET_ID.$ITER.$CLASS_ID.log
    107132
    108133    # specify choice of remote host:
     
    115140    # create example job options as a demonstration
    116141    options "$line"
    117     # detrend_stack.pl --det_id 1 --iteration 0 --class_id isp --det_type bias --camera ISP || exit 1
    118     echo command detrend_stack.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA
     142    if ($VERBOSE > 1)
     143      echo command detrend_stack.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA
     144    end
    119145    command detrend_stack.pl --det_id $DET_ID --iteration $ITER --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA
    120146  end
     
    127153  # default exit status
    128154  task.exit    default
    129     queuepush DetrendStackClass -replace -key 1:2:4 "FAIL $options:0"
     155    if ($VERBOSE)
     156      echo "failure detrend_stack.pl $options:0"
     157    end
     158   queuepush DetrendStackClass -replace -key 1:2:4 "FAIL $options:0"
     159   $DetrendStackClassFail ++
    130160  end
    131161
    132162  # operation times out?
    133163  task.exit    timeout
     164    if ($VERBOSE)
     165      echo "failure detrend_stack.pl $options:0"
     166    end
    134167    queuepush DetrendStackClass -replace -key 1:2:4 "TIMEOUT $options:0"
     168    $DetrendStackClassFail ++
    135169  end
    136170end
Note: See TracChangeset for help on using the changeset viewer.