beowulf_cluster: Create a Beowulf cluster for parallel computing

View source: R/beowulf_cluster.R

beowulf_clusterR Documentation

Create a Beowulf cluster for parallel computing

Description

Creates a Beowulf cluster configuration from machine IPs, core counts, and user credentials.

Usage

beowulf_cluster(
  cluster.ips = NULL,
  cluster.cores = NULL,
  cluster.user = Sys.info()[["user"]],
  cluster.port = "11000",
  outfile = NULL
)

Arguments

cluster.ips

Character vector of machine IP addresses in the cluster. The first IP is the main node (typically the machine running this code). Default: NULL.

cluster.cores

Integer vector of core counts for each machine. Must match the length of cluster.ips. Default: NULL.

cluster.user

Character string for the user name across all machines. Default: current system user.

cluster.port

Character string specifying the communication port. Default: "11000".

outfile

Character string or NULL. Path to append worker messages, "" to print to console, or NULL (default) for ⁠/dev/null⁠ (Linux) or ⁠nul:⁠ (Windows).

Details

Network requirements: Firewalls on all machines must allow traffic on the specified port.

Usage workflow:

  1. Create cluster with this function

  2. Register with doParallel::registerDoParallel()

  3. Run parallelized code (e.g., foreach loops)

  4. Stop cluster with parallel::stopCluster()

Value

Cluster object created by parallel::makeCluster(), ready for registration with doParallel::registerDoParallel().

See Also

Other utilities: .vif_to_df(), auc(), objects_size(), optimization_function(), prepare_importance_spatial(), rescale_vector(), root_mean_squared_error(), setup_parallel_execution(), standard_error(), statistical_mode(), thinning(), thinning_til_n()

Examples

## Not run: 
# Create cluster with 3 machines
beowulf.cluster <- beowulf_cluster(
  cluster.ips = c(
    "192.168.1.10",  # main node
    "192.168.1.11",
    "192.168.1.12"
  ),
  cluster.cores = c(7, 4, 4),
  cluster.user = "username",
  cluster.port = "11000"
)

# Register cluster for parallel processing
doParallel::registerDoParallel(cl = beowulf.cluster)

# Run parallelized code (e.g., foreach loop)
# your_parallel_code_here

# Stop cluster when done
parallel::stopCluster(cl = beowulf.cluster)

## End(Not run)



spatialRF documentation built on Dec. 20, 2025, 1:07 a.m.