[R] how to have R tell me which node is being used in a multi-node cluster

Matthew Keller mckellercran at gmail.com
Tue Jun 28 01:47:47 CEST 2011


Hi all,

I'm trying to use a parallel script on a 20 node cluster, 8 processors
per node. Each node has a name, e.g., "vm0000", "vm0001", etc. Within
a foreach loop, I would like R to tell me what node it is actually
running on. How can this be accomplished? Thanks!

require(doMPI)
cl <- startMPIcluster(16)
registerDoMPI(cl)

x <- foreach(i = 1:16) %dopar% {
<some function that writes the node name out to screen or file>
}
closeCluster(cl)

-- 
Matthew C Keller
Asst. Professor of Psychology
University of Colorado at Boulder
www.matthewckeller.com



More information about the R-help mailing list