diff --git a/src/local_gemm_api.F b/src/local_gemm_api.F index 4f9a897467..5a59ff8e95 100644 --- a/src/local_gemm_api.F +++ b/src/local_gemm_api.F @@ -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, & @@ -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() diff --git a/src/mp2_types.F b/src/mp2_types.F index 418f5c17bd..cd2b99ba84 100644 --- a/src/mp2_types.F +++ b/src/mp2_types.F @@ -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. diff --git a/src/rpa_exchange.F b/src/rpa_exchange.F index 0d5520356b..0da6eab249 100644 --- a/src/rpa_exchange.F +++ b/src/rpa_exchange.F @@ -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() @@ -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 @@ -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 @@ -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) diff --git a/tests/QS/regtest-ri-rpa-exchange/TEST_FILES b/tests/QS/regtest-ri-rpa-exchange/TEST_FILES index cb73a90265..e2b3c431bc 100644 --- a/tests/QS/regtest-ri-rpa-exchange/TEST_FILES +++ b/tests/QS/regtest-ri-rpa-exchange/TEST_FILES @@ -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