Learn R Programming

future (version 1.1.1)

tweak_parallel_PSOCK: Tweak PSOCK backend of the parallel package

Description

Tweak PSOCK backend of the parallel package

Usage

tweak_parallel_PSOCK(user = TRUE, revtunnel = TRUE, rshopts = TRUE, use127.0.0.1 = FALSE, reset = FALSE)

Arguments

user
If TRUE, parallel is tweaked to only pass username to SSH if it is specified via argument user.
revtunnel
If TRUE, parallel is tweaked to make use of reverse SSH tunneling.
rshopts
If TRUE, parallel is tweaked so it is possible to specify additional command-line options to the rshcmd executable.
use127.0.0.1
If TRUE, 127.0.0.1 is used instead of localhost.
reset
If TRUE, all tweaks are undone.

Value

Nothing.

References

https://github.com/HenrikBengtsson/Wishlist-for-R/issues/32

Examples

Run this code
## Not run: 
# trace(system, tracer = quote(stop("Command: ", command)), print = FALSE)
# 
# ## Without tweaks
# try(cl <- parallel::makeCluster("remote.myserver.org", revtunnel=TRUE,
#                                 master="localhost", homogeneous=FALSE))
# ### Error in eval(expr, envir, enclos) : 
# ###  Command:
# ###    ssh
# ###      -l hb
# ###      remote.myserver.org
# ###      "Rscript
# ###         --default-packages=datasets,utils,grDevices,graphics,stats,methods
# ###         -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11099
# ###         OUT=/dev/null TIMEOUT=2592000 XDR=TRUE"
# 
# ## With tweaks
# future:::tweak_parallel_PSOCK()
# try(cl <- parallel::makeCluster("remote.myserver.org", revtunnel=TRUE,
#                                 master="localhost", homogeneous=FALSE))
# ### Error in eval(expr, envir, enclos) : 
# ###  Command:
# ###    ssh
# ###      -R 11624:localhost:11624
# ###      remote.myserver.org
# ###      "Rscript
# ###         --default-packages=datasets,utils,grDevices,graphics,stats,methods
# ###         -e 'parallel:::.slaveRSOCK()' MASTER=localhost PORT=11099
# ###         OUT=/dev/null TIMEOUT=2592000 XDR=TRUE"
# 
# ## Undo tweaks
# untrace(system)
# future:::tweak_parallel_PSOCK(reset=TRUE)
# ## End(Not run)

Run the code above in your browser using DataLab