[R-sig-Debian] demonstrate multiple core use

Dirk Eddelbuettel edd at debian.org
Thu Apr 9 00:00:56 CEST 2009


This is more of a r-sig-hpc question than an r-sig-debian question ...

On 8 April 2009 at 15:59, Erin Hodgess wrote:
| I have a quad core computer and I'd like to run some Rmpi code.
| However, I would like to be able to demonstrate that all 4 cores are running.
| Is there a way to do that, please?

Sure. The examples in my two HPC tutorials should serve as a starting point:

edd at ron:~/src/latex/conferences/bocDec2008/scripts/parallel$ orterun -n 4 ./helloMPIworld.r
Hello, rank 2 size 4 on ron 
Hello, rank 1 size 4 on ron 
Hello, rank 3 size 4 on ron 
Hello, rank 0 size 4 on ron 
edd at ron:~/src/latex/conferences/bocDec2008/scripts/parallel$ cat helloMPIworld.r
#!/usr/bin/env r

library(Rmpi)	# calls MPI_Init

rk <- mpi.comm.rank(0)
sz <- mpi.comm.size(0)
name <- mpi.get.processor.name()
cat("Hello, rank", rk, "size", sz, "on", name, "\n")

edd at ron:~/src/latex/conferences/bocDec2008/scripts/parallel$ 

That was all on one box. Whether or not you have 1, 2, 4, 8, ... cores does
not matter, the OS will just shuffle the tasks around. Of course, this goes
faster if you do have more cores...
| Also, would it be better to run snow for such a demo, please?

Yes, as that would give you an opportunity to just use sockets instead of
MPI. Again, examples are in the slides of my HPC tutorials.

If you have more questions, feel free to post on the r-sig-hpc list.

Thanks, Dirk

Three out of two people have difficulties with fractions.

More information about the R-SIG-Debian mailing list