Hi Nathaniel,
Thanks for the suggestion. Im actually not really using R to do any real work. Im starting the R H2O package (a Java machine learning package) and forwarding all the work to H2O. This is the list of packages I have in R: > search() [1] ".GlobalEnv" "package:h2o" "package:tools" [4] "package:statmod" "package:rjson" "package:RCurl" [7] "package:bitops" "package:stats" "package:graphics" [10] "package:grDevices" "package:utils" "package:datasets" [13] "package:methods" "Autoloads" "package:base" And here is the /proc info tomk@mr-0xb4:~$ ps -efww | grep R | grep tomk tomk 8366 13845 1 14:25 pts/0 00:00:01 /usr/lib/R/bin/exec/R tomk 12960 27363 0 14:27 pts/3 00:00:00 grep --color=auto R tomk@mr-0xb4:~$ grep Cpus /proc/8366/status Cpus_allowed: 00000001 Cpus_allowed_list: 0 As you can see, my R is super vanilla. I havent configured hardly anything. Im just loading a few plain packages. Thanks, Tom On Aug 6, 2014, at 2:20 PM, Nathaniel Smith <n...@pobox.com> wrote: > On Wed, Aug 6, 2014 at 6:01 AM, Tom Kraljevic <t...@0xdata.com> wrote: >> >> 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. > > When I run R I see: > > Cpus_allowed: ff > Cpus_allowed_list: 0-7 > > It's possible (likely?) that the culprit here isn't R but rather some > other library that R is loading. Are you using OpenBLAS? By default > OpenBLAS will set an obnoxious cpu mask, unless you override this > using some obscure build system settings. (There might be a runtime > option for disabling it too, I don't remember. Note also that this is > just one of several obnoxious things OpenBLAS does unless you override > a bunch of obscure build system defaults -- building OpenBLAS > correctly is highly non-trivial.) > > -n > > -- > Nathaniel J. Smith > Postdoctoral researcher - Informatics - University of Edinburgh > http://vorpus.org [[alternative HTML version deleted]]
______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel