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
17 # Compile the code with the current grid size
18 system "g++ $opt -I../../src -DNNN=$r -o timing_test_2d "
19 ."-L../../src timing_test_2d.cc -lvoro++_2d";
21 # Carry out the trials for this grid size
23 foreach $t (1..$tries) {
25 # Run the code, and output the timing information to the
27 system "./timing_test_2d >time_temp_2d";
29 # Read the "time_temp" file to find the duration of the run
30 open F
,"time_temp_2d" or die "Can't open timing file: $!";
36 # Compute the mean and variance and print to standard output
38 $stt=$stt/$tries-$st*$st;$stt=$stt>0?
sqrt($stt):0;
39 print "$r $st $stt\n";
42 # Delete the temporary timing file
43 unlink "time_temp_2d";