Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is R multicore only using one core?
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/12924698/parallel-processing-in-r-limited">Parallel processing in R limited</a> </p> </blockquote> <p>I've written some code in R multicore, and I'm running it on a 24-core machine. In fact there are only 12 cores, but they are hyperthreaded, so it looks like there are 24.</p> <p>Here's what's strange: all the threads run on the same single core! So they each only use a tiny amount of cpu, instead of each running on a single core, and chewing up all available cores.</p> <p>For simplicity, I'm just running 4 threads:</p> <pre><code>mclapply( 1:30, function(size) { # time consuming stuff that is cpu bound (think "forecast.ets" et al) }, mc.cores = 4, mc.preschedule = F ) </code></pre> <p>Prior to running this, there is already an R process running on one core, using 100% of that core's capacity:</p> <p><img src="https://i.stack.imgur.com/Ro14R.png" alt="enter image description here"></p> <p>Next, I launch the "multicore process", and 4 extra threads fight for the same core!:</p> <p><img src="https://i.stack.imgur.com/6OGAu.png" alt="enter image description here"></p> <p>... so, they each get 12% of one core, or about 1% of the available processing power, when they should each be able to get 100% of one core. Also, the other R process now only get 50% of the core.</p> <p>OS is Ubuntu 12.04 64-bit. Hardware is Intel. R is version 2.15.2 "trick or treat"</p> <p>Thoughts? (I know I could just use snowfall, but I have a ton of variables, and I really don't want to have to <code>sfExport</code> all of them!)</p> <p>Edit: oh, I guess there's some global lock somewhere? But still, why would there be a conflict between two completely separate R processes? I can run two R processes in parallel just fine, with each taking 100% of a core's CPU.</p> <p>Edit2: Thanks to Dirk's pointer, I rebuilt openblas, and it's looking much healthier now!:</p> <p><img src="https://i.stack.imgur.com/GSt7H.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload