为什么这段代码给SIGABRT和openMP

Why is this code giving SIGABRT with openMP?

本文关键字:SIGABRT openMP 代码 段代码 为什么      更新时间:2023-10-16
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]);
    }
}

为什么这段代码不能并行工作?我找不到原因。

回溯跟踪输出以下内容:

#0  0x00007fff8ce03bf2 in __psynch_mutexwait ()
#1  0x00007fff8cd331a1 in pthread_mutex_lock ()
#2  0x00000001000027e4 in gomp_barrier_destroy ()
#3  0x000000010000247b in gomp_team_end ()

从 http://hpc.sourceforge.net/下载最后一个 gcc(目前为 4.8(。

OpenMP 的错误在那里得到修复