From tomk at 0xdata.com  Wed Aug  6 07:01:55 2014
From: tomk at 0xdata.com (Tom Kraljevic)
Date: Tue, 5 Aug 2014 22:01:55 -0700
Subject: [Rd] R process (and forked children via system2) are limited to 1
	core?
Message-ID: <D1A68D4C-12E4-44B2-9DD7-B14FEDA55002@0xdata.com>


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



[Rd] R process (and forked children via system2) are limited to 1 core?
Tom Kraljevic