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

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to