This program aborts, much to my surprise. #include <stdlib.h> #include <omp.h>
int main() { // Explicitly set number of threads. const int threads_wanted = 20; omp_set_dynamic(false); omp_set_num_threads(threads_wanted); if (omp_get_num_threads() != threads_wanted) abort(); // Do work. return 0; } This is very similar to the omp_set_dynamic example in the OpenMP 3.0 draft spec . See page 270. -- Summary: omp_set_num_threads not working? Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bkoz at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35644