StartPE {taskPR}R Documentation

Start/Stop Parallel Execution

Description

StartPE starts the parallel engine. If spawn is true, then the worker processes are spawned (using MPI\_COMM\_Spawn from MPI-2). StopPE stops the parallel engine. This call blocks until all jobs are finished.

Usage

StartPE(num = 2, port = 32000, verbose=0, spawn=TRUE)
StopPE()

Arguments

num number of worker processes to use
port the TCP port to use for communicating with workers
verbose the verbose level: 0, 1, or 2 at the moment
spawn should the worker processes be spawned?

Details

The parallel engine must be enabled before instructions can be executed in parallel. The engine can be stopped and restarted with a different number of worker processes, if desired. The parallel engine consists of num + 1 threads and num worker processes. The worker processes can either be spawned (done through an MPI call) or connected manually. If StartPE is run with spawn = FALSE, then it will block until num worker processes have connected.

See Also

PE For executing jobs in the background/parallel. POBJ For returning background/parallel jobs to the main process. StartWorker For manually starting worker processes.

Examples

## Not run: 
# If you have MPI running
StartPE(2)

x = matrix(rnorm(128 * 128), 128, 128)

PE( a <- svd(x) )
PE( b <- solve(x) )
PE( y <- b %*% a$u )
POBJ( y )
str(y)
StopPE()
## End(Not run)

[Package taskPR version 0.30 Index]