OpenMP output for “for” loop
问题 I am new to OpenMP and I just tried to write a small program with the parallel for construct. I have trouble understanding the output of my program. I don't understand why thread number 3 prints the output before 1 and 2. Could someone offer me an explanation? So, the program is: #pragma omp parallel for for (i = 0; i < 7; i++) { printf("We are in thread number %d and are printing %d\n", omp_get_thread_num(), i); } and the output is: We are in thread number 0 and are printing 0 We are in