futureverse / futureverse/parallelly

Allow arbitrary transformations cmd in makeNodePSOCK

Open
#12 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
140
Forks
9
PR merge metrics
No merged PRs in 30d

Description

The remote server I'm working with (the head node of a cluster) requires me to call newgrp then load a module for R before I open R. e.g.
```
newgrp groupname
module purge
module load R/R-4.0.0
R
```

The same goes for calling an Rscript, so currently it's not possible to use future(remote) without altering this behavior on the remote server.

There's an easy fix to this situation that just requires a allowing an arbitrary transformation, via an added argument to makeNodePSOCK , of the Rscript command that gets created internal to that function.

```
library(future)
tx <- function(x){
paste0('echo "module purge; module load R/R-4.0.0;',x,' "|newgrp groupname')
}

future::plan(list(
future::tweak(future::remote,
workers = future::makeClusterPSOCK(
workers = "servername",
homogeneous = FALSE,
rscript_transform=tx,
)
)))

```

See PR for what this would look like.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.