48 static void set(
const std::size_t n)
53 omp_set_num_threads(n);
56 throw std::invalid_argument(
"Number of threads must be positive");
65 static std::size_t
get() {
return num_threads; }
72 inline static std::size_t num_threads =
73 std::max(1, omp_get_max_threads() / 2);
76 inline static std::size_t num_threads = 1;
Centralized management of thread settings for parallel computations.
static void set(const std::size_t n)
Set the number of threads to use for parallel computations.
static std::size_t get()
Get the current number of threads used for parallel computations.
Qualitative color palette generation library.