From njs at pobox.com  Wed Aug  6 23:41:33 2014
From: njs at pobox.com (Nathaniel Smith)
Date: Wed, 6 Aug 2014 22:41:33 +0100
Subject: [Rd] R process (and forked children via system2) are limited to
	1 core?
In-Reply-To: <655D905D-F0F5-419A-9A69-D77952B7C04B@0xdata.com>
References: <D1A68D4C-12E4-44B2-9DD7-B14FEDA55002@0xdata.com>
	<CAPJVwBn6E4DwP7yji8mLXZ5JiSeJVPLCBpAyAPTaTFO_fporKQ@mail.gmail.com>
	<655D905D-F0F5-419A-9A69-D77952B7C04B@0xdata.com>
Message-ID: <CAPJVwBmYNWU908uwcmWMyF-H4JOuMBbWiG939YNP8XG+yXMM7g@mail.gmail.com>

On Wed, Aug 6, 2014 at 10:31 PM, Tom Kraljevic <tomk at 0xdata.com> wrote:
>
> Hi Nathaniel,
>
>
>
> Thanks for the suggestion.
>
> I?m actually not really using R to do any real work.
> I?m 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 at 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 at mr-0xb4:~$ grep Cpus /proc/8366/status
> Cpus_allowed:   00000001
> Cpus_allowed_list:      0
>
>
>
> As you can see, my R is super vanilla.  I haven?t configured hardly
> anything.  I?m just loading a few plain packages.

My suggestion is just a guess, really, but: R always uses (and thus
loads by default) some underlying C library to implement its core
linear algebra routines. OpenBLAS is one of the libraries that it
might possibly be using, depending on how your R was set up.

Anyway, it looks like the quick way to check for this particular
possible culprit is to run

env OPENBLAS_MAIN_FREE=1 R

and see if that helps.

-n

-- 
Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
http://vorpus.org



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