1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{'ACE_ROOT'}/bin";
8 use PerlACE
::TestTarget
;
13 # Estimated execution of each test
14 $execution_time = 100;
16 # Expected throughput of the network (in Mbps)
17 $expected_throughput = 100;
19 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
22 # Assigns default rates
30 for ($rate = $min_rate, $i = 1;
32 $rate += $rate_increment, $i += 1){
33 @rates = (@rates, $rate);
38 # Assigns default message sizes
40 $min_message_size = 1 * 1000;
41 $max_message_size = 64 * 1000;
45 for ($message_size = $min_message_size, $i = 1;
46 $message_size <= $max_message_size;
47 $message_size *= 2, $i += 1){
48 @message_sizes = (@message_sizes, $message_size);
53 # Assigns default protocols
66 for ($i = 0; $i <= $#ARGV; $i++) {
67 if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?"){
68 print STDERR
"\nusage: run_senders.pl\n";
70 print STDERR
"-h shows options menu\n";
72 print STDERR
"\t-message_sizes: defaults to (";
73 for $message_size (@message_sizes){
74 print STDERR
"$message_size, ";
78 print STDERR
"\t-rates: defaults to (";
80 print STDERR
"$rate, ";
84 print STDERR
"\t-protocols: defaults to (";
85 for $protocol (@protocols){
86 print STDERR
"$protocol, ";
90 print STDERR
"\t-execution_time: defaults to $execution_time\n";
92 print STDERR
"\t-test_type: defaults to $test_type (valid options are PACED, THROUGHPUT, and LATENCY)\n";
97 $CL = $server->CreateProcess ("sender", "-h");
98 $CL->SpawnWaitKill ($server->ProcessStartWaitInterval());
100 $SV = $server->CreateProcess ("receiver", "-h");
101 $SV->SpawnWaitKill ($server->ProcessStartWaitInterval());
105 elsif ($ARGV[$i] eq "-message_sizes"){
106 @message_sizes = split (',', $ARGV[$i + 1]);
109 elsif ($ARGV[$i] eq "-rates"){
110 @rates = split (',', $ARGV[$i + 1]);
113 elsif ($ARGV[$i] eq "-protocols"){
114 @protocols = split (',', $ARGV[$i + 1]);
117 elsif ($ARGV[$i] eq "-execution_time"){
118 $execution_time = $ARGV[$i + 1];
121 elsif ($ARGV[$i] eq "-test_type"){
122 $test_type = $ARGV[$i + 1];
125 # Rate is irrelevant in THROUGHPUT and LATENCY tests.
126 if ($test_type eq "THROUGHPUT" ||
127 $test_type eq "LATENCY"){
128 @rates = split (',', "1");
132 $extra_args .= " " . $ARGV[$i];
139 # This loop form the arguments
141 for $protocol (@protocols){
143 for $message_size (@message_sizes){
144 # DIOP does not support messages beyond 8K
145 next if ($protocol eq "DIOP" && $message_size > (8 * 1000));
147 # Since DIOP is unreliable, it doesn't make sense to use it for THROUGHPUT and LATENCY tests.
148 next if ($protocol eq "DIOP" && ($test_type eq "THROUGHPUT" || $test_type eq "LATENCY"));
151 if ($test_type eq "PACED"){
152 $iterations = $execution_time * $rate;
154 elsif ($test_type eq "THROUGHPUT"){
155 # Skip message size of zero since we will never to able get any throughput
156 next if ($message_size == 0);
157 $iterations = $expected_throughput * 1000 * 1000 * $execution_time / $message_size / 8;
159 elsif ($test_type eq "LATENCY"){
160 # Latency iteration are fixed. Using
161 # expected_throughput is really not a good measure.
164 @configs = (@configs, "-i $iterations -p $protocol -r $rate -s $message_size");
171 if ($test_type eq "PACED"){
174 # Sender-side stats are not interesting when pacing
175 $print_statistics = 0;
177 elsif ($test_type eq "THROUGHPUT"){
179 $print_statistics = 1;
181 elsif ($test_type eq "LATENCY"){
183 $print_statistics = 1;
186 for $config (@configs){
187 $program = "./sender". "-a $test -t $print_statistics $config $extra_args";