Skip to content

Commit a68da1b

Browse files
author
Geoffrey Broadwell
committed
Skip runs that failed when computing best times; be braver about pushing failed runs onto timing lists
1 parent 3bfdc41 commit a68da1b

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

timeall

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,6 @@ sub time_all_compilers {
398398
my $expected = $test->{expected};
399399
$expected = sub { $expected } unless ref $expected eq 'CODE';
400400

401-
# XXXX: Fix handling of failed runs in below calls to time_command()
402-
# to properly support stress tests; this probably means fallout
403-
# in other places to handle failed as well as missing results.
404-
405401
my @all_times;
406402
my $scalable = $test->{scalable} // ((grep /\bSCALE\b/ => @run) ? 1 : 0);
407403
if ($scalable) {
@@ -412,14 +408,13 @@ sub time_all_compilers {
412408
# Determine 0-scale time (mostly compile time)
413409
say '+++ Determining compile time for this test ...' if $verbose;
414410
my $run_times = time_command(\@compile, \@run, $overhead_runs, 0, 0, $expected->(0), $verbose);
411+
push @all_times, @{$run_times || []};
415412
if (!$run_times || grep { $_->{failed} } @$run_times) {
416413
warn "Compiler $name is failing at scale=0 for test $test->{name}, aborting remaining runs.\n";
417-
# XXXX: Should we push onto @all_times before aborting?
418414
next;
419415
}
420416

421417
say '+++ Running scaled timings for this test ...' if $verbose;
422-
push @all_times, @$run_times;
423418
my $min_run_time = min(map { $_->{time} } @$run_times);
424419
my $startup_time = $startup ? $startup->{$name} || 0 : 0;
425420
my $ignore_time = max($startup_time, $min_run_time);
@@ -428,12 +423,11 @@ sub time_all_compilers {
428423
my $scale_points = 0;
429424
while ($run_times && ($lowest < $enough_time || $scale_points < $min_scaling_points)) {
430425
$run_times = time_command(\@compile, \@run, $runs, $scale, $work->($scale), $expected->($scale), $verbose);
426+
push @all_times, @{$run_times || []};
431427
if (!$run_times || grep { $_->{failed} } @$run_times) {
432428
warn "Compiler $name is failing at scale=$scale for test $test->{name}, aborting remaining runs.\n";
433-
# XXXX: Should we push onto @all_times before aborting?
434429
last;
435430
}
436-
push @all_times, @$run_times;
437431
$scale_points++;
438432

439433
$lowest = min(map { $_->{time} } @$run_times);
@@ -444,12 +438,11 @@ sub time_all_compilers {
444438
}
445439
else {
446440
my $run_times = time_command(\@compile, \@run, $runs, 1, 1, $expected->(1), $verbose);
441+
push @all_times, @{$run_times || []};
447442
if (!$run_times || grep { $_->{failed} } @$run_times) {
448443
warn "Compiler $name is failing for test $test->{name}, continuing to next compiler/test.\n";
449-
# XXXX: Should we push onto @all_times before aborting?
450444
next;
451445
}
452-
push @all_times, @$run_times;
453446
}
454447

455448
$times{$name} = \@all_times;
@@ -600,8 +593,11 @@ sub best_times {
600593
while (my ($comp, $times) = each %$raw_times) {
601594
my %runs_by_scale;
602595
for my $run (@$times) {
603-
push @{$runs_by_scale{$run->{scale}} ||= []}, $run;
596+
push @{$runs_by_scale{$run->{scale}} ||= []}, $run
597+
unless $run->{failed};
604598
}
599+
# If all runs failed, don't add the compiler to the best times at all
600+
next unless %runs_by_scale;
605601

606602
my %best_by_scale;
607603
while (my ($scale, $runs) = each %runs_by_scale) {

0 commit comments

Comments
 (0)