1
1

Little cleanup to handle the Mac

This commit was SVN r26513.
Этот коммит содержится в:
Ralph Castain 2012-05-29 18:21:47 +00:00
родитель 96901d9503
Коммит e4d80001dc

Просмотреть файл

@ -9,6 +9,7 @@ use strict;
my $showme_arg = 0;
my $num_nodes = 0;
my $my_arg;
my $reps = 1;
my @tests = qw(/bin/true ./orte_no_op ./mpi_no_op ./mpi_barrier);
@ -24,6 +25,7 @@ foreach $my_arg (@ARGV) {
print "Options:
--showme Show the actual commands without executing them
--nodes Number of nodes to run the test across
--reps Number of times to run each test (for statistics)
--help | -h This help list\n";
exit;
} elsif ($my_arg eq "-showme" ||
@ -32,16 +34,24 @@ foreach $my_arg (@ARGV) {
} elsif ($my_arg eq "-nodes" ||
$my_arg eq "--nodes") {
$num_nodes = @ARGV[$i+1];
} elsif ($my_arg eq "--reps" ||
$my_arg eq "-reps") {
$reps = @ARGV[$i+1];
}
$i++;
}
print "REPS " . $reps . "\n";
my $n = 1;
my $cmd;
my $test;
my $output;
my @lines;
my $line;
my @results;
my $res;
my $toggle;
print "\n--------------------------------------------------\n";
foreach $test (@tests) {
if (-e $test) {
@ -53,10 +63,30 @@ foreach $test (@tests) {
$cmd = "time mpirun -npernode 1 -max-vm-size " . $n . " $test 2>&1";
print $cmd . "\n";
if (0 == $showme_arg) {
$output = `$cmd`;
$output =~ s/(.+)\n.*/$1/;
@results = split(/\s+/,$output);
print $results[0] . " " . $results[1] . " " . $results[2] . "\n\n";
for (1..$reps) {
$toggle = 1;
$output = `$cmd`;
@lines = split(/\n/, $output);
foreach $line (@lines) {
if (0 <= index($line, "user") ||
0 <= index($line, "sys") ||
0 <= index($line, "real") ||
0 <= index($line, "elapsed")) {
@results = split(/\s+/,$line);
foreach $res (@results) {
print $res;
if (0 == $toggle) {
print " ";
$toggle = 1;
} else {
print " ";
$toggle = 0;
}
}
print "\n";
}
}
}
}
$n = 2 * $n;
}
@ -64,14 +94,17 @@ foreach $test (@tests) {
$cmd = "time mpirun -npernode 1 $test 2>&1";
print $cmd . "\n";
if (0 == $showme_arg) {
$output = `$cmd`;
$output =~ s/(.+)\n.*/$1/;
@results = split(/\s+/,$output);
print $results[0] . " " . $results[1] . " " . $results[2] . "\n\n";
for (1..$reps) {
$output = `$cmd`;
$output =~ s/(.+)\n.*/$1/;
@results = split(/\s+/,$output);
print $results[0] . " " . $results[1] . " " . $results[2] . "\n";
}
}
}
print "\n--------------------------------------------------\n";
} else {
print "Test " . $test . " was not found - test skipped\n\n";
print "Test " . $test . " was not found - test skipped\n";
print "\n--------------------------------------------------\n";
}
}