pbdSpawn: Server Launcher

Description Usage Arguments Details See Also Examples

View source: R/pbdSpawn.r

Description

This function is a simple wrapper around the system() command. As such, data is not shared between the calling R process and the batch processes which execute the 'body' source.

Usage

1
2
pbdSpawn(nranks = 2, mpicmd = "mpirun", bcaster = "zmq",
  port = "random", auto.dmat = FALSE)

Arguments

nranks

The number of MPI ranks to launch.

mpicmd

The command to launch mpi as a string (e.g., "mpirun", "mpiexec", "aprun", ...).

bcaster

The method used by the servers to communicate. Options are "zmq" for ZeroMQ-based communication, or "mpi" for

port

A numeric value, or optionally for pbdSpawn(), the string "random". For numeric values, this is the port that will be used for communication between the client and rank 0 of the servers. If "random" is used, then a valid, random port will be selected.

auto.dmat

Logical; deteremines if pbdDMAT should automatically be loaded and init.grid() called.

Details

Launcher for the pbdR server.

The port values between the client and server MUST agree. If they do not, this can cause the client to hang.

The servers are launched via pbdRscript().

The client is a specialized REPL that intercepts commands sent through the R interpreter. These commands are then sent from the client to and evaluated on the servers.

The client communicates over ZeroMQ with MPI rank 0 (of the servers) using a REQ/REP pattern. Both commands (from client to server) and returns (from servers to client) are handled in this way. Once a command is sent from the client to MPI rank 0, that command is then "broadcasted" from MPI rank 0 to the other MPI ranks. The method of broadcast is handled by the input bcaster. If bcaster="mpi", then MPI_bcast is used to transmit the command. Otherwise (bcaster="zmq") uses ZeroMQ with a PUSH/PULL pattern. The MPI method is probably epsilon faster, but it will busy-wait. The ZeroMQ bcast method will not busy wait, in addition to the other benefits ZeroMQ affords; thus, bcaster="zmq" is the default.

To shut down the servers and the client, use the command exit() from the remoter package.

See Also

pbdRscript

Examples

1
2
3
4
5
6
## Not run: 
library(pbdCS)
pbd_launch_servers()
pbd_launch_client()

## End(Not run)

wrathematics/pbdCS documentation built on Oct. 17, 2018, 4:33 a.m.