Changeset 27683 for gs2-extensions/parallel-building/trunk
- Timestamp:
- 2013-06-21T12:20:27+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/parallel-building/trunk/src/bin/script/generate_gantt.pl
r27643 r27683 129 129 elsif ($parts[1] =~ /W\d+/) 130 130 { 131 $timing_data->{$parts[1]} = {'N'=>$parts[2], 'S'=>$parts[3], 'E'=>$parts[4], 'F'=>{}}; 132 $id_2_worker_id->{$parts[0]} = $parts[1]; 131 my $worker_id = $parts[1]; 132 my $hostname = $parts[2]; 133 # Alter the worker name for compute nodes so they can be naturally 134 # sorted 135 if ($hostname =~ /compute-0-(\d+)/) 136 { 137 $worker_id = 'W' . $1; 138 } 139 $timing_data->{$worker_id} = {'N'=>$hostname, 'S'=>$parts[3], 'E'=>$parts[4], 'F'=>{}}; 140 $id_2_worker_id->{$parts[0]} = $worker_id; 133 141 } 134 142 elsif ($parts[1] =~ /T\d+/) … … 159 167 print HTMLOUT 'div.thread {position:relative}' . "\n"; 160 168 print HTMLOUT 'div.master {border:1px solid gray;color:white;font-weight:bold}' . "\n"; 161 print HTMLOUT 'div.worker {border:1px solid black;background-color:green;color:white;font-weight:bold }' . "\n";169 print HTMLOUT 'div.worker {border:1px solid black;background-color:green;color:white;font-weight:bold;margin-bottom:1px;}' . "\n"; 162 170 print HTMLOUT 'div.time {font-size:smaller;font-weight:normal}' . "\n"; 163 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";171 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;margin-bottom:1px;}' . "\n"; 164 172 print HTMLOUT 'span.process {z-index:-1;background-color:#C7C7C7;position:absolute}' . "\n"; 165 173 print HTMLOUT 'span.label {z-index:1;background-color:transparent;overflow:hidden;white-space:nowrap;}' . "\n"; … … 169 177 print HTMLOUT "<body>\n"; 170 178 print HTMLOUT "<h2>Statistics</h2>\n"; 171 print HTMLOUT "<table >\n";179 print HTMLOUT "<table style=\"width:100%;\">\n"; 172 180 173 181 my $total_duration = $timing_data->{'M'}->{'E'} - $timing_data->{'M'}->{'S'}; … … 229 237 my $avg_cpu_time = int(($total_process_time / $file_count) + 0.5); 230 238 231 print HTMLOUT "<tr><th>Import Directory:</th><td>" . $import_dir . "</td></tr>\n"; 239 print HTMLOUT "<tr>\n"; 240 print HTMLOUT ' <th style="width:12%;">Import Directory:</th><td style="width:22%;" colspan="5">' . $import_dir . "</td>\n"; 241 print HTMLOUT "</tr>\n"; 242 243 print HTMLOUT "<tr>\n"; 232 244 my ($sec, $min, $hour, $day, $month, $year) = (localtime($timing_data->{'M'}->{'S'}))[0,1,2,3,4,5]; 233 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"; 234 print HTMLOUT "<tr><th>Processing Time:</th><td>" . &renderTime($total_duration) . "</td></tr>\n"; 235 print HTMLOUT "<tr><th>Processing Threads:</th><td>" . $number_of_workers . "</td></tr>\n"; 236 print HTMLOUT "<tr><th>Files Processed:</th><td>" . $file_count . "</td></tr>\n"; 245 print HTMLOUT ' <th style="width:11%;">Start Time:</th><td style="width:22%;">' . sprintf('%04d%s%02d %02d:%02d:%02d', ($year+1900), $months[$month], $day, $hour, $min, $sec) . "</td>\n"; 246 ($sec, $min, $hour, $day, $month, $year) = (localtime($timing_data->{'M'}->{'E'}))[0,1,2,3,4,5]; 247 print HTMLOUT ' <th style="width:11%;">End Time:</th><td style="width:22%;">' . sprintf('%04d%s%02d %02d:%02d:%02d', ($year+1900), $months[$month], $day, $hour, $min, $sec) . "</td>\n"; 248 print HTMLOUT " <th>Processing Time:</th><td>" . &renderTime($total_duration) . "</td>\n"; 249 print HTMLOUT "</tr>\n"; 250 251 print HTMLOUT "<tr>\n"; 252 print HTMLOUT " <th>Processing Threads:</th><td>" . $number_of_workers . "</td>\n"; 253 print HTMLOUT " <th>Files Processed:</th><td>" . $file_count . "</td>\n"; 254 print HTMLOUT " <th>Problem Files:</th><td>" . $problem_files . "</td>\n"; 255 print HTMLOUT "</tr>\n"; 256 257 print HTMLOUT "<tr>\n"; 258 print HTMLOUT ' <th>Serial Processing Time:</th><td>' . &renderTime($total_process_time) . "</td>\n"; 259 print HTMLOUT ' <th>Serial IO Time:</th><td>' . &renderTime($total_io_time) . "</td>\n"; 260 print HTMLOUT ' <th>IO Percentage:</th><td>' . sprintf('%d%%', (($total_io_time / $total_process_time) * 100)) . "</td>\n"; 261 print HTMLOUT "</tr>\n"; 262 263 print HTMLOUT "<tr>\n"; 264 print HTMLOUT " <th>Average Processing Time:</th><td>" . &renderTime($avg_processing_time) . "</td>\n"; 265 print HTMLOUT " <th>Average File IO Time:</th><td>" . &renderTime($avg_io_time) . "</td>\n"; 266 print HTMLOUT " <th>Average File CPU Time:</th><td>" . &renderTime($avg_cpu_time) . "</td>\n"; 267 print HTMLOUT "</tr>\n"; 268 269 print HTMLOUT "<tr>\n"; 270 print HTMLOUT " <th>Fastest File:</th><td>" . &renderTime($fastest_file) . "</td>\n"; 271 print HTMLOUT " <th>Slowest File:</th><td>" . &renderTime($slowest_file) . "</td>\n"; 237 272 if ($data_locality > 0) 238 273 { 239 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"; 240 } 241 print HTMLOUT "<tr><th>Serial Processing Time:</th><td>" . &renderTime($total_process_time) . "</td></tr>\n"; 242 print HTMLOUT "<tr><th>Serial IO Time:</th><td>" . &renderTime($total_io_time) . "</td></tr>\n"; 243 print HTMLOUT '<tr><th>IO Percentage:</th><td>' . sprintf('%d%%', (($total_io_time / $total_process_time) * 100)) . "</td></tr>\n"; 244 print HTMLOUT "<tr><th>Average File Processing Time:</th><td>" . &renderTime($avg_processing_time) . "</td></tr>\n"; 245 print HTMLOUT "<tr><th>Average File IO Time:</th><td>" . &renderTime($avg_io_time) . "</td></tr>\n"; 246 print HTMLOUT "<tr><th>Average File CPU Time:</th><td>" . &renderTime($avg_cpu_time) . "</td></tr>\n"; 247 print HTMLOUT "<tr><th>Fastest File:</th><td>" . &renderTime($fastest_file) . "</td></tr>\n"; 248 print HTMLOUT "<tr><th>Slowest File:</th><td>" . &renderTime($slowest_file) . "</td></tr>\n"; 249 print HTMLOUT "<tr><th>Problem Files:</th><td>" . $problem_files . "</td></tr>\n"; 274 print HTMLOUT " <th>Data Locality:</th><td>" . sprintf('%d%% [%d out of %d]', (($data_locality / $file_count) * 100), $data_locality, $file_count) . "</td>\n"; 275 } 276 else 277 { 278 print HTMLOUT " <th></th>\n"; 279 print HTMLOUT " <td></td>\n"; 280 } 281 print HTMLOUT "</tr>\n"; 250 282 251 283 print HTMLOUT "</table>\n"; 252 284 print HTMLOUT "<hr />\n"; 253 print HTMLOUT "<h2>Timing Chart (Gan nt)</h2>\n";285 print HTMLOUT "<h2>Timing Chart (Gantt)</h2>\n"; 254 286 print HTMLOUT renderLine($chart_width, $timing_data->{'M'}->{'S'}, $timing_data->{'M'}->{'E'}, 'master', $timing_data->{'M'}->{'N'}, $timing_data->{'M'}->{'S'}, $timing_data->{'M'}->{'E'}, {}); 255 287 foreach my $worker_id (nsort keys %{$timing_data}) … … 392 424 if ($class eq 'master') 393 425 { 394 $html .= '<div style="background-color:blue ">';426 $html .= '<div style="background-color:blue;margin-bottom:1px">'; 395 427 } 396 428 $html .= '<div class="time" style="display:table-cell">' . &renderTime($rtstart) . '</div><div style="display:table-cell;padding-left:20px;width:100%;">' . ucfirst($class) . ': ' . $tname . '</div><div class="time" style="display:table-cell">' . renderTime($rtend) . '</div></div>'; … … 409 441 my $jleft = int(($jleft_percent * $table_width) + 0.5); 410 442 my $jwidth_percent = $jduration / $duration; 411 my $jwidth = int(($jwidth_percent * $table_width) + 0.5); 443 # -2 for left and right 1 pixel border 444 my $jwidth = int(($jwidth_percent * $table_width) + 0.5) - 2; 412 445 if ($jleft + $jwidth > $left + $width) 413 446 {
Note:
See TracChangeset
for help on using the changeset viewer.