IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6180


Ignore:
Timestamp:
Jan 22, 2006, 10:04:22 AM (20 years ago)
Author:
eugene
Message:

updated to work with p2tools

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/doc/p2tools.sh

    r6021 r6180  
    55#
    66# queues:
    7 #   p2pending: (url) (expID) (cameraID) (chipID) (state)
     7#   p2pending: expID class classID url
    88#
    99# globals:
    1010
     11queueinit stdout
     12queueinit stderr
     13queueinit p2pending
     14
     15macro p2parse
     16  if ($0 != 7)
     17    echo "usage: p2parse (key) (expID) (class) (classID) (url) (state)"
     18    break
     19  end
     20  $expID   = $2
     21  $class   = $3
     22  $classID = $4
     23  $url     = $5
     24  $key     = $expID.$classID
     25end
     26
    1127# p2pending : search for images to be processed
    1228task           p2pending
    13   command      p2search -pending
     29  command      p2search.sh -pending
    1430  host         local
    1531
     
    2238  task.exit    0
    2339    local i Nstdout
     40
     41    # pop off the header line
     42    queuepop stdout
     43
    2444    # keep only new, unique entries (URL is key)
    2545    queuesize stdout -var Nstdout
    2646    for i 0 $Nstdout
    2747      queuepop stdout -var line
    28       queuepush p2pending -uniq -key 0 "$line new"
     48      p2parse unknown $line new
     49      queuepush p2pending -uniq -key 0 "$key $line new"
    2950    end
     51    echo "loaded p2pending, current state:"
     52    queueprint p2pending
    3053  end
    3154end
     
    3356# ppImage : submit an image for processing by ppImage
    3457task           ppImage
    35   periods      -exec 0.1
     58  periods      -exec 1
    3659  periods      -timeout 120
    3760
     
    4467    # if ($network == 0) break
    4568   
    46     queuepop p2pending -var line -key 4 new
     69    queuepop p2pending -var line -key 5 new
    4770    if ("$line" == "NULL") break
     71    p2parse $line
    4872
    49     list tmp -split $line
    50     $url    = $tmp:0
    51     $expID  = $tmp:1
    52     $camera = $tmp:2
    53     $chip   = $tmp:3
    54     queuepush p2pending "$url $expID $camera $chip run"
     73    echo "new ppImaage: $key $expID $class $classID $url run"
     74    queuepush p2pending "$key $expID $class $classID $url run"
    5575
    5676    # need to decide real name for this function
    57     $host = `chip.host $camera $chip`
    58     host $host
    59     command ppImage $url $chip
     77    # $host = `chip.host $camera $chip`
     78    # host $host
     79
     80    host local
     81    echo command ppImage.sh $key $url $classID
     82    command ppImage.sh $key $url $classID
    6083  end
    6184
     
    6386  task.exit    0
    6487    # if ppImage updates the DB:
     88    echo "done with $taskarg:1"
    6589    queueinit stdout
    66     queuepush p2pending $taskargs:0 $taskargs:1 $taskargs:2 $taskargs:3 done
     90    queuepop p2pending -key 0 $taskarg:1 -var line
     91    echo "got line: $line"
     92
     93    if ("$line" == "NULL")
     94      echo "missing entry in p2pending queue?"
     95      break
     96    end
     97
     98    p2parse $line
     99    queuepush p2pending "$key $expID $class $classID $url done"
     100    echo queuepush p2pending "$key $expID $class $classID $url done"
    67101   
    68102    # if ppImage does NOT update the DB:
    69     queueinit stdout
    70     exec p2search -done $taskargs:0 $taskargs:1 $taskargs:2
    71     queuepush p2pending $taskargs:0 $taskargs:1 $taskargs:2 $taskargs:3 done
    72103  end
    73104
     
    80111
    81112  # timeout shorter than exec so jobs do not build up
    82   periods      -exec     5
     113  periods      -exec     100
    83114  periods      -poll     1
    84115  periods      -timeout  4
     116
     117  # task is never allowed to run
     118  task.exec
     119    break
     120  end
    85121end
    86122
     
    91127
    92128  # timeout shorter than exec so jobs do not build up
    93   periods      -exec     5
     129  periods      -exec     100
    94130  periods      -poll     1
    95131  periods      -timeout  4
     132
     133  # task is never allowed to run
     134  task.exec
     135    break
     136  end
    96137end
    97 
Note: See TracChangeset for help on using the changeset viewer.