rbenchmark / benchmarks

Collections of Benchmarks of R
BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

Can not run with --meter perf #6

Open llbit opened 8 years ago

llbit commented 8 years ago

I tried to run with the --meter perf option but that generated the following error:

['perf stat -r 1 -x, -o _perf.tmp --append', 'Rscript', '--vanilla', '/usr/local/.../r_harness.R', 'TRUE', 'FALSE', '2', 'crt.R', '']
Execution failed:  [Errno 2] No such file or directory
[Errno 2] No such file or directory

The root cause seems to be how the subprocess.call command is generated:

        warmup_cmd = [perf_cmd, rcmd_args, harness, harness_args,
                      use_system_time, str(warmup_rep), source, rargs]

As you can see in the console log at the top, the perf stat... part is a single list element. I could fix the problem by splitting the perf_cmd into a list and prepending it to the command list:

        warmup_cmd = perf_cmd.split() + [rcmd_args, harness, harness_args,
                      use_system_time, str(warmup_rep), source, rargs]

I am using Python 2.7.6.

I'll send a patch for this and you can accept it if this is the correct way to handle the system call.