Changeset 10416
- Timestamp:
- Dec 1, 2006, 5:19:23 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/summit.copy.pro (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/summit.copy.pro
r10067 r10416 1 1 ## PanTasks scripts for Summit Copy 2 3 $uri = http://otis/ds/skyprobe/ 4 $camera = skyprobe 5 $telescope = ps1 6 $workdir = /home/moanui/jhoblitt/workdir 2 7 3 8 if ($?parallel == 0) … … 9 14 # queue for summit imfiles that need to be downloaded 10 15 queueinit pzPendingImfile 16 # queue for downloaded files that need to registered with pztool -copydone 17 queueinit pzCopyDone 11 18 12 19 # run pzgetexp periodically to populate pzPendingExp 13 20 task pzgetexp 14 command pzgetexp -uri http://otis/ds/skyprobe/ -inst skyprobe -telescope ps121 command pzgetexp -uri $uri -inst $camera -telescope $telescope 15 22 host local 16 23 … … 47 54 for i 0 $Nstdout 48 55 queuepop stdout -var line 49 list word -split $line 50 $exp_id = $word:0 51 $camera = $word:1 52 $telescope = $word:2 53 $dateobs = $word:3 54 $exp_type = $word:4 55 $uri = $word:5 56 $imfiles = $word:6 57 queuepush pzPendingExp -uniq -key 1:2:3 "NEW $uri $exp_id $camera $telescope $dateobs exp_type $uri $imfiles" 56 # list word -split $line 57 # $exp_id = $word:0 58 # $camera = $word:1 59 # $telescope = $word:2 60 # $dateobs = $word:3 61 # $exp_type = $word:4 62 # $uri = $word:5 63 # $imfiles = $word:6 64 # queuepush pzPendingExp -uniq -key 1:2:3 "NEW $uri $exp_id $camera $telescope $dateobs $exp_type $uri $imfiles" 65 queuepush pzPendingExp -uniq -key 1:2:3 "NEW $line" 58 66 end 59 67 … … 71 79 # run pzgetimfiles on pending exps 72 80 task pzgetimfile 73 periods -exec 3074 periods -poll 1075 periods -timeout 3081 periods -exec 5 82 periods -poll 5 83 periods -timeout 15 76 84 77 85 task.exec … … 99 107 100 108 # specify choice of remote host:(need to choose based on chips) 101 if ($parallel)102 host anyhost103 else104 host local105 end109 # if ($parallel) 110 # host anyhost 111 # else 112 # host local 113 # end 106 114 107 115 # store the current line 108 116 options "$line" 109 117 110 echo command ./pzgetimfiles -uri $uri -filesetid $exp_id -inst $camera -telescope $telescope111 command ./pzgetimfiles -uri $uri -filesetid $exp_id -inst $camera -telescope $telescope118 echo command pzgetimfiles -uri $uri -filesetid $exp_id -inst $camera -telescope $telescope 119 command pzgetimfiles -uri $uri -filesetid $exp_id -inst $camera -telescope $telescope 112 120 end 113 121 … … 151 159 $class_id = $word:6 152 160 $uri = $word:7 153 queuepush pzPendingImfile -uniq -key 1:2:3:6:7 "NEW $exp_id $camera $telescope $bytes $md5sum $class $class_id $uri" 161 162 queuepush pzPendingImfile -uniq -key 1:2:3:6:7 "NEW $line" 154 163 end 155 164 … … 165 174 end 166 175 end 176 177 # get dsget to retreive an imfile and then call pztool -copydone 178 task dsget 179 periods -exec 5 180 periods -poll 5 181 periods -timeout 30 182 183 task.exec 184 queuesize pzPendingImfile -var N 185 if ($N == 0) break 186 187 # get a line out of the queue 188 queuepop pzPendingImfile -var line -key 0 NEW 189 190 # take the state out of the line 191 strpop line state 192 193 # put the line back into the queue with a stea of RUN 194 queuepush pzPendingImfile -replace -key 1:2:3:6:7 "RUN $line" 195 196 # the STATE has already been removed from the line 197 list word -split $line 198 $exp_id = $word:0 199 $camera = $word:1 200 $telescope = $word:2 201 $bytes = $word:3 202 $md5sum = $word:4 203 $class = $word:5 204 $class_id = $word:6 205 $uri = $word:7 206 207 # # specify choice of remote host:(need to choose based on chips) 208 # if ($parallel) 209 # host anyhost 210 # else 211 # host local 212 # end 213 214 # store the current line without the state 215 options "$line" 216 217 echo "parsing line $line" 218 echo command dsget --uri $uri --filename $workdir/$exp_id.$class_id.fits --bytes $bytes --md5 $md5sum 219 command dsget --uri $uri --filename $workdir/$exp_id.$class_id.fits --bytes $bytes --md5 $md5sum 220 end 221 222 # success 223 task.exit 0 224 # could run copydone from here but how would the exit status be 225 # handled? 226 227 list word -split $line 228 $exp_id = $word:0 229 $camera = $word:1 230 $telescope = $word:2 231 $bytes = $word:3 232 $md5sum = $word:4 233 $class = $word:5 234 $class_id = $word:6 235 $uri = $word:7 236 queuepush pzCopyDone -key 1:2:3:6:7 "NEW $exp_id $camera $telescope $bytes $md5sum $class $class_id $workdir/$exp_id.$class_id.fits" 237 queuepush pzPendingExp -replace -key 1:2:3:6:7 "DONE $options:0" 238 end 239 240 task.exit default 241 queuepush pzPendingExp -replace -key 1:2:3:6:7 "FAIL $options:0" 242 end 243 244 task.exit timeout 245 queuepush pzPendingExp -replace -key 1:2:3:6:7 "TIMEOUT $options:0" 246 end 247 end 248 249 task pztool.copydone 250 periods -exec 5 251 periods -poll 5 252 periods -timeout 15 253 254 host local 255 256 task.exec 257 queuesize pzCopyDone -var N 258 if ($N == 0) break 259 260 # get a line out of the queue 261 queuepop pzCopyDone -var line -key 0 NEW 262 263 # take the state out of the line 264 strpop line state 265 266 # put the line back into the queue with a stea of RUN 267 queuepush pzCopyDone -replace -key 1:2:3:6:7 "RUN $line" 268 269 # the STATE has already been removed from the line 270 list word -split $line 271 $exp_id = $word:0 272 $camera = $word:1 273 $telescope = $word:2 274 $bytes = $word:3 275 $md5sum = $word:4 276 $class = $word:5 277 $class_id = $word:6 278 $uri = $word:7 279 280 # store the current line without the state 281 options "$line" 282 283 local cmd 284 $cmd = pztool -copydone -exp_id $exp_id -inst $camera -telescope $telescope -class $class -class_id $class_id -uri $uri 285 echo command $cmd 286 command $cmd 287 end 288 289 # success 290 task.exit 0 291 queuepush pzCopyDone -replace -key 1:2:3:6:7 "DONE $options:0" 292 end 293 294 task.exit default 295 queuepush pzCopyDone -replace -key 1:2:3:6:7 "FAIL $options:0" 296 end 297 298 task.exit timeout 299 queuepush pzCopyDone -replace -key 1:2:3:6:7 "TIMEOUT $options:0" 300 end 301 end
Note:
See TracChangeset
for help on using the changeset viewer.
