Changeset 27561 for trunk/ippTasks/dist.pro
- Timestamp:
- Apr 1, 2010, 2:59:14 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/dist.pro (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/dist.pro
r27462 r27561 92 92 end 93 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 94 120 95 121 macro set.dist.workdir.by.component 96 # component template default varname 97 if ($0 != 6) 98 echo "USAGE: set.workdir.by.component (stage_id) (componentID) (template) (default) (varname)" 122 if ($0 != 5) 123 echo "USAGE: set.workdir.by.component (stage_id) (componentID) (template) (varname)" 99 124 break 100 125 end 101 126 local host stage_id component default template varname length start count selector component_id random_number 127 102 128 $stage_id = $1 103 129 $component = $2 104 130 $template = $3 105 $default = $4 106 $varname = $5 131 $varname = $4 107 132 if ("$template" == "NULL") 108 133 echo "ERROR: WORKDIR template not set." … … 111 136 book getword ipphosts distribution count -var count 112 137 if ("$count" == "NULL") 113 echo "ERROR: disthosts is empty" 114 break 115 end 138 echo "ERROR: distributin hosts list is empty" 139 break 140 end 141 $host = "foo" 116 142 if ("$component" == "exposure") 117 $selector = $stage_id 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 118 151 else 119 $selector = $component 120 end 121 #echo selector is $selector 122 # take last two letters of selector 123 # treat it as an integer and use modulous of length of distribution hosts 124 # to compute an index into the host table 125 strlen $selector length 126 $start = $length - 2 127 substr $selector $start 2 index 128 $component_id = $index % $count 129 130 #echo component_id is $component_id 131 132 book getword ipphosts distribution $component_id -var host 133 if ("$host" == "NULL") 152 get.host.for.component $component myhost 153 end 154 155 if ("$myhost" == "NULL") 134 156 echo "ERROR: failed to find host for $component" 135 $host = $default 136 end 137 138 #echo host is $host 139 140 strsub $template @HOST@ $host -var $varname 157 break 158 end 159 160 strsub $template @HOST@ $myhost -var $varname 141 161 142 162 #echo template is $template 143 163 #echo outdir is $$varname 144 164 end 145 146 165 147 166 … … 263 282 264 283 265 set.dist.workdir.by.component $DIST_STAGE_ID $COMPONENT $OUTDIR_TEMPLATE ipp047OUTDIR284 set.dist.workdir.by.component $DIST_STAGE_ID $COMPONENT $OUTDIR_TEMPLATE OUTDIR 266 285 if ("$OUTDIR" == "NULL") 267 286 echo ERROR failed to set workdir for $COMPONENT
Note:
See TracChangeset
for help on using the changeset viewer.
