Changeset 27838 for branches/tap_branches/ippTasks/dist.pro
- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippTasks/dist.pro (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/ippTasks/dist.pro
r25462 r27838 15 15 $distToAdvance_DB = 0 16 16 $distQueue_DB = 0 17 $dist_revert_DB = 0 17 18 18 19 ### list of stages … … 26 27 list DIST_STAGE -add "diff" 27 28 list DIST_STAGE -add "stack" 29 list DIST_STAGE -add "SSdiff" 28 30 29 31 $currentStage = 0 … … 55 57 active true 56 58 end 59 task dist.revert 60 active false 61 end 57 62 end 58 63 … … 70 75 active false 71 76 end 72 end 77 task dist.revert 78 active false 79 end 80 end 81 82 macro dist.revert.on 83 task dist.revert 84 active true 85 end 86 end 87 88 macro dist.revert.off 89 task dist.revert 90 active false 91 end 92 end 93 94 macro get.host.for.component 95 if ($0 != 3) 96 echo "USAGE: get.host.for.component (componentID) (varname)" 97 break 98 end 99 local component host varname 100 $component = $1 101 $varname = $2 102 substr $component 0 3 COMP_HEAD 103 if ("$COMP_HEAD" == "sky") 104 book getword ipphosts dist_skycell count -var count 105 local j myValue skyhash 106 list word -splitbychar . $component 107 $skyhash = 0 108 for j 0 $word:n 109 inthash $word:$j $count -var myValue 110 $skyhash = $skyhash + $myValue 111 end 112 inthash $skyhash $count -var skyhash 113 sprintf skyname "sky%02d" $skyhash 114 book getword ipphosts dist_skycell $skyname -var host 115 else 116 book getword ipphosts dist_chip $component -var host 117 end 118 $$varname = $host 119 end 120 121 macro set.dist.workdir.by.component 122 if ($0 != 5) 123 echo "USAGE: set.workdir.by.component (stage_id) (componentID) (template) (varname)" 124 break 125 end 126 local host stage_id component default template varname length start count selector component_id random_number 127 128 $stage_id = $1 129 $component = $2 130 $template = $3 131 $varname = $4 132 if ("$template" == "NULL") 133 echo "ERROR: WORKDIR template not set." 134 break 135 end 136 book getword ipphosts distribution count -var count 137 if ("$count" == "NULL") 138 echo "ERROR: distributin hosts list is empty" 139 break 140 end 141 $host = "foo" 142 if ("$component" == "exposure") 143 # take last two letters of selector 144 # treat it as an integer and use modulous of length of distribution hosts 145 # to compute an index into the host table 146 strlen $stage_id length 147 $start = $length - 2 148 substr $stage_id $start 2 index 149 $component_id = $index % $count 150 book getword ipphosts distribution $component_id -var myhost 151 else 152 get.host.for.component $component myhost 153 end 154 155 if ("$myhost" == "NULL") 156 echo "ERROR: failed to find host for $component" 157 break 158 end 159 160 strsub $template @HOST@ $myhost -var $varname 161 162 #echo template is $template 163 #echo outdir is $$varname 164 end 165 73 166 74 167 task dist.process.load … … 165 258 book getword distToProcess $pageName no_magic -var NO_MAGIC 166 259 book getword distToProcess $pageName magicked -var MAGICKED 167 book getword distToProcess $pageName outdir -var OUTDIR 260 book getword distToProcess $pageName alt_path_base -var ALT_PATH_BASE 261 book getword distToProcess $pageName outdir -var OUTDIR_TEMPLATE 168 262 book getword distToProcess $pageName dbname -var DBNAME 169 263 … … 183 277 $EXTRA_ARGS = $EXTRA_ARGS --poor_quality 184 278 end 185 186 # set.host.for.camera $CAMERA $MAGIC_ID 187 # set.workdir.by.camera $CAMERA $MAGIC_ID $WORKDIR_TEMPLATE $default_host WORKDIR 188 # host anyhost 279 if ("$ALT_PATH_BASE" != "") 280 $EXTRA_ARGS = $EXTRA_ARGS --alt_path_base $ALT_PATH_BASE 281 end 282 283 284 set.dist.workdir.by.component $DIST_STAGE_ID $COMPONENT $OUTDIR_TEMPLATE OUTDIR 285 if ("$OUTDIR" == "NULL") 286 echo ERROR failed to set workdir for $COMPONENT 287 break 288 end 189 289 190 290 substr $COMPONENT 0 3 COMP_HEAD … … 283 383 task.exec 284 384 book npages distToAdvance -var N 285 if ($N == 0) break286 385 if ($NETWORK == 0) break 386 if ($N == 0) 387 periods -exec 10 388 break 389 end 390 periods -exec .05 287 391 288 392 # look for new components to process (pantaskState == INIT) … … 294 398 book getword distToAdvance $pageName stage -var STAGE 295 399 book getword distToAdvance $pageName stage_id -var STAGE_ID 296 book getword distToAdvance $pageName outdir -var OUTDIR 400 book getword distToAdvance $pageName outdir -var OUTDIR_TEMPLATE 297 401 book getword distToAdvance $pageName clean -var CLEAN 298 402 book getword distToAdvance $pageName dbname -var DBNAME … … 304 408 host anyhost 305 409 410 # using $DIST_ID as the "component" works fine here since we only look 411 # at the last two digits 412 set.dist.workdir.by.component $STAGE_ID "exposure" $OUTDIR_TEMPLATE OUTDIR 413 if ("$OUTDIR" == "NULL") 414 echo ERROR failed to set workdir for $DIST_ID 415 break 416 end 417 306 418 sprintf logfile "%s/dist.advance.%s.log" $OUTDIR $DIST_ID 307 419 # stdout $logfile … … 332 444 end 333 445 end 446 447 task dist.revert 448 host local 449 450 periods -poll 5.0 451 periods -exec 60.0 452 periods -timeout 120.0 453 npending 1 454 active false 455 456 stdout NULL 457 stderr $LOGDIR/revert.log 458 459 task.exec 460 if ($LABEL:n == 0) break 461 $run = disttool -revertcomponent 462 if ($DB:n == 0) 463 option DEFAULT 464 else 465 # save the DB name for the exit tasks 466 option $DB:$dist_revert_DB 467 $run = $run -dbname $DB:$dist_revert_DB 468 $dist_revert_DB ++ 469 if ($dist_revert_DB >= $DB:n) set dist_revert_DB = 0 470 end 471 add_poll_labels run 472 echo $run 473 command $run 474 end 475 476 # success 477 task.exit 0 478 end 479 480 # locked list 481 task.exit default 482 showcommand failure 483 end 484 485 task.exit crash 486 showcommand crash 487 end 488 489 # operation times out? 490 task.exit timeout 491 showcommand timeout 492 end 493 end
Note:
See TracChangeset
for help on using the changeset viewer.
