问题
for (int i = 0; i < x_res; i++){
#pragma omp parallel for
for (int j = 0; j < y_res; j++) {
Ray hit = s.kd_tree->intersect(rays[i][j]);
}
}
Why is this code not working in parallel? I cannot find the reason.
The backtrace outputs this:
#0 0x00007fff8ce03bf2 in __psynch_mutexwait ()
#1 0x00007fff8cd331a1 in pthread_mutex_lock ()
#2 0x00000001000027e4 in gomp_barrier_destroy ()
#3 0x000000010000247b in gomp_team_end ()
回答1:
Download the last gcc (4.8 for now) from http://hpc.sourceforge.net/ .
The bug with OpenMP is fixed there
来源:https://stackoverflow.com/questions/9351501/why-is-this-code-giving-sigabrt-with-openmp