IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 10, 2007, 12:12:35 PM (20 years ago)
Author:
eugene
Message:

first pass on convering queues to books

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_00/ippTasks/phase2.pro

    r11008 r11011  
    11## this file contains the tasks for running the phase 0 stage
     2## these tasks use the book p2PendingImfile
    23
    3 ## these tasks use the queue Phase2Imfiles
    4 ## the Phase2Imfiles queue contains:
    5 ## STATE EXP_TAG CLASS CLASS_ID URI-FITS
    6 ## queue keys are counted from 0
    7 
    8 # XXX change book names to match ippTool values?
    9 # XXX replace with book init p2pending
    10 queueinit Phase2Imfiles
    114if ($?network == 0)
    125  $network = 1
     
    158  $parallel = 0
    169end
    17 
    18 $Phase2ImfileFail = 0
    19 
    2010if ($?VERBOSE == 0)
    2111  echo "VERBOSE not defined: load pantasks.pro first"
     
    2616  break
    2717end
     18
    2819$LOGSUBDIR = $LOGDIR/phase2
    2920exec mkdir -p $LOGSUBDIR
    3021
     22book init p2PendingImfile
     23
    3124macro phase2.status
    32   book listbook p2pending
    33   echo "Phase2ImfileFail: $Phase2ImfileFail"
     25  book listbook p2PendingImfile
    3426end
    3527
    3628# select images ready for phase2 analysis
    37 # new entries are added to queue Phase2Imfiles
    38 # compare the new list with the ones already selected
     29# new entries are added to p2PendingImfile
     30# skip already-present entries
    3931task           phase2.imfile.load
    4032  host         local
     
    4840
    4941  task.exec
    50     # command p2tool -pendingimfile -simple -limit {$Phase2ImfileFail + 20}
    51     # XXX make sure we remove FAIL and TIMEOUT entries
    5242    command p2tool -pendingimfile -limit 20
    5343  end
     
    5545  # success
    5646  task.exit    0
    57     # stdout from the task is stored on queue 'stdout'
    5847    # convert 'stdout' to book format
    59     # only add entries which don't exist in the book
    60     # 'state' has value of NULL
    61     ipptool2book stdout p2pending -key exp_tag:class_id -uniq
     48    ipptool2book stdout p2PendingImfile -key exp_tag:class_id -uniq
    6249    if ($VERBOSE > 2)
    63       book listbook p2pending
     50      book listbook p2PendingImfile
    6451    end
    6552
    6653    # delete existing entries which are DONE
    67     book delpage p2pending -key state DONE
     54    book delpage p2PendingImfile -key state DONE
    6855  end
    6956
     
    7966end
    8067
    81 # run the phase2imfile script on pending images
     68# run the phase2.pl script on pending images
    8269task           phase2.imfile.run
    8370  periods      -poll $runpoll
     
    8673
    8774  task.exec
    88     book npages p2pending -var N
     75    book npages p2PendingImfile -var N
    8976    if ($N == 0) break
    9077    if ($network == 0) break
    9178   
    92     # look for new images on the internal p2pending book
    93     # caution with these 'if' statements: syntax errors
    94     # will make the task fail without given a good status
    95     book getpage p2pending 0 -var pageName -key state NULL
    96     book setword p2pending $pageName state RUN
     79    # look for new images in p2PendingImfile (state == NULL)
     80    book getpage p2PendingImfile 0 -var pageName -key state NULL
     81    if ($pageName == NULL) break
    9782
    98     book getword p2pending $pageName camera -var CAMERA
    99     book getword p2pending $pageName exp_tag -var EXP_TAG
    100     book getword p2pending $pageName class_id -var CLASS_ID
    101     book getword p2pending $pageName uri -var URI
     83    book setword p2PendingImfile $pageName state RUN
     84    book getword p2PendingImfile $pageName camera -var CAMERA
     85    book getword p2PendingImfile $pageName exp_tag -var EXP_TAG
     86    book getword p2PendingImfile $pageName class_id -var CLASS_ID
     87    book getword p2PendingImfile $pageName uri -var URI
    10288
    103     # specify choice of remote host:(need to choose based on chips)
     89    # specify choice of remote host
     90    # XXX need to choose based on chips
    10491    if ($parallel)
    10592      host anyhost
     
    118105    exec mkdir -p $LOGSUBDIR/$base
    119106
    120     # save the p2pending book pageName for future reference below
     107    # save the pageName for future reference below
    121108    options $pageName
    122109
     
    130117  # success
    131118  task.exit 0
    132     # phase2imfile.pl updates DB tables, here we just update the queue
    133     book setword p2pending $options:0 state DONE
    134     # queuepush Phase2Imfiles -replace -key 1:2 "DONE $options:0"
     119    # phase2.pl updates DB tables, here we just update the queue
     120    book setword p2PendingImfile $options:0 state DONE
    135121  end
    136122
     
    138124  task.exit    default
    139125    showcommand failure
    140     book setword p2pending $options:0 state FAIL
    141     # queuepush Phase2Imfiles -replace -key 1:2 "FAIL $options:0"
    142     # drop failed entries from the book lists?
    143     $Phase2ImfileFail ++
     126    book setword p2PendingImfile $options:0 state FAIL
    144127  end
    145128
    146   # operation times out?
     129  # operation timed out?
    147130  task.exit    timeout
    148131    showcommand timeout
    149     book setword p2pending $options:0 state TIMEOUT
    150     # queuepush Phase2Imfiles -replace -key 1:2 "TIMEOUT $options:0"
    151     $Phase2ImfileFail ++
     132    book setword p2PendingImfile $options:0 state TIMEOUT
    152133  end
    153134end
Note: See TracChangeset for help on using the changeset viewer.