Skip to content

Commit

Permalink
AXK: Fix dashboard (cp2k#3471)
Browse files Browse the repository at this point in the history
  • Loading branch information
fstein93 authored Jun 13, 2024
1 parent 578b4e2 commit 0a48604
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/local_gemm_api.F
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MODULE local_gemm_api
C_PTR
#if defined(__SPLA) && defined(__OFFLOAD_GEMM)
USE input_constants, ONLY: do_dgemm_spla
USE ISO_C_BINDING, ONLY: IS_C_ASSOCIATED
USE ISO_C_BINDING, ONLY: C_ASSOCIATED
USE spla, ONLY: SPLA_PU_HOST, &
SPLA_PU_GPU, &
SPLA_OP_NONE, &
Expand Down Expand Up @@ -161,7 +161,7 @@ SUBROUTINE local_gemm_create(ctx, pu)
#if defined(__SPLA) && defined(__OFFLOAD_GEMM)
INTEGER :: error_

IF (.NOT. IS_C_ASSOCIATED(ctx%spla_context)) THEN
IF (.NOT. C_ASSOCIATED(ctx%spla_context)) THEN
IF (do_dgemm == do_dgemm_spla) THEN
CALL offload_activate_chosen_device()

Expand Down
5 changes: 3 additions & 2 deletions src/mp2_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ MODULE mp2_types
do_admm = .FALSE., &
do_rse = .FALSE., &
print_dgemm_info = .FALSE.
TYPE(dbcsr_type), DIMENSION(:), ALLOCATABLE :: mo_coeff_o, &
mo_coeff_v
! GCC 8 has an issue with this being an ALLOCATABLE
TYPE(dbcsr_type), DIMENSION(:), POINTER :: mo_coeff_o => NULL(), &
mo_coeff_v => NULL()
INTEGER :: exchange_correction = rpa_exchange_none, &
exchange_block_size = -1
LOGICAL :: use_hfx_implementation = .FALSE.
Expand Down
16 changes: 9 additions & 7 deletions src/rpa_exchange.F
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ MODULE rpa_exchange
TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: mat_hfx => NULL()
TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: dbcsr_Gamma_munu_P => NULL()
TYPE(dbcsr_type), ALLOCATABLE, DIMENSION(:) :: dbcsr_Gamma_inu_P
TYPE(dbcsr_type), DIMENSION(:), ALLOCATABLE :: mo_coeff_o
TYPE(dbcsr_type), DIMENSION(:), ALLOCATABLE :: mo_coeff_v
! Workaround GCC 8
TYPE(dbcsr_type), DIMENSION(:), POINTER :: mo_coeff_o => NULL()
TYPE(dbcsr_type), DIMENSION(:), POINTER :: mo_coeff_v => NULL()
TYPE(dbcsr_type) :: work_ao
TYPE(hfx_type), DIMENSION(:, :), POINTER :: x_data => NULL()
TYPE(mp_para_env_type), POINTER :: para_env => NULL()
Expand Down Expand Up @@ -230,14 +231,14 @@ SUBROUTINE rpa_exchange_work_create(exchange_work, qs_env, para_env_sub, mat_mun
CALL exchange_work%exchange_env%create(qs_env, mat_munu%matrix, para_env_sub, fm_mat_S)
END IF

IF (ALLOCATED(qs_env%mp2_env%ri_rpa%mo_coeff_o)) THEN
IF (ASSOCIATED(qs_env%mp2_env%ri_rpa%mo_coeff_o)) THEN
DO ispin = 1, SIZE(qs_env%mp2_env%ri_rpa%mo_coeff_o)
CALL dbcsr_release(qs_env%mp2_env%ri_rpa%mo_coeff_o(ispin))
END DO
DEALLOCATE (qs_env%mp2_env%ri_rpa%mo_coeff_o)
END IF

IF (ALLOCATED(qs_env%mp2_env%ri_rpa%mo_coeff_v)) THEN
IF (ASSOCIATED(qs_env%mp2_env%ri_rpa%mo_coeff_v)) THEN
DO ispin = 1, SIZE(qs_env%mp2_env%ri_rpa%mo_coeff_v)
CALL dbcsr_release(qs_env%mp2_env%ri_rpa%mo_coeff_v(ispin))
END DO
Expand All @@ -257,7 +258,7 @@ SUBROUTINE rpa_exchange_work_create(exchange_work, qs_env, para_env_sub, mat_mun
SUBROUTINE hfx_create_subgroup(exchange_env, qs_env, mat_munu, para_env_sub, fm_mat_S)
CLASS(rpa_exchange_env_type), INTENT(INOUT) :: exchange_env
TYPE(dbcsr_type), INTENT(IN) :: mat_munu
TYPE(qs_environment_type), POINTER, INTENT(IN) :: qs_env
TYPE(qs_environment_type), POINTER :: qs_env
TYPE(mp_para_env_type), POINTER, INTENT(IN) :: para_env_sub
TYPE(cp_fm_type), DIMENSION(:), INTENT(IN) :: fm_mat_S

Expand All @@ -276,8 +277,9 @@ SUBROUTINE hfx_create_subgroup(exchange_env, qs_env, mat_munu, para_env_sub, fm_

CALL timeset(routineN, handle)

CALL MOVE_ALLOC(qs_env%mp2_env%ri_rpa%mo_coeff_o, exchange_env%mo_coeff_o)
CALL MOVE_ALLOC(qs_env%mp2_env%ri_rpa%mo_coeff_v, exchange_env%mo_coeff_v)
exchange_env%mo_coeff_o => qs_env%mp2_env%ri_rpa%mo_coeff_o
exchange_env%mo_coeff_v => qs_env%mp2_env%ri_rpa%mo_coeff_v
NULLIFY (qs_env%mp2_env%ri_rpa%mo_coeff_o, qs_env%mp2_env%ri_rpa%mo_coeff_v)

nspins = SIZE(exchange_env%mo_coeff_o)

Expand Down
2 changes: 1 addition & 1 deletion tests/QS/regtest-ri-rpa-exchange/TEST_FILES
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RPA_AXK_H2O.inp 11 1e-09 -17.160620212320048
RPA_AXK_H2O_svd.inp 11 1e-09 -17.160620212321199
RPA_AXK_H2O_hfx.inp 11 1e-09 -17.122001748342520
RPA_AXK_H2O_hfx.inp 11 2e-07 -17.122001748342520
RPA_SOSEX_H2O.inp 11 1e-09 -17.132129178553146
RPA_AXK_CH3.inp 11 3e-05 -7.177515835708672
#EOF

0 comments on commit 0a48604

Please sign in to comment.