Skip to content

Commit

Permalink
Merge pull request #994 from jautschbach/ibo-fix-pr
Browse files Browse the repository at this point in the history
bugfix for IBO localization
  • Loading branch information
edoapra authored Aug 12, 2024
2 parents 56a11b4 + 6c2cde4 commit 2a6491e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/util/ma_solve.F
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ subroutine ma_solve(g_a, g_bx)
#include "errquit.fh"

c purpose: solve linear equation system AX = B with square but
c perhaps non-symmetric matrix. ga_solve relies on SCALAPACK for
c reliable results, which we may not have available in a given build
c perhaps non-symmetric matrix A. Tests showed that ga_solve needs
c SCALAPACK for reliable results for certain equation systems
c encountered in X2C calcualtions or in the construction of IBOs,
c which we may not have available in a given build. The IBO
c localization calls ma_solve once even when SCALAPACK is available,
c because ga_solve gave an error 'ga_to_SL: rows/cols error'.

c this code used LU factorization with Lapack routine
c dgetrs to solve the equation system with Lapack dgetrs.
c the code runs serial.

integer g_a ! input: square coefficient matrix A
integer g_bx ! in-out: rhs B and solution matrix X
Expand Down Expand Up @@ -72,6 +79,8 @@ subroutine ma_solve(g_a, g_bx)
info1 = 0
info2 = 0

if (master) then

c allocate MA arrays and retrieve data from GAs

c amat
Expand Down Expand Up @@ -145,6 +154,8 @@ subroutine ma_solve(g_a, g_bx)
if (.not.ma_chop_stack(l_amat)) call
& errquit(pname//': ma_chop_stack failed k_amat',l_tmp,MA_ERR)

end if ! running on master node

c$$$c allocate one more GA, perform X = A**(-1) B, and
c$$$c store the result in g_bx
c$$$
Expand Down

0 comments on commit 2a6491e

Please sign in to comment.