hsdar_parallel: hsdar_parallel

View source: R/multicore_funtions.R

hsdar_parallelR Documentation

hsdar_parallel

Description

Get all functions which support parallel execution. Currently, the parallel backend functions in doMPI and doMC are supported.

Usage

hsdar_parallel() 

Details

Parallel execution is performed via the foreach-package. Care is taken that a function will never run in parallel if the calling function is already using multicore processing.

Value

Vector containing supported function names

Author(s)

Lukas Lehnert

Examples

## Not run: 
supported_functions <- hsdar_parallel()
supported_functions

data(spectral_data)

## Example for Windows and other systems where doMPI is available
## Load library
library(doMPI)
## Register number of workers
cl <- startMPIcluster(count = 3)
registerDoMPI(cl)

## Transform speclib using 3 cores
bd <- transformSpeclib(spectral_data)

## Close the cluster (important to get rid of processes)
closeCluster(cl)

## Example for Linux and other systems where doMC is available
## Load library
library(doMC)
## Register number of workers
registerDoMC(3)

## Transform speclib using 3 cores
bd <- transformSpeclib(spectral_data)

## End(Not run)

hsdar documentation built on March 18, 2022, 6:35 p.m.