From 1a091a0707471c649df51bb6f4f6c7c1158b5bf1 Mon Sep 17 00:00:00 2001 From: Abdallah Ammar Date: Thu, 28 Nov 2024 18:41:00 +0100 Subject: [PATCH] few modifs --- src/RPA/phRRPA.f90 | 7 +++++++ src/cuda/src/diag_dense_dsy_mat.cu | 1 + src/cuda/src/ph_drpa_tda_sing.c | 4 ---- src/utils/read_dipole_integrals.f90 | 20 ++++++++++---------- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/RPA/phRRPA.f90 b/src/RPA/phRRPA.f90 index 4cf004c..3ddeb03 100644 --- a/src/RPA/phRRPA.f90 +++ b/src/RPA/phRRPA.f90 @@ -32,6 +32,7 @@ subroutine phRRPA(dotest,TDA,doACFDT,exchange_kernel,singlet,triplet,nBas,nC,nO, integer :: i integer :: ispin logical :: dRPA + double precision :: t1, t2 double precision :: lambda double precision,allocatable :: Aph(:,:) double precision,allocatable :: Bph(:,:) @@ -72,10 +73,16 @@ subroutine phRRPA(dotest,TDA,doACFDT,exchange_kernel,singlet,triplet,nBas,nC,nO, ispin = 1 + !call wall_time(t1) call phLR_A(ispin,dRPA,nBas,nC,nO,nV,nR,nS,lambda,eHF,ERI,Aph) + !call wall_time(t2) + !print *, "wall time for A on CPU (sec) = ", t2 - t1 if(.not.TDA) call phLR_B(ispin,dRPA,nBas,nC,nO,nV,nR,nS,lambda,ERI,Bph) + !call wall_time(t1) call phLR(TDA,nS,Aph,Bph,EcRPA(ispin),Om,XpY,XmY) + !call wall_time(t2) + !print *, "wall time diag A on CPU (sec) = ", t2 - t1 call print_excitation_energies('phRPA@RHF','singlet',nS,Om) call phLR_transition_vectors(.true.,nBas,nC,nO,nV,nR,nS,dipole_int,Om,XpY,XmY) diff --git a/src/cuda/src/diag_dense_dsy_mat.cu b/src/cuda/src/diag_dense_dsy_mat.cu index b800501..4e3b0d3 100644 --- a/src/cuda/src/diag_dense_dsy_mat.cu +++ b/src/cuda/src/diag_dense_dsy_mat.cu @@ -10,6 +10,7 @@ extern "C" void diag_dn_dsyevd(int n, int *info, double *W, double *A) { cusolverDnHandle_t cusolverH = NULL; cusolverEigMode_t jobz = CUSOLVER_EIG_MODE_VECTOR; // Compute eigenvalues and eigenvectors cublasFillMode_t uplo = CUBLAS_FILL_MODE_UPPER; // Upper triangular part of the matrix is stored + //cublasFillMode_t uplo = CUBLAS_FILL_MODE_LOWER; // Upper triangular part of the matrix is stored int lwork = 0; double *work = NULL; diff --git a/src/cuda/src/ph_drpa_tda_sing.c b/src/cuda/src/ph_drpa_tda_sing.c index 7b6e476..52ae341 100644 --- a/src/cuda/src/ph_drpa_tda_sing.c +++ b/src/cuda/src/ph_drpa_tda_sing.c @@ -83,10 +83,6 @@ void ph_drpa_tda_sing(int nO, int nBas, int nS, double *h_eps, double *h_ERI, "cudaMemcpy", __FILE__, __LINE__); check_Cuda_Errors(cudaMemcpy(h_Omega, d_Omega, nS * sizeof(double), cudaMemcpyDeviceToHost), "cudaMemcpy", __FILE__, __LINE__); - - cudaEventRecord(start, 0); - diag_dn_dsyevd(nS, d_info, d_Omega, d_A); - check_Cuda_Errors(cudaGetLastError(), "cudaGetLastError", __FILE__, __LINE__); cudaEventRecord(stop, 0); cudaEventSynchronize(stop); cudaEventElapsedTime(&elapsedTime, start, stop); diff --git a/src/utils/read_dipole_integrals.f90 b/src/utils/read_dipole_integrals.f90 index 8f56354..e3ea558 100644 --- a/src/utils/read_dipole_integrals.f90 +++ b/src/utils/read_dipole_integrals.f90 @@ -20,7 +20,7 @@ subroutine read_dipole_integrals(working_dir,nBas,R) double precision,intent(out) :: R(nBas,nBas,ncart) - integer :: status, ios + integer :: ios character(len=256) :: file_path @@ -29,9 +29,9 @@ subroutine read_dipole_integrals(working_dir,nBas,R) R(:,:,:) = 0d0 file_path = trim(working_dir) // '/int/x.dat' - open(unit=21, file=file_path, status='old', action='read', iostat=status) + open(unit=21, file=file_path, status='old', action='read', iostat=ios) - if(status /= 0) then + if(ios /= 0) then print *, "Error opening file: ", file_path stop @@ -39,7 +39,7 @@ subroutine read_dipole_integrals(working_dir,nBas,R) else do - read(21, '(I5, I5, E25.17)', iostat=ios) mu, nu, Dip + read(21, '(I7, I7, E25.17)', iostat=ios) mu, nu, Dip if(ios /= 0) exit R(mu,nu,1) = Dip R(nu,mu,1) = Dip @@ -52,9 +52,9 @@ subroutine read_dipole_integrals(working_dir,nBas,R) ! --- file_path = trim(working_dir) // '/int/y.dat' - open(unit=22, file=file_path, status='old', action='read', iostat=status) + open(unit=22, file=file_path, status='old', action='read', iostat=ios) - if(status /= 0) then + if(ios /= 0) then print *, "Error opening file: ", file_path stop @@ -62,7 +62,7 @@ subroutine read_dipole_integrals(working_dir,nBas,R) else do - read(22, '(I5, I5, E25.17)', iostat=ios) mu, nu, Dip + read(22, '(I7, I7, E25.17)', iostat=ios) mu, nu, Dip if(ios /= 0) exit R(mu,nu,2) = Dip R(nu,mu,2) = Dip @@ -75,9 +75,9 @@ subroutine read_dipole_integrals(working_dir,nBas,R) ! --- file_path = trim(working_dir) // '/int/z.dat' - open(unit=23, file=file_path, status='old', action='read', iostat=status) + open(unit=23, file=file_path, status='old', action='read', iostat=ios) - if(status /= 0) then + if(ios /= 0) then print *, "Error opening file: ", file_path stop @@ -85,7 +85,7 @@ subroutine read_dipole_integrals(working_dir,nBas,R) else do - read(23, '(I5, I5, E25.17)', iostat=ios) mu, nu, Dip + read(23, '(I7, I7, E25.17)', iostat=ios) mu, nu, Dip if(ios /= 0) exit R(mu,nu,3) = Dip R(nu,mu,3) = Dip