3 # The range of grid sizes to consider
6 # The number of trials to consider. If this is set to one, the time for a
7 # single trial will be outputted. For higher values, the mean of all the trials
8 # will be outputted, along with the standard deviation.
11 # The flags to pass for code optimization
16 # Compile the code with the current grid size
17 system "g++-mp-4.8 $opt -I../../src -DNNN=$r -o timing_test "
18 ."-L../../src timing_test.cc";
20 # Carry out the trials for this grid size
22 foreach $t (1..$tries) {
24 # Run the code, and output the timing information to the
26 system "./timing_test >time_temp";
28 # Read the "time_temp" file to find the duration of the run
29 open F
,"time_temp" or die "Can't open timing file: $!";
35 # Compute the mean and variance and print to standard output
37 $stt=$stt/$tries-$st*$st;$stt=$stt>0?
sqrt($stt):0;
38 print "$r $st $stt\n";
41 # Delete the temporary timing file