下面的程序为什么用release运行仍然是单线程??
#include
#include "omp.h"
#include
using namespace std;
int main() {
int k = 20;
int j[10] = {101,102,103,104,105,106,107,108,109,110};
omp_set_num_threads(4);
#pragma omp parallel for private(k) firstprivate(j)
for ( k=0; k < 10; k++)
{
int threadId = omp_get_thread_num();
int threadnum= omp_get_num_threads();
printf("j[%d]->%10d\tk->%d\t",k,j[k],k);
j[k] = k*k;
printf("j[%d]->%d->%d->%d\n",k,j[k],threadId,threadnum);
}
system("pause");
}