[R-sig-hpc] dual cores with makeCluster

Dirk Eddelbuettel edd at debian.org
Mon Nov 17 20:58:46 CET 2008


On 17 November 2008 at 13:33, Hodgess, Erin wrote:
| Dear R HPC group:
|  
| I have a dual core laptop and I use:
|  
| > cl <- makeCluster(2,type="SOCK")
|  
| How do I know if I will be using both cores, please?  Or is there something special that I should be doing to make sure that I'm using both cores.

The operating system does that for you. That's its job, and it usually does
it well. You can check on it e.g. by running 'htop' as people on the ompi
list already told you. In windoze the task manager does something similar by
giving you two charts for two cores.

For fine-grained control you can set cpu affinity etc, see eg 'man taskset'
if you run Linux.  Also, if you're on Linux and you use Open MPI, and then
use slurm to schedule / allocate jobs (both covered in my tutorial that you
attended) then you also get to control cpu, core, affinity, ... there.

Lastly, if you're really paranoid: time it in single-cpu mode, run it in
two-cpu mode and see if it makes a difference. It should.  Unless the task
was serial to start with in which case you have a so-called problem between
keyboard and chair...  ;-)

Dirk

-- 
Three out of two people have difficulties with fractions.



More information about the R-sig-hpc mailing list