Changeset 27590
- Timestamp:
- 2013-06-10T16:27:49+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/parallel-building/trunk/src/bin/script/generate_gantt.pl
r27559 r27590 35 35 } 36 36 print "Chart Width: " . $chart_width . "px\n"; 37 38 my ($epoc) = $dir =~ /(\d+)$/; 39 my $gantt_path = $dir . '/' . $epoc . '-gantt.html'; 40 print "Gantt Chart: " . $gantt_path . "\n"; 41 37 42 print "===================================\n\n"; 38 43 … … 62 67 $filepath =~ s/^\s+|\s+$//g; 63 68 $import_dir = &longestCommonPath($filepath, $import_dir); 64 $timing_data->{$worker_id}->{'F'}->{$parts[3]} = {'FN'=>$filepath, 'PS'=>($stop - $parts[5]), 'PE'=>$stop, 'E'=>$stop };69 $timing_data->{$worker_id}->{'F'}->{$parts[3]} = {'FN'=>$filepath, 'PS'=>($stop - $parts[5]), 'PE'=>$stop, 'E'=>$stop, 'DL'=>$parts[6]}; 65 70 } 66 71 } … … 75 80 # 3. Produce pretty HTML chart of timing information including jobs 76 81 print " * Generating timing information as HTML... "; 77 open(HTMLOUT, '>:utf8', $ dir . '/gantt.html') or die('Error! Failed to open file for writing: gantt.html');82 open(HTMLOUT, '>:utf8', $gantt_path) or die('Error! Failed to open file for writing: gantt.html'); 78 83 print HTMLOUT "<html>\n"; 79 84 print HTMLOUT '<head>' . "\n"; … … 95 100 my $total_duration = $timing_data->{'M'}->{'E'} - $timing_data->{'M'}->{'S'}; 96 101 my $file_count = 0; 102 my $data_locality = 0; 97 103 my $total_io_time = 0; 98 104 my $total_process_time = 0; … … 139 145 } 140 146 $file_count++; 147 if ($timing_data->{$worker_id}->{'F'}->{$job_start}->{'DL'} == 1) 148 { 149 $data_locality++; 150 } 141 151 } 142 152 } 143 153 } 144 154 my $avg_processing_time = floor(($total_io_time + $total_process_time) / $file_count); 155 my @months = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); 145 156 146 157 print HTMLOUT "<tr><th>Import Directory:</th><td>" . $import_dir . "</td></tr>\n"; 158 my ($sec, $min, $hour, $day, $month, $year) = (localtime($timing_data->{'M'}->{'S'}))[0,1,2,3,4,5]; 159 print HTMLOUT "<tr><th>Start Time:</th><td>" . sprintf('%04d%s%02d %02d:%02d:%02d', ($year+1900), $months[$month], $day, $hour, $min, $sec) . "</td></tr>\n"; 147 160 print HTMLOUT "<tr><th>Processing Time:</th><td>" . &renderTime($total_duration) . "</td></tr>\n"; 148 161 print HTMLOUT "<tr><th>Processing Threads:</th><td>" . $number_of_workers . "</td></tr>\n"; 149 162 print HTMLOUT "<tr><th>Files Processed:</th><td>" . $file_count . "</td></tr>\n"; 150 print HTMLOUT "<tr><th>Problem Files:</th><td>" . $problem_files . "</td></tr>\n"; 163 if ($data_locality > 0) 164 { 165 print HTMLOUT "<tr><th>Data Locality:</th><td>" . sprintf('%d%% [%d out of %d]', (($data_locality / $file_count) * 100), $data_locality, $file_count) . "</td></tr>\n"; 166 } 151 167 print HTMLOUT "<tr><th>Serial Processing Time:</th><td>" . &renderTime($total_process_time) . "</td></tr>\n"; 152 168 print HTMLOUT "<tr><th>Serial IO Time:</th><td>" . &renderTime($total_io_time) . "</td></tr>\n"; … … 154 170 print HTMLOUT "<tr><th>Fastest File:</th><td>" . &renderTime($fastest_file) . "</td></tr>\n"; 155 171 print HTMLOUT "<tr><th>Slowest File:</th><td>" . &renderTime($slowest_file) . "</td></tr>\n"; 172 print HTMLOUT "<tr><th>Problem Files:</th><td>" . $problem_files . "</td></tr>\n"; 156 173 157 174 print HTMLOUT "</table>\n"; … … 309 326 my $rpwidth = $jwidth - $rpleft; 310 327 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>'; 328 $html .= '<div class="job" style="left:' . $jleft . 'px;width:' . $jwidth . 'px;'; 329 if ($jobs->{$jstart}->{'DL'} != 1) 330 { 331 $html .= 'border:1px dashed black;'; 332 } 333 $html .= '" 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"'; 334 if ($jobs->{$jstart}->{'DL'} != 1) 335 { 336 $html .= ' style="color:#FF0000"'; 337 } 338 $html .= '>' . $jobs->{$jstart}->{'FN'}; 339 if ($jobs->{$jstart}->{'DL'} != 1) 340 { 341 $html .= ' [NL]'; 342 } 343 $html .= '</span></div>'; 312 344 } 313 345 return $html;
Note:
See TracChangeset
for help on using the changeset viewer.