Tom Kraljevic
2014-Aug-05 02:49 UTC
[Rd] R process (and forked children via system2) are limited to 1 core?
Hi,
(Using R 3.1.1 on Ubuntu 12.04.4 LTS)
What is the recommended way for R to fork a (non-R) process that is not CPU
limited?
Currently I am using R?s system2() call, and this is inheriting the environment
of the R process.
I notice that (at least on Linux) when I am poking around /proc that the R
process itself is setting up cpu limitations for itself (max 1 core).
Using strace, I see the following:
(strace output)
out.20612:sched_setaffinity(0, 128, {100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0}) = 0
And proc shows:
(cat /proc/nnn/status)
Cpus_allowed: 00000001
Cpus_allowed_list: 0
See that the Cpus_allowed bitmask is a single core. Normally it?s fff?f.
I want my child process (java in this case) not to share this limitation. What
is the recommended way of doing this from R?
Any ideas or suggestions appreciated!
Thanks,
Tom