Changeset 37835 for trunk/ippTasks/remote.pro
- Timestamp:
- Jan 12, 2015, 12:55:39 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/remote.pro (modified) (27 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/remote.pro
r36972 r37835 5 5 # define chips 6 6 7 book init remotePrepCompRuns 7 8 book init remotePrepRuns 8 9 book init remoteExecRuns … … 10 11 11 12 $remote_label_iter = 0 12 $remote_label_ iter2= 013 $remote_label_warp = 0 13 14 $remote_stage_iter = 0 14 $remoteP_DB = 0 15 $remoteE_DB = 0 16 $remoteL_DB = 0 15 16 $remoteDefine_DB = 0 17 $remoteDefineWarp_DB = 0 18 $remotePrepComp_DB = 0 19 $remotePrep_DB = 0 20 $remoteExec_DB = 0 21 $remotePoll_DB = 0 17 22 18 23 list STAGES … … 21 26 # warp 22 27 stack 28 staticsky 23 29 end 24 30 … … 30 36 active false 31 37 end 38 task remote.prepcomp.load 39 active false 40 end 41 task remote.prepcomp.run 42 active false 43 end 32 44 task remote.prep.load 33 45 active false … … 57 69 active true 58 70 end 71 task remote.prepcomp.load 72 active true 73 end 74 task remote.prepcomp.run 75 active true 76 end 59 77 task remote.prep.load 60 78 active true … … 76 94 end 77 95 end 78 79 96 80 97 task remote.define … … 83 100 periods -exec 300 84 101 periods -timeout 30 102 active true 85 103 npending 1 86 104 … … 94 112 $remote_stage_iter ++ 95 113 114 # loop over all stages x all labels 96 115 if ($remote_stage_iter >= $STAGES:n) 97 116 set remote_stage_iter = 0 … … 101 120 end 102 121 122 # min entry limit? 103 123 $run = remotetool -definebyquery -label $label -stage $stage -path_base neb://@HOST@.0/remote/$label -limit 500 104 124 if ($DB:n == 0) 105 125 option DEFAULT 106 126 else 107 option $DB:$remote P_DB108 $run = $run -dbname $DB:$remote P_DB109 $remote P_DB ++110 if ($remote P_DB >= $DB:n) set remoteP_DB = 0127 option $DB:$remoteDefine_DB 128 $run = $run -dbname $DB:$remoteDefine_DB 129 $remoteDefine_DB ++ 130 if ($remoteDefine_DB >= $DB:n) set remoteDefine_DB = 0 111 131 end 112 132 … … 134 154 host local 135 155 periods -poll $LOADPOLL 136 periods -exec 1800156 periods -exec 900 137 157 periods -timeout 30 158 active true 138 159 npending 1 139 160 … … 142 163 stderr $LOGDIR/remote.define.chip 143 164 144 $label = $LABEL:$remote_label_ iter2145 146 if ($remote_label_ iter >= $LABEL:n) set remote_label_iter= 0147 echo $remote_label_iter$label warp148 149 $run = remotetool -definebyquery -label $label -stage warp -path_base neb://@HOST@.0/remote/$label -limit 50 0165 $label = $LABEL:$remote_label_warp 166 167 if ($remote_label_warp >= $LABEL:n) set remote_label_warp = 0 168 echo $remote_label_warp $label warp 169 170 $run = remotetool -definebyquery -label $label -stage warp -path_base neb://@HOST@.0/remote/$label -limit 50 150 171 if ($DB:n == 0) 151 172 option DEFAULT 152 173 else 153 option $DB:$remote P_DB154 $run = $run -dbname $DB:$remote P_DB155 $remote P_DB ++156 if ($remote P_DB >= $DB:n) set remoteP_DB = 0174 option $DB:$remoteDefineWarp_DB 175 $run = $run -dbname $DB:$remoteDefineWarp_DB 176 $remoteDefineWarp_DB ++ 177 if ($remoteDefineWarp_DB >= $DB:n) set remoteDefineWarp_DB = 0 157 178 end 158 179 … … 161 182 162 183 end 163 # success 184 185 # success 164 186 task.exit 0 165 187 end … … 174 196 task.exit timeout 175 197 showcommand timeout 198 end 199 end 200 201 task remote.prepcomp.load 202 host local 203 periods -poll $LOADPOLL 204 periods -exec $LOADEXEC 205 periods -timeout 30 206 active true 207 npending 1 208 209 task.exec 210 stdout NULL 211 stderr $LOGDIR/remote.prepcomp.load 212 213 $run = remotetool -listcomponent -state new 214 215 if ($DB:n == 0) 216 option DEFAULT 217 else 218 option $DB:$remotePrepComp_DB 219 $run = $run -dbname $DB:$remotePrepComp_DB 220 $remotePrepComp_DB ++ 221 if ($remotePrepComp_DB >= $DB:n) set remotePrepComp_DB = 0 222 end 223 224 add_poll_args run 225 add_poll_labels run 226 command $run 227 end 228 229 # success 230 task.exit 0 231 ipptool2book stdout remotePrepCompRuns -uniq -key remote_id:stage_id -setword dbname $options:0 -setword pantaskState INIT 232 process_cleanup remotePrepCompRuns 233 234 if ($VERBOSE > 2) 235 book listbook remotePrepCompRuns 236 end 237 end 238 # locked list 239 task.exit default 240 showcommand failure 241 end 242 task.exit crash 243 showcommand crash 244 end 245 #operation times out? 246 task.exit timeout 247 showcommand timeout 248 end 249 end 250 251 # run the prep component operations in parallel 252 task remote.prepcomp.run 253 host anyhost 254 periods -poll $RUNPOLL 255 periods -exec $RUNEXEC 256 periods -timeout 600 257 active true 258 259 task.exec 260 # if we are unable to run the 'exec', use a long retry time 261 periods -exec $RUNEXEC 262 263 stdout $LOGDIR/remote.prepcomp.run 264 stderr $LOGDIR/remote.prepcomp.run 265 266 book npages remotePrepCompRuns -var N 267 if ($N == 0) break 268 if ($NETWORK == 0) break 269 270 book getpage remotePrepCompRuns 0 -var pageName -key pantaskState INIT 271 if ("$pageName" == "NULL") break 272 273 book setword remotePrepCompRuns $pageName pantaskState RUN 274 book getword remotePrepCompRuns $pageName remote_id -var REMOTE_ID 275 book getword remotePrepCompRuns $pageName stage_id -var STAGE_ID 276 book getword remotePrepCompRuns $pageName stage -var STAGE 277 book getword remotePrepCompRuns $pageName run_path_base -var RUN_PATH_BASE 278 book getword remotePrepCompRuns $pageName dbname -var DBNAME 279 280 sprintf outroot "%s/remote_%s.%s/stage_%s" $RUN_PATH_BASE $STAGE $REMOTE_ID $STAGE_ID 281 282 if ("$STAGE" == "chip") 283 $command = sc_prepare_chip.pl --camera GPC1 --chip_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME 284 end 285 if ("$STAGE" == "camera") 286 $command = sc_prepare_camera.pl --camera GPC1 --cam_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME 287 end 288 if ("$STAGE" == "warp") 289 $command = sc_prepare_warp.pl --camera GPC1 --warp_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME 290 end 291 if ("$STAGE" == "stack") 292 $command = sc_prepare_stack.pl --camera GPC1 --stack_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME 293 end 294 if ("$STAGE" == "staticsky") 295 $command = sc_prepare_staticsky.pl --camera GPC1 --sky_id $STAGE_ID --remote_id $REMOTE_ID --path_base $outroot -dbname $DBNAME 296 end 297 298 options $pageName 299 300 periods -exec 0.05 301 command $command 302 end 303 304 # default exit status 305 task.exit default 306 process_exit remotePrepCompRuns $options:0 $JOB_STATUS 307 end 308 # locked list 309 task.exit crash 310 process_exit remotePrepCompRuns $options:0 $EXIT_CRASH_ERR 311 end 312 313 # operation timed out? 314 task.exit timeout 315 showcommand timeout 316 book setword remotePrepCompRuns $options:0 pantaskState TIMEOUT 176 317 end 177 318 end … … 181 322 periods -poll $LOADPOLL 182 323 periods -exec 30 324 active true 183 325 npending 1 184 326 … … 187 329 stderr $LOGDIR/remote.prep.load 188 330 189 $run = remotetool - listrun -state new331 $run = remotetool -doneprep -state new 190 332 191 333 if ($DB:n == 0) 192 334 option DEFAULT 193 335 else 194 option $DB:$remoteP _DB195 $run = $run -dbname $DB:$remoteP _DB196 $remoteP _DB ++197 if ($remoteP _DB >= $DB:n) set remoteP_DB = 0336 option $DB:$remotePrep_DB 337 $run = $run -dbname $DB:$remotePrep_DB 338 $remotePrep_DB ++ 339 if ($remotePrep_DB >= $DB:n) set remotePrep_DB = 0 198 340 end 199 341 … … 201 343 command $run 202 344 end 345 203 346 # success 204 347 task.exit 0 … … 230 373 periods -timeout 600000 231 374 active true 232 npending 1 0375 npending 1 233 376 234 377 task.exec … … 247 390 book getword remotePrepRuns $pageName stage -var STAGE 248 391 book getword remotePrepRuns $pageName path_base -var PATH_BASE 249 # book getword remotePrepRuns $pageName label -var LABEL392 # book getword remotePrepRuns $pageName label -var LABEL 250 393 book getword remotePrepRuns $pageName dbname -var DBNAME 251 394 252 395 sprintf outroot "%s/remote_%s.%s" $PATH_BASE $STAGE $REMOTE_ID 253 396 254 if ("$STAGE" == "chip") 255 $command = sc_prepare_chip.pl --camera GPC1 --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME 256 end 257 if ("$STAGE" == "camera") 258 $command = sc_prepare_camera.pl --camera GPC1 --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME 259 end 260 if ("$STAGE" == "warp") 261 $command = sc_prepare_warp.pl --camera GPC1 --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME 262 end 263 if ("$STAGE" == "stack") 264 $command = sc_prepare_stack.pl --camera GPC1 --remote_id $REMOTE_ID --path_base $outroot --dbname $DBNAME 265 end 397 $command = sc_prepare_run.pl --camera GPC1 --remote_id $REMOTE_ID --stage $STAGE --path_base $outroot --dbname $DBNAME 266 398 267 399 options $pageName … … 284 416 end 285 417 end 286 287 418 288 419 task remote.exec.load … … 290 421 periods -poll $LOADPOLL 291 422 periods -exec $LOADEXEC 423 active false 292 424 npending 1 293 425 … … 303 435 option DEFAULT 304 436 else 305 option $DB:$remoteE _DB306 $run = $run -dbname $DB:$remoteE _DB307 $remoteE _DB ++308 if ($remoteE _DB >= $DB:n) set remoteE_DB = 0437 option $DB:$remoteExec_DB 438 $run = $run -dbname $DB:$remoteExec_DB 439 $remoteExec_DB ++ 440 if ($remoteExec_DB >= $DB:n) set remoteExec_DB = 0 309 441 end 310 442 … … 340 472 periods -exec 30 341 473 periods -timeout 6000000 342 active true474 active false 343 475 npending 3 344 476 … … 386 518 end 387 519 388 389 520 task remote.poll.load 390 521 host local 391 522 periods -poll $LOADPOLL 392 periods -exec $LOADEXEC 523 periods -exec 300 524 active false 393 525 npending 1 394 526 … … 397 529 stderr $LOGDIR/remote.poll.load 398 530 399 $end_date = `date +%Y-%m-%dT%H:%M:%S -d '1 hour ago'` 400 $run = remotetool -listrun -state run -poll_end $end_date 531 # $end_date = `date +%Y-%m-%dT%H:%M:%S -d '1 hour ago'` 532 # $run = remotetool -listrun -state run -poll_end $end_date 533 $run = remotetool -listrun -state run 401 534 402 535 if ($DB:n == 0) 403 536 option DEFAULT 404 537 else 405 option $DB:$remote L_DB406 $run = $run -dbname $DB:$remote L_DB407 $remote L_DB ++408 if ($remote L_DB >= $DB:n) set remoteL_DB = 0538 option $DB:$remotePoll_DB 539 $run = $run -dbname $DB:$remotePoll_DB 540 $remotePoll_DB ++ 541 if ($remotePoll_DB >= $DB:n) set remotePoll_DB = 0 409 542 end 410 543 … … 412 545 command $run 413 546 end 547 414 548 # success 415 549 task.exit 0 … … 440 574 periods -exec 30 441 575 periods -timeout 6000000 442 active true443 npending 3576 active false 577 npending 10 444 578 445 579 task.exec … … 466 600 # This can't have an invalid job_id 467 601 if ($JOB_ID == -1) break 468 $command = sc_remote_ exec.pl --remote_id $REMOTE_ID --path_base $outroot --verbose --dbname $DBNAME --camera GPC1 --poll--job_id $JOB_ID602 $command = sc_remote_poll.pl --remote_id $REMOTE_ID --path_base $outroot --verbose --dbname $DBNAME --camera GPC1 --job_id $JOB_ID 469 603 470 604 options $pageName
Note:
See TracChangeset
for help on using the changeset viewer.
