Skip to content

Commit

Permalink
Bug fix for parallel runs: state following with ADDED_MOS (#3199)
Browse files Browse the repository at this point in the history
  • Loading branch information
juerghutter committed Jan 4, 2024
1 parent 969d126 commit 38b08aa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/qs_tddfpt2_assign.F
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ SUBROUTINE assign_state(qs_env, matrix_s, evects, mos, wfn_history, my_state)
END IF
END IF
DO ispin = 1, nspins
CALL cp_fm_get_info(wfn_history%evect(ispin), ncol_global=ncol)
CALL cp_fm_to_fm(evects(ispin, my_state), wfn_history%evect(ispin))
CALL cp_fm_to_fm(psi0(ispin), wfn_history%cpmos(ispin))
CALL cp_fm_to_fm(psi0(ispin), wfn_history%cpmos(ispin), ncol, 1, 1)
END DO
!
DEALLOCATE (dv)
Expand All @@ -135,11 +136,12 @@ SUBROUTINE assign_state(qs_env, matrix_s, evects, mos, wfn_history, my_state)
ALLOCATE (wfn_history%cpmos(nspins))
DO ispin = 1, nspins
CALL cp_fm_create(wfn_history%evect(ispin), evects(ispin, 1)%matrix_struct, "Xvec")
CALL cp_fm_create(wfn_history%cpmos(ispin), psi0(ispin)%matrix_struct, "Cvec")
CALL cp_fm_create(wfn_history%cpmos(ispin), evects(ispin, 1)%matrix_struct, "Cvec")
END DO
DO ispin = 1, nspins
CALL cp_fm_get_info(wfn_history%evect(ispin), ncol_global=ncol)
CALL cp_fm_to_fm(evects(ispin, my_state), wfn_history%evect(ispin))
CALL cp_fm_to_fm(psi0(ispin), wfn_history%cpmos(ispin))
CALL cp_fm_to_fm(psi0(ispin), wfn_history%cpmos(ispin), ncol, 1, 1)
END DO
wfn_history%xsval = 1.0_dp
wfn_history%gsval = 1.0_dp
Expand Down Expand Up @@ -188,7 +190,7 @@ SUBROUTINE lowdin_orthogonalization(vmatrix, xmatrix, ncol, matrix_s)
CALL cp_fm_get_info(matrix=vmatrix, nrow_global=n, ncol_global=ncol_global)
IF (ncol .GT. ncol_global) CPABORT("Wrong ncol value")

CALL cp_fm_create(sc, vmatrix%matrix_struct, "SC")
CALL cp_fm_create(sc, xmatrix%matrix_struct, "SC")
CALL cp_dbcsr_sm_fm_multiply(matrix_s, vmatrix, sc, ncol)

NULLIFY (fm_struct_tmp)
Expand Down

0 comments on commit 38b08aa

Please sign in to comment.