IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 15, 2006, 7:14:33 AM (19 years ago)
Author:
eugene
Message:

fixed up logfiles and verbosity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/phase2.pro

    r9506 r10746  
    1414end
    1515
     16$Phase2ImfileFail = 0
     17
     18if ($?VERBOSE == 0)
     19  echo "VERBOSE not defined: load pantasks.pro first"
     20  break
     21end
     22if ($?LOGDIR == 0)
     23  echo "LOGDIR not defined: load pantasks.pro first"
     24  break
     25end
     26$LOGSUBDIR = $LOGDIR/phase2
     27exec mkdir -p $LOGSUBDIR
     28
     29macro phase2.status
     30  queueprint Phase2Imfiles
     31  echo "Phase2ImfileFail: $Phase2ImfileFail"
     32end
     33
    1634# select images ready for phase2 analysis
    1735# new entries are added to queue Phase2Imfiles
    1836# compare the new list with the ones already selected
    1937task           phase2.imfile.load
    20   command      p2tool -pendingimfile -simple
    2138  host         local
    2239
     
    2542  periods      -timeout 30
    2643
    27   stdout phase2.imfile.log
    28   stderr phase2.imfile.log
     44  stdout $LOGSUBDIR/phase2.imfile.log
     45  stderr $LOGSUBDIR/phase2.imfile.log
     46
     47  task.exec
     48    command p2tool -pendingimfile -simple -limit {$Phase2ImfileFail + 20}
     49  end
    2950
    3051  # success
     
    3960    for i 0 $Nqueue
    4061      queuepop stdout -var line
     62      if ($VERBOSE > 2)
     63        echo $line
     64      end
    4165      list word -split $line
    4266      $EXP_TAG  = $word:0
     
    5276  # locked list
    5377  task.exit    default
    54     echo "phase2 pending imfiles: failure"
     78    showcommand failure
    5579  end
    5680
    5781  # operation times out?
    5882  task.exit    timeout
    59     echo "phase2 pending imfiles: timeout"
     83    showcommand timeout
    6084  end
    6185end
     
    96120
    97121    ## add 'p2' to the log files?
    98     $LOG_DIR = `dirname $URI`
    99     stdout $WORKDIR/$LOG_DIR/$EXP_TAG.$CLASS_ID.log
    100     stderr $WORKDIR/$LOG_DIR/$EXP_TAG.$CLASS_ID.log
     122    # XXX this is still a lame rule
     123    $word = `basename $EXP_TAG | tr '.' ' '`
     124    list word -split $word
     125    $base = $word:0
     126    stdout $LOGSUBDIR/$base/$EXP_TAG.$CLASS_ID.log
     127    stderr $LOGSUBDIR/$base/$EXP_TAG.$CLASS_ID.log
     128    exec mkdir -p $LOGSUBDIR/$base
    101129
    102130    # create the command line
    103131    options "$line"
    104     echo command phase2.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI
     132    if ($VERBOSE > 1)
     133      echo command phase2.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI
     134    end
    105135    command phase2.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI
    106136  end
     
    114144  # default exit status
    115145  task.exit    default
    116     echo "failure for phase2imfile.pl: $options:0"
     146    showcommand failure
    117147    queuepush Phase2Imfiles -replace -key 1:2 "FAIL $options:0"
     148    $Phase2ImfileFail ++
    118149  end
    119150
    120151  # operation times out?
    121152  task.exit    timeout
    122     echo "timeout for phase2imfile.pl: $options:0"
     153    showcommand timeout
    123154    queuepush Phase2Imfiles -replace -key 1:2 "TIMEOUT $options:0"
     155    $Phase2ImfileFail ++
    124156  end
    125157end
Note: See TracChangeset for help on using the changeset viewer.