rpc_rr_example: Example Functions of RPC Related to Remote R Server

Description Usage Arguments Details Value Examples

Description

Example functions of RPC related to remote R server

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13

Arguments

machine

A machine configuration. See ?machine.

cmd

the main command to be executed on the server.

preload

further commands preloaded before the main command is executed.

Details

Using either ssh or plink to launch a remote R server.

NO further input from stdin is expected. Outputs or errors may not be captured by R.

start_rr() starts a remote R server on a remote server. Typical commands to launch a remoter R server is given in the example. The linux/unix commands are as the following:

check_rr() checks if there is a remote R server on a remote server. Lunix/unix commands ps and grep are used.

kill_rr() kills remote R servers if found. Lunix/unix commands ps, grep, awk, and kill are used.

checkx_rr(), killx_rr(), and startx_rr() are functions with virtual X11 windows.

Value

Mainly the message received at the command line will be printed, but may not be captured by R.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
library(pbdRPC, quietly = TRUE)
# rpcopt_set(user = "snoweye", hostname = "192.168.56.101")
m <- machine(user = "snoweye", hostname = "192.168.56.101")

check_rr(m)    # pid 2857 (may differ)
kill_rr(m)     # all remoter pids are killed
check_rr(m)    # make sure no remoter servers are running

### use "; " to bypass multiple commands
preload <- "source ~/work-my/00_set_devel_R; "

### start a new remoter server
start_rr(m, preload = preload)
check_rr(m)
kill_rr(m)

### Example: for module load on supercomputers
preload <- "module load r; "    # e.g. via module load r
start_rr(m, preload = preload)
check_rr(m)
kill_rr(m)

## End(Not run)

pbdRPC documentation built on May 1, 2019, 7:28 p.m.