D3DEnergetic / FIDASIM

A Neutral Beam and Fast-ion Diagnostic Modeling Suite
http://d3denergetic.github.io/FIDASIM/
Other
29 stars 19 forks source link

Use blas for solving linear equations - pgf90 only #139

Closed sfiligoi closed 6 years ago

sfiligoi commented 6 years ago

The pgf90 compiler does a very poor job optimizing matinv, and BLAS has an efficient implementation for solving linear equations.

pgf90 comes pre-packaged with BLAS libraries, so use the BLAS version in pgf90.

Avoid using BLAS with gcc for now. The benefit is much smaller, and would introduce an additional external dependency.

lstagner commented 6 years ago

What about using BLAS for solving the eigenvalues/vectors?

sfiligoi commented 6 years ago

I have tried to find the right BLAS procedure for eigenvalues/vectors, but could not find the perfect match. dgeev seems close, but does not return exactly the same result.

lstagner commented 6 years ago

I have a version of FIDASIM that uses BLAS (ls/openblas2 branch its slower but you may have better luck figuring out why.) and I used dgeev. The difference between dgeev and eigen is that eigen doesn't normalize its eigenvectors. The normalization of the eigenvectors that dgeev does is not necessary.

sfiligoi commented 6 years ago

OK, I will take a look But if we get to it, I think it should be independent of this pull request.