为什么这个代码给SIGABRT的openMP? [英] Why is this code giving SIGABRT with openMP?
本文介绍了为什么这个代码给SIGABRT的openMP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
for(int i = 0; i #pragma omp parallel for
for(int j = 0; j& y_res; j ++){
Ray hit = s.kd_tree-> intersect(rays [i] [j]);
}
}
为什么这个代码不能并行工作?我找不到原因。
backtrace输出结果:
#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/ 。
OpenMP的错误已修复。
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 ()
解决方案Download the last gcc (4.8 for now) from http://hpc.sourceforge.net/ .
The bug with OpenMP is fixed there
这篇关于为什么这个代码给SIGABRT的openMP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文