From 14a970a819a7d2491ac50c7739c77adc0579eb3c Mon Sep 17 00:00:00 2001 From: Ydrnan Date: Sat, 28 Sep 2024 12:00:25 +0200 Subject: [PATCH 1/2] fix ccsd allocation by properly doing the i32 to i64 conversion --- src/gpu/gpu_module.F90 | 51 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/src/gpu/gpu_module.F90 b/src/gpu/gpu_module.F90 index 797a8839..90b82667 100644 --- a/src/gpu/gpu_module.F90 +++ b/src/gpu/gpu_module.F90 @@ -268,8 +268,12 @@ module gpu implicit none type(gpu_double1), intent(inout) :: ptr integer, intent(in) :: s + integer*8 :: s_8, n - call gpu_allocate_c(ptr%c, s*8_8) + s_8 = s + n = s_8 * 8_8 + + call gpu_allocate_c(ptr%c, n) call c_f_pointer(ptr%c, ptr%f, (/ s /)) end subroutine @@ -277,8 +281,13 @@ module gpu implicit none type(gpu_double2), intent(inout) :: ptr integer, intent(in) :: s1, s2 + integer*8 :: s1_8, s2_8, n - call gpu_allocate_c(ptr%c, s1*s2*8_8) + s1_8 = s1 + s2_8 = s2 + n = s1_8 * s2_8 * 8_8 + + call gpu_allocate_c(ptr%c, n) call c_f_pointer(ptr%c, ptr%f, (/ s1, s2 /)) end subroutine @@ -286,8 +295,14 @@ module gpu implicit none type(gpu_double3), intent(inout) :: ptr integer, intent(in) :: s1, s2, s3 + integer*8 :: s1_8, s2_8, s3_8, n - call gpu_allocate_c(ptr%c, s1*s2*s3*8_8) + s1_8 = s1 + s2_8 = s2 + s3_8 = s3 + n = s1_8 * s2_8 * s3_8 * 8_8 + + call gpu_allocate_c(ptr%c, n) call c_f_pointer(ptr%c, ptr%f, (/ s1, s2, s3 /)) end subroutine @@ -295,8 +310,15 @@ module gpu implicit none type(gpu_double4), intent(inout) :: ptr integer, intent(in) :: s1, s2, s3, s4 + integer*8 :: s1_8, s2_8, s3_8, s4_8, n - call gpu_allocate_c(ptr%c, s1*s2*s3*s4*8_8) + s1_8 = s1 + s2_8 = s2 + s3_8 = s3 + s4_8 = s4 + n = s1_8 * s2_8 * s3_8 * s4_8 * 8_8 + + call gpu_allocate_c(ptr%c, n) call c_f_pointer(ptr%c, ptr%f, (/ s1, s2, s3, s4 /)) end subroutine @@ -304,8 +326,16 @@ module gpu implicit none type(gpu_double5), intent(inout) :: ptr integer, intent(in) :: s1, s2, s3, s4, s5 + integer*8 :: s1_8, s2_8, s3_8, s4_8, s5_8, n - call gpu_allocate_c(ptr%c, s1*s2*s3*s4*s5*8_8) + s1_8 = s1 + s2_8 = s2 + s3_8 = s3 + s4_8 = s4 + s5_8 = s5 + n = s1_8 * s2_8 * s3_8 * s4_8 * s5_8 * 8_8 + + call gpu_allocate_c(ptr%c, n) call c_f_pointer(ptr%c, ptr%f, (/ s1, s2, s3, s4, s5 /)) end subroutine @@ -313,8 +343,17 @@ module gpu implicit none type(gpu_double6), intent(inout) :: ptr integer, intent(in) :: s1, s2, s3, s4, s5, s6 + integer*8 :: s1_8, s2_8, s3_8, s4_8, s5_8, s6_8, n - call gpu_allocate_c(ptr%c, s1*s2*s3*s4*s5*s6*8_8) + s1_8 = s1 + s2_8 = s2 + s3_8 = s3 + s4_8 = s4 + s5_8 = s5 + s6_8 = s6 + n = s1_8 * s2_8 * s3_8 * s4_8 * s5_8 * s6_8 * 8_8 + + call gpu_allocate_c(ptr%c, n) call c_f_pointer(ptr%c, ptr%f, (/ s1, s2, s3, s4, s5, s6 /)) end subroutine From a894986631203c62c09d5d63f3661b83a03df5ae Mon Sep 17 00:00:00 2001 From: Ydrnan Date: Sat, 28 Sep 2024 12:01:53 +0200 Subject: [PATCH 2/2] abort if cc_update_method is unknown --- src/ccsd/ccsd_space_orb_sub.irp.f | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ccsd/ccsd_space_orb_sub.irp.f b/src/ccsd/ccsd_space_orb_sub.irp.f index e65b4e39..e4907f22 100644 --- a/src/ccsd/ccsd_space_orb_sub.irp.f +++ b/src/ccsd/ccsd_space_orb_sub.irp.f @@ -237,6 +237,7 @@ subroutine run_ccsd_space_orb call update_t2(nO,nV,cc_space_f_o,cc_space_f_v,r2%f,t2%f) else print*,'Unkown cc_method_method: '//cc_update_method + call abort endif call update_tau_space(nO,nV,t1%f,t1,t2,tau)