Rclusterpp.setThreads: Set number of threads used in clustering

View source: R/Rclusterpp.hclust.R

Rclusterpp.setThreadsR Documentation

Set number of threads used in clustering

Description

Sets the number of threads used by the OpenMP based parallelism in hierarchical clustering.

Usage

Rclusterpp.setThreads(threads = 1)

Arguments

threads

Desired number of threads. NULL will set number of threads to number of processors.

Details

Simple wrapper for omp_set_num_threads when OpenMP is available, otherwise behaves as a NOOP. When threads==NULL, the number of processors will be determined via omp_get_num_procs and number of threads set to that value. Note on modern Intel processors with hyperthreading, this number is typically the number of hyperthread cores, and thus typically two times the number of physcal cores. Setting the threading that high is not always advantageous. Note that number of threads can also be set via the OMP_NUM_THREADS environment variable.

Value

Integer number of threads

Author(s)

Michael Linderman

References

https://www.openmp.org/

Examples

# Set to one thread
Rclusterpp.setThreads(1)

# Set to number of threads equal to number of processors
Rclusterpp.setThreads()

nolanlab/Rclusterpp documentation built on Aug. 24, 2022, 5:41 p.m.