Changeset 42531 for branches/eam_branches/ipp-20230313/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt
- Timestamp:
- Aug 17, 2023, 4:41:34 PM (3 years ago)
- Location:
- branches/eam_branches/ipp-20230313/tools
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
eam/rawfix.20230221/src/rawfix.md5sum.pt (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20230313/tools
- Property svn:mergeinfo changed
/trunk/tools (added) merged: 42411,42415-42417,42429-42430,42440-42447,42449-42455,42457-42460,42462,42464-42465,42467-42468,42485
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20230313/tools/eam/rawfix.20230221/src/rawfix.md5sum.pt
r42405 r42531 12 12 $RAWFIX_MD5SUM_INIT = 1 13 13 end 14 15 $MAX_MD5HOST = 2 14 16 15 17 # select nights which are ready for md5sum calcs … … 35 37 # fields in the table will become words in the page 36 38 queue2book -raw-columns -key dateobs -uniq -setword pantaskState INIT -setword pantasksQuality OK stdout md5sum.book 39 book delpage md5sum.book -key pantaskState DONE 37 40 end 38 41 … … 54 57 # output: md5host.book 55 58 task nights.md5sum.loadhosts 56 57 59 periods -poll $RPOLL 58 60 periods -exec $REXEC 59 61 periods -timeout 60 62 host local 60 63 npending 1 64 # note: the tasks which return their results via stdout 65 # seem to fail if run remotely. 61 66 62 67 stdout $LOGDIR/md5sum.loadhosts.stdout.log … … 77 82 book setword md5sum.book $pageName pantaskState RUN 78 83 book getword md5sum.book $pageName dateobs -var DATEOBS 84 book getword md5sum.book $pageName iter -var ITER 79 85 option $pageName 80 86 # save the page so we can use it below 81 87 88 substr $DATEOBS 0 4 YEAR 89 82 90 # write an entry point in the log for this night 83 sprintf tmpline "%s/%s/ md5sum.runhosts.log" $mypath $DATEOBS91 sprintf tmpline "%s/%s/%s/log.md5sum.runhosts.v%d" $mypath $YEAR $DATEOBS $ITER 84 92 date -var mydate 85 93 exec echo "# start runhosts $mydate" >> $tmpline 86 94 87 command get_hosts_md5s.sh $DATEOBS 95 # the command returns these fields: dateobs stage md5host 96 # NOTE: stage == ITER 97 command get_hosts_md5s.sh $mypath $DATEOBS $ITER 88 98 end 89 99 … … 91 101 # convert the stdout 'queue' to entries in a book 92 102 # fields in the table will become words in the page 103 # queueprint stdout 93 104 queuesize stdout -var Nhosts 94 105 queue2book -raw-columns -key dateobs:md5host -uniq -setword pantaskState INIT stdout md5host.book 95 106 book setword md5sum.book $options:0 NHOST {$Nhosts - 1} 96 107 book setword md5sum.book $options:0 NDONE 0 108 # book list 109 # book listbook md5sum.book 97 110 # use the queuesize (Nhosts) to track how many jobs are done / to be done 98 111 end … … 116 129 end 117 130 131 # runs on the hosts identified by get_hosts_md5s.sh 118 132 # output: md5host.book 119 task nights.md5sum.run hosts133 task nights.md5sum.run 120 134 121 135 periods -poll $RPOLL 122 136 periods -exec $REXEC 123 137 periods -timeout 60 124 125 stdout $LOGDIR/md5sum.runhosts.stdout.log126 stderr $LOGDIR/md5sum.runhosts.stderr.log127 138 128 139 task.exec … … 138 149 if ("$pageName" == "NULL") break 139 150 151 # XXX NOTE: the output field is called 'stage' 140 152 book setword md5host.book $pageName pantaskState RUN 141 153 book getword md5host.book $pageName dateobs -var DATEOBS 154 book getword md5host.book $pageName stage -var ITER 142 155 book getword md5host.book $pageName md5host -var MD5HOST 143 156 144 option $pageName $DATEOBS 157 substr $DATEOBS 0 4 YEAR 158 159 option $pageName $DATEOBS $YEAR 145 160 # save DATEOBS so we can find the md5sum.book entry 146 147 # XXX TEST: $USE_HOST = ipp060 161 # also save YEAR for output log 162 163 # does the output go here? 164 stdout $mypath/$YEAR/$DATEOBS/log.md5sum.$MD5HOST.v$ITER 165 stderr $mypath/$YEAR/$DATEOBS/log.md5sum.$MD5HOST.v$ITER 148 166 149 167 $USE_HOST = $MD5HOST … … 154 172 $host:$USE_HOST = 0 155 173 end 156 if ( not($host:$USE_HOST))174 if ($host:$USE_HOST < $MAX_MD5HOST) 157 175 control host add $USE_HOST 158 $host:$USE_HOST = 1176 $host:$USE_HOST ++ 159 177 end 160 178 161 179 ## even when testing, use the original hostname here: 162 $input = $mypath/$DATEOBS/$MD5HOST.inst. txt180 $input = $mypath/$DATEOBS/$MD5HOST.inst.$ITER.txt 163 181 164 182 # need to make sure this will work on the ipp b-nodes: 165 183 # if we are able to run the 'exec', use a short retry time to launch all outstanding jobs 166 184 periods -exec 0.05 167 command $mypath/get_md5s_instances.pl --hostname $USE_HOST --input $input185 command get_md5s_instances.pl --hostname $USE_HOST --topdir $mypath --dateobs $DATEOBS --stage $ITER 168 186 end 169 187 170 188 task.exit 0 171 nights.md sum.exit OK189 nights.md5sum.exit OK 172 190 end 173 191 174 192 # exit values other than 0: 175 193 task.exit default 176 nights.md sum.exit FAIL194 nights.md5sum.exit FAIL 177 195 showcommand failure 178 196 end 179 197 180 198 task.exit crash 181 nights.md sum.exit CRASH199 nights.md5sum.exit CRASH 182 200 showcommand crash 183 201 end … … 185 203 # operation times out? 186 204 task.exit timeout 187 nights.md sum.exit TIMEOUT205 nights.md5sum.exit TIMEOUT 188 206 showcommand timeout 189 207 end … … 210 228 211 229 # look for completed nights in md5sum.book (pantaskState == DONE) 212 book getpage md5sum.book 0 -var pageName -key pantaskState DONE230 book getpage md5sum.book 0 -var pageName -key pantaskState STOP 213 231 if ("$pageName" == "NULL") break 214 232 … … 232 250 # now that the entry is set to done in the db, remove the pantasks book entry 233 251 echo "cleaning this page: $options:0" 234 book delpage md5sum.book $options:0252 book setword md5sum.book $options:0 pantaskState DONE 235 253 end 236 254 … … 255 273 ######################### UTILITIES ################################# 256 274 257 macro nights.md sum.exit275 macro nights.md5sum.exit 258 276 if ($0 != 2) 259 echo "USAGE: nights.md sum.exit (quality)"277 echo "USAGE: nights.md5sum.exit (quality)" 260 278 break 261 279 end 280 281 # options are : pagename DATEOBS YEAR 262 282 263 283 book setword md5host.book $options:0 pantaskState DONE 264 284 book getword md5sum.book $options:1 NHOST -var Nhosts 265 285 book getword md5sum.book $options:1 NDONE -var Ndone 286 book getword md5sum.book $options:1 stage -var ITER 266 287 $Ndone ++ 267 288 book setword md5sum.book $options:1 NDONE $Ndone 289 290 sprintf tmpline "%s/%s/%s/log.md5sum.runhosts.v%d" $mypath $options:2 $options:1 $ITER 268 291 if ("$1" != "OK") 269 292 book setword md5sum.book $options:1 pantasksQuality $1 270 sprintf tmpline "%s/%s/md5sum.runhosts.log" $mypath $options:1271 293 exec echo "failure $1 $options:0" >> $tmpline 272 294 else … … 274 296 end 275 297 if ($Ndone == $Nhosts) 276 book setword md5sum.book $options:1 pantaskState DONE298 book setword md5sum.book $options:1 pantaskState STOP 277 299 end 278 300 book delpage md5host.book $options:0
Note:
See TracChangeset
for help on using the changeset viewer.
