Learn R Programming

ParallelLogger (version 1.1.1)

makeCluster: Create a cluster of nodes for parallel computation

Description

Create a cluster of nodes for parallel computation

Usage

makeCluster(numberOfThreads, singleThreadToMain = TRUE,
  divideFfMemory = TRUE, setFfTempDir = TRUE)

Arguments

numberOfThreads

Number of parallel threads.

singleThreadToMain

If numberOfThreads is 1, should we fall back to running the process in the main thread?

divideFfMemory

When TRUE, the memory available for processing ff and ffdf objects will be equally divided over the threads.

setFfTempDir

When TRUE, the ffTempDir option will be copied to each thread.

Value

An object representing the cluster.

Examples

Run this code
# NOT RUN {
fun <- function(x) {
  return (x^2)
}

cluster <- makeCluster(numberOfThreads = 3)
clusterApply(cluster, 1:10, fun)
stopCluster(cluster)
# }

Run the code above in your browser using DataLab