get_max_threads: Get the maximum number of threads available

View source: R/ctools.R

get_max_threadsR Documentation

Get the maximum number of threads available

Description

This is a wrapper for the OpenMP-function omp_get_max_threads(), hence the function will report the result of the according omp-function. Note: The returned value does not necessarily reflect the number of physical cores present but in most cases it will.

Usage

get_max_threads()

Value

Returns the value reported by omp_get_max_threads()

See Also

set_num_threads, get_num_threads, check_openmp

Examples


# set number of threads to the value reported by get_max_threads()
n_threads <- get_max_threads()
set_num_threads(n_threads)

# check
get_num_threads()



cheuerde/cpgen documentation built on July 27, 2023, 11:34 a.m.