admin管理员组文章数量:1122846
I have a fortran function that solves an eigenproblem using ARPACK. I am trying to use this function in a parallel context. The function is called from a C file.
I was hoping this would work:
#pragma omp parallel for
for (int i=0; i < N; i++)
{
double *var1 ... ;
my_arpack_function(var1 ...); // Function call, with only vars local to the block passed
}
the function itself is not parallelized, but each thread makes their own call to the function. I was hoping this would work but it fails.
The following works, though eliminates any benefits of paralellization
#pragma omp parallel for ordered
for (int i=0; i < N; i++)
{
double *var1 ... ;
#pragma omp ordered
{
my_arpack_function(var1 ...); // Function call, with only vars local to the block passed
}
}
It is known that ARPACK is not thread-safe, which is likely the reason for this failure. Is there any way I can force a private instance of all variables used by the function?
本文标签: cHow should ARPACK be called within an openmpparallelized for loopStack Overflow
版权声明:本文标题:c - How should ARPACK be called within an openmp-parallelized for loop? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736309817a1934153.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论