Rprof and system

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Rprof and system

Benjamin Tyner
Hi

I have an R script which invokes WriteXLS() (from the package of the
same name) which as you may know, calls perl via system(). I've noticed
that when I enable profiling using Rprof(), when the script gets to the
part where perl is called, it gets "stuck": it just sits there using
99-100% CPU and around 10% of the RAM, and the perl command does not
even show up as a running process under 'top'. While it is churning
away, new profiling results continue to be written to the profiling file
(at which point the entries are all "system" / "WriteXLS").  I have also
noticed this behavior with other system() calls; not just perl. I've
also tried pipe(cmd, open = "r") as an alternative to system(cmd) and
the result is the same. I have tried in interactive as well as
non-interactive mode, and the issue occurs in both modes although seems
to be more common in the latter.

So, I'm wondering if perhaps Rprof() + system() not a recommended
combination ? I did notice from ?Rprof that "the profiler interrupts R
asynchronously"; though I do not know what that means, perhaps that is
somehow relevant? This is running on R version 3.2.1 under linux (RHEL6).

Any suggestions would be greatly appreciated.

Regards
Ben

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.