Changeset 27559 for gs2-extensions/parallel-building/trunk/src
- Timestamp:
- 2013-06-06T11:15:28+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/parallel-building/trunk/src/bin/script/generate_gantt.pl
- Property svn:mime-type deleted
r27551 r27559 60 60 my $stop = $parts[4]; 61 61 my $filepath = $parts[8]; 62 $filepath =~ s/^\s+|\s+$//g; 62 63 $import_dir = &longestCommonPath($filepath, $import_dir); 63 64 $timing_data->{$worker_id}->{'F'}->{$parts[3]} = {'FN'=>$filepath, 'PS'=>($stop - $parts[5]), 'PE'=>$stop, 'E'=>$stop}; … … 82 83 print HTMLOUT 'div.worker {border:1px solid black;background-color:green;color:white;font-weight:bold}' . "\n"; 83 84 print HTMLOUT 'div.time {font-size:smaller;font-weight:normal}' . "\n"; 84 print HTMLOUT 'div.job {background-color:transparent;color:black;border:1px solid black;display:block;font-size:smaller;position:relative;text-align:center }' . "\n";85 print HTMLOUT 'div.job {background-color:transparent;color:black;border:1px solid black;display:block;font-size:smaller;position:relative;text-align:center;overflow:hidden}' . "\n"; 85 86 print HTMLOUT 'span.process {z-index:-1;background-color:#C7C7C7;position:absolute}' . "\n"; 87 print HTMLOUT 'span.label {z-index:1;background-color:transparent;overflow:hidden;white-space:nowrap;}' . "\n"; 86 88 print HTMLOUT "th {text-align:left}\n"; 87 89 print HTMLOUT '</style>' . "\n"; … … 132 134 } 133 135 # Shorten filename 134 $timing_data->{$worker_id}->{'F'}->{$job_start}->{'FN'} = substr($timing_data->{$worker_id}->{'F'}->{$job_start}->{'FN'}, length($import_dir) + 1); 136 if (defined $timing_data->{$worker_id}->{'F'}->{$job_start}->{'FN'}) 137 { 138 $timing_data->{$worker_id}->{'F'}->{$job_start}->{'FN'} = substr($timing_data->{$worker_id}->{'F'}->{$job_start}->{'FN'}, length($import_dir) + 1); 139 } 135 140 $file_count++; 136 141 } … … 265 270 # - subtract any left offset from width 266 271 $width = $width - $left; 267 # - right offset directly subtracted from width 272 # - right offset directly subtracted from width 268 273 if ($end != $tend) 269 274 { … … 272 277 $width = $width - $right; 273 278 } 279 # Round things off (simple dutch rounding) 280 $left = int($left + 0.5); 281 $width = int($width + 0.5); 282 # Output the bar for this master/worker 274 283 my $html = '<div class="thread ' . $class . '" style="left:' . $left . 'px;width:' . $width . 'px;">'; 275 284 if ($class eq 'master') … … 288 297 # Scale Job co-ordinates 289 298 my $jleft_percent = $rjstart / $duration; 290 my $jleft = floor($jleft_percent * $table_width);299 my $jleft = int(($jleft_percent * $table_width) + 0.5); 291 300 my $jwidth_percent = $jduration / $duration; 292 my $jwidth = floor($jwidth_percent * $table_width); 293 if ($jleft < $previous_jright) 294 { 295 $jleft = $previous_jright; 296 } 301 my $jwidth = int(($jwidth_percent * $table_width) + 0.5); 297 302 if ($jleft + $jwidth > $left + $width) 298 303 { … … 301 306 # Then scale process timings within that! 302 307 my $rpleft_percent = ($rpstart - $rjstart) / $duration; 303 my $rpleft = floor($rpleft_percent * $table_width); 304 my $rpwidth_percent = ($rpend - $rpstart) / $duration; 305 my $rpwidth = floor($rpwidth_percent * $table_width); 306 $html .= '<div class="job" style="left:' . $jleft . 'px;width:' . $jwidth . 'px" title="S:' . renderTime($rjstart) . ', PS:' . renderTime($rpstart) . ', PE:' . renderTime($rpend) . ', E:' . renderTime($rjend) . '"><span class="process" style="left:' . $rpleft . 'px;width:' . $rpwidth . 'px"> </span><span style="background-color:transparent;z-index:1">' . $jobs->{$jstart}->{'FN'} . '</span></div>'; 307 $previous_jright = $jleft + $jwidth; 308 my $rpleft = int(($rpleft_percent * $table_width) + 0.5); 309 my $rpwidth = $jwidth - $rpleft; 310 my $cpu_percent = int((($rpwidth / $jwidth) * 100) + 0.5); 311 $html .= '<div class="job" style="left:' . $jleft . 'px;width:' . $jwidth . 'px" title="FN:' . $jobs->{$jstart}->{'FN'} . ', S:' . renderTime($rjstart) . ', E:' . renderTime($rjend) . ', CPU: ' . $cpu_percent . '%"><span class="process" style="left:' . $rpleft . 'px;width:' . $rpwidth . 'px"> </span><span class="label">' . $jobs->{$jstart}->{'FN'} . '</span></div>'; 308 312 } 309 313 return $html;
Note:
See TracChangeset
for help on using the changeset viewer.