makeCluster: Create a cluster of nodes for parallel computation

View source: R/Cluster.R

makeClusterR Documentation

Create a cluster of nodes for parallel computation

Description

Create a cluster of nodes for parallel computation

Usage

makeCluster(
  numberOfThreads,
  singleThreadToMain = TRUE,
  setAndromedaTempFolder = TRUE
)

Arguments

numberOfThreads

Number of parallel threads.

singleThreadToMain

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

setAndromedaTempFolder

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

Value

An object representing the cluster.

Examples

fun <- function(x) {
  return (x^2)
}

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

ParallelLogger documentation built on Aug. 22, 2023, 5:11 p.m.