IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

added global logdirs, VERBOSE output, failure tracking

File:
1 edited

Legend:

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

    r10542 r10692  
    2222end
    2323
     24$DetrendProcessImfileFail = 0
     25$DetrendProcessExpFail = 0
     26
     27if ($?VERBOSE == 0)
     28  echo "VERBOSE not defined: load pantasks.pro first"
     29  break
     30end
     31if ($?LOGDIR == 0)
     32  echo "LOGDIR not defined: load pantasks.pro first"
     33  break
     34end
     35$LOGSUBDIR = $LOGDIR/detrend
     36exec mkdir -p $LOGSUBDIR
     37
     38macro detproc.status
     39  queueprint DetrendProcessImfiles
     40  queueprint DetrendProcessExposures
     41  echo "DetrendProcessImfileFail: $DetrendProcessImfileFail"
     42  echo "DetrendProcessExpFail: $DetrendProcessExpFail"
     43end
     44
    2445# select images ready for copy
    2546# new entries are added to queue DetrendProcessImfiles
    2647# compare the new list with the ones already selected
    2748task           dettool.process.load
    28   command      dettool -toprocessedimfile -simple
    2949  host         local
    3050
     
    3353  periods      -timeout 30
    3454
    35   stdout dettool.process.log
    36   stderr dettool.process.log
     55  stdout $LOGSUBDIR/detproc.imfile.log
     56  stderr $LOGSUBDIR/detproc.imfile.log
     57
     58  task.exec
     59    command dettool -toprocessedimfile -simple -limit {$DetrendProcessImfileFail + 20}
     60  end
    3761
    3862  # success
     
    4771    for i 0 $Nqueue
    4872      queuepop stdout -var line
     73      if ($VERBOSE > 2)
     74        echo $line
     75      end
    4976      list word -split $line
    5077      $DET_ID   = $word:0
     
    6491  # error
    6592  task.exit    default
    66     echo       "detrend.process: failure"
     93    if ($VERBOSE)
     94      echo       "detrend.process: failure"
     95    end
    6796  end
    6897
    6998  # operation times out?
    7099  task.exit    timeout
    71     echo       "detrend.process: timeout"
     100    if ($VERBOSE)
     101      echo       "detrend.process: timeout"
     102    end
    72103  end
    73104end
     
    105136    $CAMERA   = $word:6
    106137
    107     $LOG_DIR = `dirname $URI`
    108     stdout $WORKDIR/$LOG_DIR/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
    109     stderr $WORKDIR/$LOG_DIR/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
     138    $word = `basename $EXP_TAG | tr '.' ' '`
     139    list word -split $word
     140    $base = $word:0
     141    stdout $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
     142    stderr $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
     143    exec mkdir -p $LOGSUBDIR/$base
    110144
    111145    # specify choice of remote host:
     
    118152    # create example job options as a demonstration
    119153    options "$line"
    120     echo command detrend_process_imfile.pl --det_id $DET_ID --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI --camera $CAMERA
     154    if ($VERBOSE > 1)
     155      echo command detrend_process_imfile.pl --det_id $DET_ID --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI --camera $CAMERA
     156    end
    121157    command detrend_process_imfile.pl --det_id $DET_ID --exp_tag $EXP_TAG --class $CLASS --class_id $CLASS_ID --det_type $DET_TYPE --input_uri $URI --camera $CAMERA
    122158  end
     
    130166  # default exit status
    131167  task.exit    default
    132     echo "failure detrend_process_imfile.pl $options:0"
     168    if ($VERBOSE)
     169      echo "failure detrend_process_imfile.pl $options:0"
     170    end
    133171    queuepush DetrendProcessImfiles -replace -key 1:3:5 "FAIL $options:0"
     172    $DetrendProcessImfileFail ++
    134173  end
    135174
    136175  # operation times out?
    137176  task.exit    timeout
    138     echo "timeout detrend_process_imfile.pl $options:0"
    139     queuepush DetrendProcessImfiles -replace -key 1:3:5 "TIMEOUT $options:0"
    140   end
     177    if ($VERBOSE)
     178      echo "timeout detrend_process_imfile.pl $options:0"
     179    end
     180    queuepush DetrendProcessImfiles -replace -key 1:3:5 "TIMEOUT $options:0"
     181    $DetrendProcessImfileFail ++
     182 end
    141183end
    142184
     
    145187# compare the new list with the ones already selected
    146188task           dettool.processexp.load
    147   command      dettool -toprocessedexp -simple
    148189  host         local
    149190
     
    152193  periods      -timeout 30
    153194
    154   stdout dettool.processexp.log
    155   stderr dettool.processexp.log
     195  stdout $LOGSUBDIR/detproc.exp.log
     196  stderr $LOGSUBDIR/detproc.exp.log
     197
     198  task.exec
     199    command dettool -toprocessedexp -simple -limit {$DetrendProcessExpFail + 20}
     200  end
    156201
    157202  # success
     
    166211    for i 0 $Nqueue
    167212      queuepop stdout -var line
     213      if ($VERBOSE > 2)
     214        echo $line
     215      end
    168216      list word -split $line
    169217      $DET_ID   = $word:0
     
    181229  # error
    182230  task.exit    default
    183     echo       "detrend.process: failure"
     231    if ($VERBOSE)
     232      echo       "detrend.process: failure"
     233    end
    184234  end
    185235
    186236  # operation times out?
    187237  task.exit    timeout
    188     echo       "detrend.process: timeout"
     238    if ($VERBOSE)
     239      echo       "detrend.process: timeout"
     240    end
    189241  end
    190242end
     
    210262    queuepush DetrendProcessExposures -replace -key 1:2:4 "RUN $line"
    211263
    212 
    213264    list word -split $line
    214265    $DET_ID   = $word:0
     
    218269    $CAMERA   = $word:4
    219270
    220     # XXX need the classID in dettool -toprocessedexp -simple output
    221     $CLASS_ID = isp
    222     stdout $EXP_TAG.detproc.$DET_ID.log
    223     stderr $EXP_TAG.detproc.$DET_ID.log
     271    # XXX this is still a lame rule
     272    $word = `basename $EXP_TAG | tr '.' ' '`
     273    list word -split $word
     274    $base = $word:0
     275
     276    stdout $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.log
     277    stderr $LOGSUBDIR/$base/$EXP_TAG.detproc.$DET_ID.log
     278    exec mkdir -p $LOGSUBDIR/$base
    224279
    225280    # specify choice of remote host:
     
    232287    # create example job options as a demonstration
    233288    options "$line"
    234     echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
     289    if ($VERBOSE > 1)
     290      echo command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
     291    end
    235292    command detrend_process_exp.pl --det_id $DET_ID --exp_tag $EXP_TAG --camera $CAMERA
    236293  end
     
    243300  # default exit status
    244301  task.exit    default
     302    if ($VERBOSE)
     303      echo "failure for detrend_process_exp.pl: $options:0"
     304    end
    245305    queuepush DetrendProcessExposures -replace -key 1:2:4 "FAIL $options:0"
     306    $DetrendProcessExpFail ++
    246307  end
    247308
    248309  # operation times out?
    249310  task.exit    timeout
     311    if ($VERBOSE)
     312      echo "failure for detrend_process_exp.pl: $options:0"
     313    end
    250314    queuepush DetrendProcessExposures -replace -key 1:2:4 "TIMEOUT $options:0"
    251   end
    252 end
     315    $DetrendProcessExpFail ++
     316  end
     317end
Note: See TracChangeset for help on using the changeset viewer.