export {nws} | R Documentation |
Define a variable in the scope of the workers or specified worker.
## S4 method for signature 'sleigh' export(.Object, xName, xVal, worker=NULL)
.Object |
a sleigh class object. |
xName |
a variable name (given as a quoted string in the function call). |
xVal |
a value to be assigned to 'x'. |
worker |
integer rank of the worker where the variable is defined. The rank values range from 0 to workerCount - 1. By default, the variable is defined on all workers in the sleigh. |
## Not run: s <- sleigh() m <- matrix(rnorm(16), 4, 4) export(s, 'm', m) eachWorker(s, function() m %*% matrix(rnorm(16), 4, 4), eo=list(closure=FALSE)) ## End(Not run)