ordered制导
#include <iostream>
#include <omp.h>
using namespace std;
int main(int argc, char* argv[]){
int d[6];
#pragma omp parallel for ordered
for (int i = 0; i < 6; ++i) {
#pragma omp ordered
{
cout << "thread " << omp_get_thread_num() << " [" << i <<"]" << endl;
}
}
return 0;
}
ordered
thread 0 [0]
thread 0 [1]
thread 1 [2]
thread 1 [3]
thread 2 [4]
thread 3 [5]
non ordered
thread thread thread 02 [4] [0]1 [2]
thread 0 [1]
thread 1 [3]
thread 3 [5]
大师傅但是
标签:ordered,thread,int,编译,omp,pragma,OpenMP,制导 From: https://www.cnblogs.com/tao-gak567/p/18066021