Perl script to run a set of simulations using lena-simple-epc

This commit is contained in:
Jaume Nin
2011-12-02 16:53:55 +01:00
parent 7a5ebed9ce
commit 67f401c412

View File

@@ -0,0 +1,35 @@
#!/usr/bin/perl
use strict;
use IO::CaptureOutput qw(capture qxx qxy);
use Statistics::Descriptive;
use Cwd;
my $nIterations = 1;
open( FILE, '>epcTimes.csv' );
print FILE "#sTime\tnodes\trTime\trTDev\n";
my @nodes = ( 1,2,3,4,5,6,7, 8, 12, 14);
my @simTime = ( 1, 2, 5, 7, 10);
foreach my $time (@simTime)
{
foreach my $node (@nodes)
{
my $timeStats = Statistics::Descriptive::Full->new();
for ( my $iteration = 0 ; $iteration < $nIterations ; $iteration++ )
{
my $launch = "time ./waf --run \'lena-simple-epc --simTime=$time --numberOfNodes=$node'";
my $out, my $err;
print "$launch\n";
capture { system($launch ) } \$out, \$err;
$err =~ /real(.+)m(.+)s/;
my $minutes = $1;
my $seconds = $minutes * 60 + $2;
$timeStats->add_data($seconds);
}
print FILE "$time\t$node\t";
print FILE $timeStats->mean() . "\t"
. $timeStats->standard_deviation() . "\n";
}
}