|
3 | 3 | #--------------------------------------------------------------------------- |
4 | 4 | # minmon_xtrct_costs.pl |
5 | 5 | # |
6 | | -# Extract cost data from gsistat file and load into cost |
| 6 | +# Extract cost data from gsistat file and load into cost |
7 | 7 | # and cost term files. |
8 | 8 | #--------------------------------------------------------------------------- |
9 | 9 |
|
|
63 | 63 | my $jl_number = 8; |
64 | 64 |
|
65 | 65 | my $costfile = $ENV{"mm_costfile"}; |
66 | | - |
| 66 | + |
67 | 67 | if( (-e $costfile) ) { |
68 | 68 | open( COSTFILE, "<${costfile}" ) or die "Can't open ${costfile}: $!\n"; |
69 | 69 | my $line; |
|
87 | 87 |
|
88 | 88 | #------------------------------------------------------------------------ |
89 | 89 | # Open the infile and search for the $costterms_target and $cost_target |
90 | | - # strings. If found, parse out the cost information and push into |
| 90 | + # strings. If found, parse out the cost information and push into |
91 | 91 | # holding arrays. |
92 | 92 | #------------------------------------------------------------------------ |
93 | 93 | if( $rc == 0 ) { |
|
107 | 107 | $use_costterms = 1; |
108 | 108 | } |
109 | 109 |
|
110 | | - if( $line =~ /$cost_target/ ) { |
| 110 | + if( $line =~ /$cost_target/ ) { |
111 | 111 | my @costline = split( / +/, $line ); |
112 | 112 | push( @cost_array, $costline[$cost_number] ); |
113 | 113 | } |
114 | 114 |
|
115 | 115 | if( $term_ctr > 0 ) { |
116 | 116 | my @termline = split( / +/, $line ); |
117 | | - |
| 117 | + |
118 | 118 | if ( $term_ctr < 10 ) { |
119 | 119 | push( @term_array, trim($termline[1]) ); |
120 | 120 | push( @term_array, trim($termline[2]) ); |
|
132 | 132 | push( @term_array, trim($termline[3]) ); |
133 | 133 | push( @term_array, trim($termline[4]) ); |
134 | 134 | $term_ctr = 1; |
135 | | - } |
| 135 | + } |
136 | 136 | } |
137 | 137 |
|
138 | 138 | close( INFILE ); |
|
145 | 145 | for my $i (0 .. $#cost_array) { |
146 | 146 | my $iterline; |
147 | 147 | if( $use_costterms == 1 ){ |
148 | | - $iterline = sprintf ' %d,%e,%e,%e,%e,%e%s', |
149 | | - $i, $cost_array[$i], $jb_array[$i], $jo_array[$i], |
| 148 | + $iterline = sprintf ' %d,%e,%e,%e,%e,%e%s', |
| 149 | + $i, $cost_array[$i], $jb_array[$i], $jo_array[$i], |
150 | 150 | $jc_array[$i], $jl_array[$i], "\n"; |
151 | 151 | } |
152 | 152 | else { |
153 | | - $iterline = sprintf ' %d,%e,%e,%e,%e,%e%s', |
154 | | - $i, $cost_array[$i], $no_data, $no_data, |
| 153 | + $iterline = sprintf ' %d,%e,%e,%e,%e,%e%s', |
| 154 | + $i, $cost_array[$i], $no_data, $no_data, |
155 | 155 | $no_data, $no_data, "\n"; |
156 | 156 | } |
157 | 157 |
|
|
161 | 161 | #--------------------------------------------------- |
162 | 162 | # move term_array into all_cost_terms by iteration |
163 | 163 | #--------------------------------------------------- |
164 | | - if( @term_array > 0 ) { |
| 164 | + if( @term_array > 0 ) { |
165 | 165 | my $nterms = 32; |
166 | 166 | my $max_iter = ($#term_array+1)/$nterms; |
167 | 167 | my $niter = $max_iter -1; |
|
170 | 170 | my $step = $iter * $nterms; |
171 | 171 | my $iterline = sprintf '%d, %e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e,%e%s', |
172 | 172 | $iter, $term_array[$step], $term_array[$step+1], $term_array[$step+2], |
173 | | - $term_array[$step+3], $term_array[$step+4], $term_array[$step+5], |
174 | | - $term_array[$step+6], $term_array[$step+7], $term_array[$step+8], |
175 | | - $term_array[$step+9], $term_array[$step+10], $term_array[$step+11], |
176 | | - $term_array[$step+12], $term_array[$step+13], $term_array[$step+14], |
177 | | - $term_array[$step+15], $term_array[$step+16], $term_array[$step+17], |
178 | | - $term_array[$step+18], $term_array[$step+19], $term_array[$step+20], |
179 | | - $term_array[$step+21], $term_array[$step+22], $term_array[$step+23], |
180 | | - $term_array[$step+24], $term_array[$step+25], $term_array[$step+26], |
181 | | - $term_array[$step+27], $term_array[$step+28], $term_array[$step+29], |
| 173 | + $term_array[$step+3], $term_array[$step+4], $term_array[$step+5], |
| 174 | + $term_array[$step+6], $term_array[$step+7], $term_array[$step+8], |
| 175 | + $term_array[$step+9], $term_array[$step+10], $term_array[$step+11], |
| 176 | + $term_array[$step+12], $term_array[$step+13], $term_array[$step+14], |
| 177 | + $term_array[$step+15], $term_array[$step+16], $term_array[$step+17], |
| 178 | + $term_array[$step+18], $term_array[$step+19], $term_array[$step+20], |
| 179 | + $term_array[$step+21], $term_array[$step+22], $term_array[$step+23], |
| 180 | + $term_array[$step+24], $term_array[$step+25], $term_array[$step+26], |
| 181 | + $term_array[$step+27], $term_array[$step+28], $term_array[$step+29], |
182 | 182 | $term_array[$step+30], $term_array[$step+31], "\n"; |
183 | 183 | push( @all_cost_terms, $iterline ); |
184 | | - } |
| 184 | + } |
185 | 185 | } |
186 | 186 |
|
187 | 187 | #------------------------------------------ |
|
210 | 210 | my $tankdir = $ENV{"M_TANKverf"}; |
211 | 211 | if(! -d $tankdir) { |
212 | 212 | system( "mkdir -p $tankdir" ); |
213 | | - } |
| 213 | + } |
214 | 214 |
|
215 | 215 | if( -e $filename2 ) { |
216 | 216 | my $newfile2 = "${tankdir}/${filename2}"; |
217 | | - system("cp -f $filename2 $newfile2"); |
| 217 | + system("cpfs $filename2 $newfile2"); |
218 | 218 | } |
219 | 219 | if( -e $filename3 ) { |
220 | 220 | my $newfile3 = "${tankdir}/${filename3}"; |
221 | | - system("cp -f $filename3 $newfile3"); |
| 221 | + system("cpfs $filename3 $newfile3"); |
222 | 222 | } |
223 | 223 |
|
224 | 224 | } # $rc still == 0 after reading gmon_cost.txt |
|
0 commit comments