I want to create my own variant of makePSOCKcluster
and newPSOCKnode
using ssh connection via plink. So, I rewrite code
if (machine != "localhost") {
rshcmd <- getClusterOption("rshcmd", options)
user <- getClusterOption("user", options)
cmd <- shQuote(cmd)
cmd <- paste(rshcmd, "-l", user, machine, cmd)
}
if (.Platform$OS.type == "windows") {
system(cmd, wait = FALSE, input = "")
}
else system(cmd, wait = FALSE)
by my variant, which gives me cmd
like this:
plink -ssh Rebelion@ClusterNode1 -pw myPasswd123 "Rscript --default-packages=datasets,utils,grDevices,stats,graphics,methods -e parallel!:::.slaveRSOCK MASTER=CLUSTERNODE1 PORT=11038 TIMEOUT=2592000 XDR=TRUE".
ClusterNode1 here is a current machine (I logged as Rebelion, it's an administrator login).
But system(cmd, wait=FALSE, input="")
gives me this:
Fatal error: creation of tmpfile failed -- set TMPDIR suitably?
I don't know why I get this error and what should I do. I set TMPDIR
, TMP
and TEMP
variables as %USERPROFILE%/AppData/Local/Temp
, I set privilegies on maximum for all kind of users except guests.
Could anyone helps me to solve this problem? Thnxs.
The TMPDIR
must be an actual path, like C:\Users\martin\AppData\Local\Temp
.
It cannot contain another environment variables.
Use system2
call and pass TMPDIR variable using env
argument.
From documentation:
system2(command, args = character(), stdout = "", stderr = "", stdin = "", input = NULL, env = character(), wait = TRUE, minimized = FALSE, invisible = TRUE)
env
: character vector of name=value strings to set environment variables.
Also, try giving the TMPDIR path as an absolute path, such as C:\Windows\Temp, instead of using CMD environment variables.
This looks like an issue with your login startup setting on that remote machine. I would try to get the following to work (from the Windows command prompt):
plink -ssh Rebelion@ClusterNode1 -pw myPasswd123 "Rscript --version"
and if that works, make sure:
plink -ssh Rebelion@ClusterNode1 -pw myPasswd123 "Rscript -e 1+2"
also works. Only then, start worrying about doing this with the parallel package in R.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With