threads: Get and set the number of OpenMP threads to be used in cheapr

get_max_threadsR Documentation

Get and set the number of OpenMP threads to be used in cheapr

Description

The default number of threads in cheapr is 2 (if your system has at least 2 available threads). You can change the number of threads via set_threads(). To see the number of threads currently being used, run get_threads(). To see the maximum number of threads your machine can use, run get_max_threads()

Usage

get_max_threads()

set_threads(n)

get_threads()

Arguments

n

⁠[integer(1)]⁠ - Number of threads to use.

Value

get_max_threads() returns the max number of threads you can use.
get_threads() returns the number of threads that are being used.
set_threads() invisibly sets the number of threads to be used.


cheapr documentation built on Jan. 8, 2026, 5:09 p.m.