auto_cluster {eList} | R Documentation |
A function to quickly create a cluster for use in parallel vector comprehensions.
Use makeCluster
from the parallel
package
for greater control. It defaults to making a PSOCK cluster on Windows systems and
a Fork cluster on unix-based systems. close_cluster
is a wrapper to
stopCluster
.
auto_cluster(ncore = detectCores() - 1)
close_cluster(clust)
ncore |
number of cores/nodes to use. If not specified, it attempts to detect the number of cores available and uses all but 1. |
clust |
cluster to close the connection to |
an object of class c("SOCKcluster", "cluster")
close_cluster
: close an open connection to a cluster
## Parallel vector comprehension
cluster <- auto_cluster(2)
Num(for (i in 1:1000) exp(sqrt(i)), clust=cluster)
close_cluster(cluster)