简体   繁体   中英

How to register linux computing cluster as parallel backend from Windows in R

First off, although I'm pretty well versed in R programming, I'm fairly new to both *nix environments + parallel computing, so I appreciate your bearing with me. I'm familiar with the 'parallel', 'foreach', and different 'do_' packages in R, but only for utilizing multiple cores on a local machine.

I have a local Linux cluster of computers (running on OpenSUSE) available to me, with a number of nodes. These nodes all have R installed. Typically, if I'm trying to work on just one of the nodes, I'll use PuTTY to ssh first to the head node (with username + pwd), then to one of the (internal?) nodes. However, what I'd like to be able to do is, run R on a local Windows workstation, and send jobs to the cluster of computers.

Is it possible to set this cluster of nodes as a parallel back-end for my Windows machine? And if so, what's the most expedient way of going about this?

EDIT:

Perhaps I can narrow down the question a bit. It's easy enough to open an R process on the head node and run something like,

library( parallel )
nodes <- c("n01", "n02", "n03") ## the nodes
cl <- makePSOCKcluster( nodes )
setDefaultCluster( cl )

Now, is it possible for me to interface a local R session with this R session running on the head node in an easy way? Eg, ideally I'd like to write code on my computer of the form (pseudo-code):

clusterConnection <- connect("<cluster>")
f <- function() { clusterApply( cl, 1:10, sum( rnorm(1E7) ) ) }
results <- evaluate( f, clusterConnection )

whereby 'evaluate' performs some magic to send the function 'f' to the head node, then evaluate it, and returns the results back to the local computer and stores it in 'results'.

Is there an R function, package or otherwise that handles this sort of interfacing?

I've found a pretty adequate solution. Use Rserve to set up an R server on the head node, then connect to that through socket connections. The Rserve library on CRAN also provides a bunch of utility functions for evaluating certain functions on the server and receiving the results back on the local computer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM