Changeset 10067 for trunk/ippTasks
- Timestamp:
- Nov 17, 2006, 4:36:34 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/summit.copy.pro (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/summit.copy.pro
r9357 r10067 1 2 1 ## PanTasks scripts for Summit Copy 3 2 4 # queues: expPending (expID) (URL) (type) (source) 3 if ($?parallel == 0) 4 $parallel = 0 5 end 5 6 6 $LastExpID = "" 7 # queue for summit exps that need to be queried 8 queueinit pzPendingExp 9 # queue for summit imfiles that need to be downloaded 10 queueinit pzPendingImfile 7 11 8 # newImagesPending : search for images to be processed9 task exp.pending10 command getNewExposures $LastExpID12 # run pzgetexp periodically to populate pzPendingExp 13 task pzgetexp 14 command pzgetexp -uri http://otis/ds/skyprobe/ -inst skyprobe -telescope ps1 11 15 host local 12 16 13 17 # timeout shorter than exec so jobs do not build up 14 periods -exec 515 periods -poll 1 16 periods -timeout 418 periods -exec 30 19 periods -poll 10 20 periods -timeout 30 17 21 18 # success 19 task.exit 0 20 local i Nstdout 21 # keep only new, unique entries (URL is key) 22 queuesize stdout -var Nstdout 23 for i 0 $Nstdout 24 queuepop stdout -var line 25 queuepush expPending -uniq -key 0 "$line new" 26 end 22 task.exit 0 23 end 27 24 28 # extract last exposure in list 29 list tmp -split $line 30 $LastExpID = $tmp:0 25 task.exit default 26 echo "phaseZ pzgetexp: failure" 27 end 28 task.exit timeout 29 echo "phaseZ pzgetexp: timeout" 31 30 end 32 31 end 33 32 34 # imfile.pending : get the list imfiles for each exposure35 task imfile.pending36 periods -exec 137 periods -timeout 1033 # build a queue of exps/filesetids that need to be queried 34 task pztool.pendingexp 35 command pztool -pendingexp -simple 36 host local 38 37 39 task.exec40 local Npending41 queuesize expPending -var Npending42 if ($Npending == 0) break38 # timeout shorter than exec so jobs do not build up 39 periods -exec 30 40 periods -poll 10 41 periods -timeout 30 43 42 44 queuepop expPending -var line -key 2 new 45 if ("$line" == "NULL") break 43 # success 44 task.exit 0 45 local i Nstdout 46 queuesize stdout -var Nstdout 47 for i 0 $Nstdout 48 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" 58 end 46 59 47 list tmp -split $line 48 $URL = $tmp:0 49 $expID = $tmp:1 50 $type = $tmp:2 51 $camera = $tmp:3 52 queuepush expPending "$expID $camera run" 60 queuedrop pzPendingExp -key 0 DONE 61 end 53 62 54 host local 55 command getNewImfiles $URL 56 end 57 58 # success 59 task.exit 0 60 local i Nstdout 61 # keep only new, unique entries (URL is key) 62 queuesize stdout -var Nstdout 63 for i 0 $Nstdout 64 queuepop stdout -var line 65 queuepush imfilePending -uniq -key 0 "$line new" 63 task.exit default 64 echo "phaseZ pending exp: failure" 66 65 end 67 end 66 task.exit timeout 67 echo "phaseZ pending exp: timeout" 68 end 68 69 end 69 70 70 # imfile.download : submit download job to the appropriate node 71 task imfile.download 72 periods -exec 1 73 periods -timeout 10 71 # run pzgetimfiles on pending exps 72 task pzgetimfile 73 periods -exec 30 74 periods -poll 10 75 periods -timeout 30 74 76 75 task.exec 76 local Npending 77 queuesize imfilePending -var Npending 78 if ($Npending == 0) break 77 task.exec 78 queuesize pzPendingExp -var N 79 if ($N == 0) break 79 80 80 queuepop imfilePending -var line -key 2 new81 if ("$line" == "NULL") break81 # get a line out of the queue 82 queuepop pzPendingExp -var line -key 0 NEW 82 83 83 list tmp -split $line 84 $URL = $tmp:0 85 $expID = $tmp:1 86 $type = $tmp:2 87 $camera = $tmp:3 88 queuepush imfilePending "$expID $camera run" 84 # take the state out of the line 85 strpop line state 89 86 90 host local 91 command copyImfile $URL 92 end 87 # put the line back into the queue with a stea of RUN 88 queuepush pzPendingExp -replace -key 1:2:3 "RUN $line" 93 89 94 # success 95 task.exit 0 96 local i Nstdout 97 # keep only new, unique entries (URL is key) 98 queuesize stdout -var Nstdout 99 for i 0 $Nstdout 100 queuepop stdout -var line 101 queuepush imfilePending -uniq -key 0 "$line new" 90 # the STATE has already been removed from the line 91 list word -split $line 92 $exp_id = $word:0 93 $camera = $word:1 94 $telescope = $word:2 95 $dateobs = $word:3 96 $exp_type = $word:4 97 $uri = $word:5 98 $imfiles = $word:6 99 100 # specify choice of remote host:(need to choose based on chips) 101 if ($parallel) 102 host anyhost 103 else 104 host local 105 end 106 107 # store the current line 108 options "$line" 109 110 echo command ./pzgetimfiles -uri $uri -filesetid $exp_id -inst $camera -telescope $telescope 111 command ./pzgetimfiles -uri $uri -filesetid $exp_id -inst $camera -telescope $telescope 102 112 end 103 end 113 114 # success 115 task.exit 0 116 queuepush pzPendingExp -replace -key 1:2:3 "DONE $options:0" 117 end 118 119 task.exit default 120 queuepush pzPendingExp -replace -key 1:2:3 "FAIL $options:0" 121 end 122 123 task.exit timeout 124 queuepush pzPendingExp -replace -key 1:2:3 "TIMEOUT $options:0" 125 end 104 126 end 127 128 # build a queue of imfiles/files that need to be downloaded 129 task pztool.pendingimfile 130 command pztool -pendingimfile -simple 131 host local 132 133 # timeout shorter than exec so jobs do not build up 134 periods -exec 30 135 periods -poll 10 136 periods -timeout 30 137 138 # success 139 task.exit 0 140 local i Nstdout 141 queuesize stdout -var Nstdout 142 for i 0 $Nstdout 143 queuepop stdout -var line 144 list word -split $line 145 $exp_id = $word:0 146 $camera = $word:1 147 $telescope = $word:2 148 $bytes = $word:3 149 $md5sum = $word:4 150 $class = $word:5 151 $class_id = $word:6 152 $uri = $word:7 153 queuepush pzPendingImfile -uniq -key 1:2:3:6:7 "NEW $exp_id $camera $telescope $bytes $md5sum $class $class_id $uri" 154 end 155 156 # delete existing entries which are DONE 157 queuedrop pzPendingImfile -key 0 DONE 158 end 159 160 task.exit default 161 echo "phaseZ pending exp: failure" 162 end 163 task.exit timeout 164 echo "phaseZ pending exp: timeout" 165 end 166 end
Note:
See TracChangeset
for help on using the changeset viewer.
