#!/usr/bin/perl -w @run_at = qw|localhost/wlan0 localhost/wlan1 localhost/wlan2 localhost/wlan3|; $dest = "192.168.1.2"; sub run { my $at = shift; my @args = @_; my ($host, $iface) = split(/\//, $run_at[$at], 2); unshift @args, ('-I', $iface) if (defined $iface); unshift @args, ('wclient'); unshift @args, ('ssh', $host) if ($host ne 'localhost'); print "running ", join(' ', @args), "\n"; if (fork() == 0) { exec(@args); exit(); } } for ($tbw=10; $tbw<=30; $tbw+=5) { foreach $ac(qw/VO VI BE BK/) { for ($i=1; $i <= @run_at; $i++) { $at = 0; @args = (split(/ +/,"-B $tbw -b $ac -j 50 -s 100 -c 60 $dest"), ("-C", "$i STAs")); run($at, (@args, ('-o', "$tbw-$ac-$i-stas"))); # Run first tasks at [0] and the remaining in for ($j=1; $j<@run_at; $j++) { if ($j > @run_at - $i) { $at++; } run($at, (@args, ('-o', "$tbw-$ac-$i-stas-$j"))); } print "==================\n"; for ($j=1; $j <= @run_at; $j++) { wait(); } sleep(1); } } }