Parallel Processing

{parallel}

# The number of physical cores in the hardware:
parallel::detectCores(logical = FALSE)
[1] 4
# The number of possible independent processes that can 
# be simultaneously used:  
parallel::detectCores(logical = TRUE)
[1] 8

{doMC}

# Unix and macOS only
library(doMC)
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
registerDoMC(cores = 8)

# Now run fit_resamples()...

registerDoSEQ() # Reset

{doParallel}

# All operating systems
library(doParallel)
# Create a cluster object and then register: 
cl <- makePSOCKcluster(8)
registerDoParallel(cl)

## Run

# Reset
stopCluster(cl)