Rscript works with TMPDIR via plink -ssh on Windows

I want to create my own version makePSOCKclusterand newPSOCKnodeusing ssh connection via plink. So I rewrite the 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)

according to my option, which gives me cmdas follows:

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 is the current computer (I registered as Rebelion, this is the administrator login).

But system(cmd, wait=FALSE, input="")gives me this:

Fatal error: creation of tmpfile failed -- set TMPDIR suitably?

I do not know why I get this error and what should I do. I set the variables TMPDIR, TMPand TEMPhow %USERPROFILE%/AppData/Local/Temp, I set the privileges to the maximum for all types of users except guests.

Can someone help me solve this problem? Thnxs.

+6
4

TMPDIR , C:\Users\martin\AppData\Local\Temp.

.

+2

system2 TMPDIR env.

:

system2(command, args = character(), stdout = "", stderr = "", stdin = "", input = NULL, env = character(), wait = TRUE, minimized = FALSE, invisible = TRUE)

env: = .

TMPDIR , C:\Windows\Temp, CMD.

+1

. ( Windows):

plink -ssh Rebelion@ClusterNode1 -pw myPasswd123 "Rscript --version"

, , :

plink -ssh Rebelion@ClusterNode1 -pw myPasswd123 "Rscript -e 1+2"

. R.

+1

Thank you. I don’t know how to give you everything, sorry, but I really want to give you generosity. The main problem was in OpenSSH and a separate rule of rules, which does not allow you to create a session with administrator rights. Novaday I can run Rscript normally, but I have a problem with the part parallel!:::.slaveRSOCK()(I suppose this is due to delimiters and paths, I will solve this problem soon too). Thank you again and again. If you know how to give you bounty - pls tell me, I will.

0
source

Source: https://habr.com/ru/post/1015161/


All Articles