Set limit to the number of threads if it is unset when we ask for the number.

This commit is contained in:
Michal Tóth 2025-01-08 14:39:30 +01:00
parent 25cd79c04b
commit b865e80c2f

View File

@ -731,6 +731,9 @@ private:
std::cout << ("Warning: Invalid value for OMP_NUM_THREADS environment variable.") << std::endl;
}
}
} else {
// Set a limit to OMP threads. Defaults can saturate the whole machine.
omp_set_num_threads(threads);
}
first_time = false;