50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

mpMap2 (version 1.0.0)

omp_set_num_threads: Get or set number of threads for OpenMP

Description

Get or set the number of threads for OpenMP

Usage

omp_set_num_threads(num)

omp_get_num_threads()

Arguments

num

New number of threads for OpenMP

Value

None

The number of threads for OpenMP

Details

Some functions in mpMap2 are parallelised. Depending on the number of cores available, and the type of workload, it may be advantageous to turn parallelisation on or off, by setting the number of OpenMP threads appropriately. Setting the number of threads to 1 turns parallelisation off

In particular, for small examples on a computer with a large number of threads, parallelisation may result in a huge decrease in performance.

This function returns an error if the package was not compiled with OpenMP.