-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun_imb.pl
executable file
·70 lines (65 loc) · 1.83 KB
/
run_imb.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/perl
my $output_file = 'imb.dat';
my @btls = ("tcp" , "openib");
my @processes = (2, 4, 6, 8);
my $imb_path = "/root/imb/3.2.4/src/IMB-MPI1";
my $msglog = 16;
open(OUT, ">$output_file") || die "Could not open $output_file\n";
print OUT "\tMessage size (B)\t0\t";
for (my $i = 0; $i <= $msglog; $i++) {
print OUT 2 ** $i;
print OUT "\t";
}
print OUT "\n";
for my $btl (@btls) {
my $transport;
if ( $btl eq "tcp" ) {
$transport = "TCP";
}
else {
$transport = "RoCE";
}
for my $np (@processes) {
my $output = `mpirun -n $np -host xu0,xu3 --mca btl $btl,self,sm $imb_path -msglog $msglog -multi 1 pingpong`;
my @lines = split("\n", $output);
my $group = 0;
my $group_max = $np/2-1;
my $group_sum_lat = 0;
my $group_sum_bw = 0;
my @mean_lat;
my @mean_bw;
my $i = 0;
for (@lines) {
# if ( /bytes/ && /repetitions/ ) {
# print OUT "Transport\tProcesses\tMessage size (B)\tRepetitions\tLatency (microseconds)\tBandwidth (MB/s)\n";
# }
if ( $_ !~ /^[ \t]*#/ && /[0-9]/ ) {
s/^\s+//;
my @numbers = split /\s+/;
$group_sum_lat += $numbers[3];
$group_sum_bw += $numbers[4];
if ( $group++ >= $group_max ) {
$mean_lat[$i] = $group_sum_lat / ($np / 2);
$mean_bw[$i] = $group_sum_bw / ($np / 2);
# print OUT "$transport\t$np\t$numbers[1]\t$numbers[2]\t$mean_lat\t$mean_bw\n";
$group_sum_lat = 0;
$group_sum_bw = 0;
$group = 0;
++$i;
}
}
}
print OUT "Latency (microseconds)\t$transport, $np Processes\t";
for (@mean_lat) {
print OUT $_;
print OUT "\t";
}
print OUT "\n";
print OUT "Bandwidth (MB/s)\t$transport, $np Processes\t";
for (@mean_bw) {
print OUT $_;
print OUT "\t";
}
print OUT "\n";
}
}