beowulf_cluster {spatialRF} | R Documentation |
Defines a beowulf cluster
Description
Defines a Beowulf cluster from the IPs of the machines in the cluster, the number of cores of each machine, and the user name. The returned cluster has to be registered with doParallel::registerDoParallel()
.
Usage
beowulf_cluster(
cluster.ips = NULL,
cluster.cores = NULL,
cluster.user = Sys.info()[["user"]],
cluster.port = "11000",
outfile = NULL
)
Arguments
cluster.ips |
Character vector with the IPs of the machines in the cluster. The first machine will be considered the main node of the cluster, and will generally be the machine on which the R code is being executed. Default: |
cluster.cores |
Numeric integer vector, number of cores on each machine. Default: |
cluster.user |
Character string, name of the user (should be the same throughout machines), Defaults to the current system user. |
cluster.port |
Character, port used by the machines in the cluster to communicate. The firewall in all computers must allow traffic from and to such port. Default: |
outfile |
Where to direct the messages provided by the workers. When working on a local computer, |
Value
A list ready to be used as input for the spec
argument of the function makeCluster.
Examples
if(interactive()){
beowulf.cluster <- beowulf_cluster(
cluster.ips = c(
"10.42.0.1",
"10.42.0.34",
"10.42.0.104"
),
cluster.cores = c(7, 4, 4),
cluster.user = "blas",
cluster.port = "11000"
)
doParallel::registerDoParallel(cl = beowulf.cluster)
#PARALLELIZED foreach LOOP HERE
parallel::stopCluster(cl = beowulf.cluster)
}