Changeset 11001
- Timestamp:
- Jan 9, 2007, 2:00:46 PM (19 years ago)
- File:
-
- 1 edited
-
branches/eam_branch_00/ippTasks/phase2.pro (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_00/ippTasks/phase2.pro
r10758 r11001 6 6 ## queue keys are counted from 0 7 7 8 # XXX change book names to match ippTool values? 9 # XXX replace with book init p2pending 8 10 queueinit Phase2Imfiles 9 11 if ($?network == 0) … … 47 49 task.exec 48 50 # command p2tool -pendingimfile -simple -limit {$Phase2ImfileFail + 20} 49 command p2tool -pendingimfile -simple51 command p2tool -pendingimfile 50 52 end 51 53 52 54 # success 53 55 task.exit 0 54 local i Nqueue 55 56 # save stdout and stderr 57 58 # compare output with Phase2Imfiles queue 59 # only add entries which don't exist in queue 60 queuesize stdout -var Nqueue 61 for i 0 $Nqueue 62 queuepop stdout -var line 63 if ($VERBOSE > 2) 64 echo $line 65 end 66 list word -split $line 67 $EXP_TAG = $word:0 68 $CLASS_ID = $word:1 69 $URI = $word:2 70 queuepush Phase2Imfiles -uniq -key 1:2 "NEW $EXP_TAG $CLASS_ID $URI" 56 # convert output to book format 57 # only add entries which don't exist in the book 58 ipptool2book stdout p2pending -key exp_tag:class_id -uniq 59 if ($VERBOSE > 2) 60 book listbook p2pending 71 61 end 72 62 73 63 # delete existing entries which are DONE 74 queuedrop Phase2Imfiles -key 0DONE64 book delpage p2pending -key state DONE 75 65 end 76 66 … … 93 83 94 84 task.exec 95 queuesize Phase2Imfiles -var N 85 # XXX make equiv book command: 86 book npages p2pending -var N 96 87 if ($N == 0) break 97 88 if ($network == 0) break 98 89 99 # look for new images on the internal DetrendImfilesToProcess queue90 # look for new images on the internal p2pending book 100 91 # caution with these 'if' statements: syntax errors 101 92 # will make the task fail without given a good status 102 queuepop Phase2Imfiles -var line -key 0 NEW 103 if ("$line" == "NULL") break 93 # XXX pop off the bottom or the top? 94 book getpage p2pending 0 -var pageName 95 book setword p2pending $pageName status RUN 104 96 105 strpop line state 106 queuepush Phase2Imfiles -replace -key 1:2 "RUN $line" 107 108 ## the Phase2Imfiles queue contains (line has popped STATE) 109 ## STATE EXP_TAG CLASS CLASS_ID URI-FITS 110 list word -split $line 111 $EXP_TAG = $word:0 112 $CLASS_ID = $word:1 113 $URI = $word:2 97 book getword p2pending $pageName exp_tag -var EXP_TAG 98 book getword p2pending $pageName class_id -var CLASS_ID 99 book getword p2pending $pageName uri -var URI 114 100 115 101 # specify choice of remote host:(need to choose based on chips) … … 122 108 ## add 'p2' to the log files? 123 109 # XXX this is still a lame rule 110 # make 'basename' an opihi function? 124 111 $word = `basename $EXP_TAG | tr '.' ' '` 125 112 list word -split $word … … 129 116 exec mkdir -p $LOGSUBDIR/$base 130 117 118 # save the p2pending book pageName for future reference below 119 options $pageName 120 131 121 # create the command line 132 options "$line"133 122 if ($VERBOSE > 1) 134 123 echo command phase2.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI … … 141 130 task.exit 0 142 131 # phase2imfile.pl updates DB tables, here we just update the queue 143 queuepush Phase2Imfiles -replace -key 1:2 "DONE $options:0" 132 book setword p2pending $options:0 status DONE 133 # queuepush Phase2Imfiles -replace -key 1:2 "DONE $options:0" 144 134 end 145 135 … … 147 137 task.exit default 148 138 showcommand failure 149 queuepush Phase2Imfiles -replace -key 1:2 "FAIL $options:0" 139 book setword p2pending $options:0 status FAIL 140 # queuepush Phase2Imfiles -replace -key 1:2 "FAIL $options:0" 150 141 $Phase2ImfileFail ++ 151 142 end … … 154 145 task.exit timeout 155 146 showcommand timeout 156 queuepush Phase2Imfiles -replace -key 1:2 "TIMEOUT $options:0" 147 book setword p2pending $options:0 status TIMEOUT 148 # queuepush Phase2Imfiles -replace -key 1:2 "TIMEOUT $options:0" 157 149 $Phase2ImfileFail ++ 158 150 end
Note:
See TracChangeset
for help on using the changeset viewer.
