Changeset 26030 for trunk/ippTasks/survey.pro
- Timestamp:
- Nov 4, 2009, 11:34:42 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/survey.pro (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/survey.pro
r25946 r26030 12 12 book create SURVEY_MAGIC 13 13 end 14 book getbook SURVEY_DESTREAK -var isBook 15 if ("$isBook" == "NULL") 16 book create SURVEY_DESTREAK 17 end 18 book getbook SURVEY_DIST -var isBook 19 if ("$isBook" == "NULL") 20 book create SURVEY_DIST 21 end 14 22 15 23 $SURVEY_DIFF_DB = 0 16 24 $SURVEY_MAGIC_DB = 0 25 $SURVEY_DESTREAK_DB = 0 26 $SURVEY_DIST_DB = 0 17 27 18 28 $SURVEY_EXEC = 120 … … 74 84 end 75 85 book listbook SURVEY_MAGIC 86 end 87 88 # user functions to manipulate destreak labels 89 macro survey.add.destreak 90 if ($0 != 3) 91 echo "USAGE: survey.add.destreak (label) (workdir base)" 92 break 93 end 94 book newpage SURVEY_DESTREAK $1 95 book setword SURVEY_DESTREAK $1 WORKDIR $2 96 book setword SURVEY_DESTREAK $1 STATE PENDING 97 end 98 99 macro survey.del.destreak 100 if ($0 != 2) 101 echo "USAGE: survey.del.destreak (label)" 102 break 103 end 104 book delpage SURVEY_DESTREAK $1 105 end 106 107 macro survey.show.destreak 108 if ($0 != 1) 109 echo "USAGE: survey.show.destreak" 110 break 111 end 112 book listbook SURVEY_DESTREAK 113 end 114 115 # user functions to manipulate dist labels 116 macro survey.add.dist 117 if ($0 != 2) 118 echo "USAGE: survey.add.dist (label)" 119 break 120 end 121 book newpage SURVEY_DIST $1 122 book setword SURVEY_DIST $1 STATE PENDING 123 end 124 125 macro survey.del.dist 126 if ($0 != 2) 127 echo "USAGE: survey.del.dist (label)" 128 break 129 end 130 book delpage SURVEY_DIST $1 131 end 132 133 macro survey.show.dist 134 if ($0 != 1) 135 echo "USAGE: survey.show.dist" 136 break 137 end 138 book listbook SURVEY_DIST 76 139 end 77 140 … … 229 292 end 230 293 294 task survey.destreak 295 host local 296 297 periods -poll $SURVEY_POLL 298 periods -exec $SURVEY_EXEC 299 periods -timeout $SURVEY_TIMEOUT 300 npending 1 301 302 active false 303 304 stdout $LOGDIR/survey.destreak.log 305 stderr $LOGDIR/survey.destreak.log 306 307 # generate destreak runs 308 task.exec 309 book npages SURVEY_DESTREAK -var N 310 if ($N == 0) 311 # echo "No labels for processing" 312 break 313 endif 314 315 book getpage SURVEY_DESTREAK 0 -var label -key STATE NEW 316 if ("$label" == "NULL") 317 # All labels have been done --- reset 318 # echo "Resetting labels" 319 for i 0 $N 320 book getpage SURVEY_DESTREAK $i -var label 321 book setword SURVEY_DESTREAK $label STATE NEW 322 end 323 book getpage SURVEY_DESTREAK 0 -var label -key STATE NEW 324 325 # Select different database 326 $SURVEY_DESTREAK_DB ++ 327 if ($SURVEY_DESTREAK_DB >= $DB:n) 328 set $SURVEY_DESTREAK_DB = 0 329 end 330 end 331 332 book setword SURVEY_DESTREAK $label STATE DONE 333 book getword SURVEY_DESTREAK $label WORKDIR -var workdir 334 335 $run = magic_destreak_defineruns.pl --label $label --workdir $workdir/$label/ 336 337 if ($DB:n == 0) 338 option DEFAULT 339 else 340 $run = $run -dbname $DB:$SURVEY_MAGIC_DB 341 option $DB:$SURVEY_MAGIC_DB 342 end 343 344 # echo $run 345 command $run 346 end 347 348 # success 349 task.exit 0 350 # echo "Success" 351 end 352 353 # locked list 354 task.exit default 355 showcommand failure 356 end 357 358 task.exit crash 359 showcommand crash 360 end 361 362 # operation times out? 363 task.exit timeout 364 showcommand timeout 365 end 366 end 367 368 task survey.dist 369 host local 370 371 periods -poll $SURVEY_POLL 372 periods -exec $SURVEY_EXEC 373 periods -timeout $SURVEY_TIMEOUT 374 npending 1 375 376 stdout $LOGDIR/survey.dist.log 377 stderr $LOGDIR/survey.dist.log 378 379 # generate distribution runs 380 task.exec 381 book npages SURVEY_DIST -var N 382 if ($N == 0) 383 # echo "No labels for processing" 384 break 385 endif 386 387 book getpage SURVEY_DIST 0 -var label -key STATE NEW 388 if ("$label" == "NULL") 389 # All labels have been done --- reset 390 # echo "Resetting labels" 391 for i 0 $N 392 book getpage SURVEY_DIST $i -var label 393 book setword SURVEY_DIST $label STATE NEW 394 end 395 book getpage SURVEY_DIST 0 -var label -key STATE NEW 396 397 # Select different database 398 $SURVEY_DIST_DB ++ 399 if ($SURVEY_DIST_DB >= $DB:n) 400 set $SURVEY_DIST_DB = 0 401 end 402 end 403 404 book setword SURVEY_DIST $label STATE DONE 405 406 # note workdir is set by the script based on site.config 407 $run = dist_defineruns.pl --label $label 408 409 if ($DB:n == 0) 410 option DEFAULT 411 else 412 $run = $run --dbname $DB:$SURVEY_DIST_DB 413 option $DB:$SURVEY_DIST_DB 414 end 415 416 # echo $run 417 command $run 418 end 419 420 # success 421 task.exit 0 422 # echo "Success" 423 end 424 425 # locked list 426 task.exit default 427 showcommand failure 428 end 429 430 task.exit crash 431 showcommand crash 432 end 433 434 # operation times out? 435 task.exit timeout 436 showcommand timeout 437 end 438 end
Note:
See TracChangeset
for help on using the changeset viewer.
