Is armadillo solve() thread safe?

前端 未结 2 727
清歌不尽
清歌不尽 2021-02-06 20:04

In my code I have loop in which I construct and over determined linear system and try to solve it:

#pragma omp parallel for
for (int i = 0; i < n[0]+1; i++) {         


        
2条回答
  •  花落未央
    2021-02-06 20:34

    Are you sure your systems are over determined? solve_ud in your stack trace says otherwise. Though you have solve_od too, and probably that's nothing to do with the issue. But it doesn't hurt to find why that's happening and fix it if you think the systems should be od.

    Is armadillo solve() thread safe?

    That I think depends on your lapack version, also see this. Looking at the code of solve_od all the variables accessed seem to be local. Note the warning in the code:

    NOTE: the dgels() function in the lapack library supplied by ATLAS 3.6 seems to have problems

    Thus it seems only lapack::gels can cause trouble for you. If fixing lapack is not possible, a workaround is to stack your systems and solve a single large system. That probably would be even more efficient if your individual systems are small.

提交回复
热议问题