View source: R/remoteComputing.R
| runbg_bwfor_sshpass | R Documentation |
Generate an R code of the expression that is copied via scp
to the bwForCluster. Then collect the results. ssh-key not needed. Password can be provided via an additional argument.
sshpass needs to be installed on your local machine.
runbg_bwfor_sshpass(
...,
machine,
filename = NULL,
nodes = 1,
cores = 1,
walltime = "01:00:00",
input = ls(.GlobalEnv),
compile = TRUE,
recover = F,
password = "'begin__end'"
)
... |
Some R code |
machine |
e.g. |
filename |
Character, defining the filename of the temporary file. Random file name ist chosen if NULL. |
nodes |
Number of nodes, e.g. 10 |
cores |
Number of cores, e.g. 16 |
walltime |
estimated runtime in the format |
input |
Character vector, the objects in the workspace that are stored into an R data file and copied to the remove machine. |
compile |
Logical. If |
recover |
Logical, If |
password |
Your ssh password in plain text (yes, no joke unfortunately), the password is handed over to sshpass for automatic login on the cluster. |
runbg() generates a workspace from the input argument
and copies the workspace and all C files or .so files to the remote machines via
scp. This will only work if *an ssh-key had been generated and added
to the authorized keys on the remote machine*. The
code snippet, i.e. the ... argument, can include several intermediate results
but only the last call which is not redirected into a variable is returned via the
variable .runbgOutput, see example below.
List of functions check(), get() and purge().
check() checks, if the result is ready.
get() copies the result file
to the working directory and loads it into the workspace as an object called .runbgOutput.
This object is a list named according to the machines that contains the results returned by each
machine.
purge() deletes the temporary folder
from the working directory and the remote machines.
## Not run:
out_job1 <- runbg({
mstrust(obj, center, fits = 10, cores = 2)
},
machine = "bwfor", nodes = 2, cores = "2:best",
walltime = "00:01:00",
filename = "job1")
out_job1$check()
out_job1$get()
out_job1$purge()
result <- .runbgOutput
print(result)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.