Skip to content
Snippets Groups Projects
Commit c894d6f7 authored by Elisa Rebolini's avatar Elisa Rebolini
Browse files

remove double deallocation causing segfault

parent d0035181
No related branches found
No related tags found
2 merge requests!16Remove the reordering of the vectors when convergence is not reached,!15Possibility to increase the number of vectors to be computed
Pipeline #24212 passed with warnings
This commit is part of merge request !15. Comments created here will be created in the context of that merge request.
...@@ -350,7 +350,7 @@ contains ...@@ -350,7 +350,7 @@ contains
write(f_restart) (psi_SASS(idet,ivec),idet=1,ndet) write(f_restart) (psi_SASS(idet,ivec),idet=1,ndet)
end do end do
flush(f_restart) flush(f_restart)
!--- debug !--- debug
if (debugdav) then if (debugdav) then
write(fdav,*) "psi_SASS - Iter =", iter write(fdav,*) "psi_SASS - Iter =", iter
...@@ -791,7 +791,7 @@ contains ...@@ -791,7 +791,7 @@ contains
close(f_mat) close(f_mat)
close(f_mat2) close(f_mat2)
close(f_bmat) close(f_bmat)
if (debugdav) close(666) if (debugdav) close(fdav)
close(667) close(667)
close(f_Vm,status="delete") close(f_Vm,status="delete")
close(f_Wm,status="delete") close(f_Wm,status="delete")
......
...@@ -164,6 +164,17 @@ subroutine def_files(prog_info) ...@@ -164,6 +164,17 @@ subroutine def_files(prog_info)
open (f_restart,file=prog_info%prefix(1:n)//"."//file_restart,& open (f_restart,file=prog_info%prefix(1:n)//"."//file_restart,&
form="unformatted") form="unformatted")
if (prog_info%restart) then
write(filename_mat,'(3A)') prog_info%prefix(1:n),".",file_guess
inquire(file=filename_mat, exist=lexist_mat)
if (.not. lexist_mat) then
call SASS_quit('restart requires in .guess file in input',f_output)
else
open (f_guess,file=prog_info%prefix(1:n)//"."//file_guess,&
form="unformatted")
endif
endif
if (prog_info%lreadHmat) then if (prog_info%lreadHmat) then
write(filename_mat,'(3A)') prog_info%prefix(1:n),".",file_mat write(filename_mat,'(3A)') prog_info%prefix(1:n),".",file_mat
inquire(file=filename_mat, exist=lexist_mat) inquire(file=filename_mat, exist=lexist_mat)
...@@ -198,11 +209,13 @@ subroutine def_files(prog_info) ...@@ -198,11 +209,13 @@ subroutine def_files(prog_info)
open (f_bdet,file=file_bdet,form="unformatted") open (f_bdet,file=file_bdet,form="unformatted")
open (f_info,file=file_info,form="unformatted") open (f_info,file=file_info,form="unformatted")
open (f_restart,file=file_restart,form="unformatted") open (f_restart,file=file_restart,form="unformatted")
open (f_guess,file=file_guess,form="unformatted")
open (f_mat,file=file_mat,form="formatted") open (f_mat,file=file_mat,form="formatted")
open (f_mat2,file=file_mat2,form="formatted") open (f_mat2,file=file_mat2,form="formatted")
open (f_bmat,file=file_bmat,form="unformatted") open (f_bmat,file=file_bmat,form="unformatted")
if (prog_info%id_cpu.eq.0) then if (prog_info%id_cpu.eq.0) then
if (prog_info%iprint .gt. 1) then if (prog_info%iprint .gt. 1) then
write(f_output,9001) file_fock, file_fock write(f_output,9001) file_fock, file_fock
......
...@@ -1051,21 +1051,11 @@ contains ...@@ -1051,21 +1051,11 @@ contains
if (debugl) write(f_output,*) ">>> Debug : Guess vectors read from file" if (debugl) write(f_output,*) ">>> Debug : Guess vectors read from file"
end if end if
!!$--- Lecture des infos sur f_guess (chaque proc a son propre pointeur) ! !!$--- Lecture des infos sur f_guess (chaque proc a son propre pointeur)
file_guess = "guess" ! fichier restart du precedent calcul utilise pour le
! restart de la procedure de Davidson
if (prog_info%Yprefix) then
call noblancs(prog_info%prefix,n)
open (f_guess,file=prog_info%prefix(1:n)//"."//file_guess,&
form="unformatted")
else
open (f_guess,file=file_guess,form="unformatted")
end if
! lit tout rewind(f_guess)
read(f_guess) nveclus,ndet,nconv, iter read(f_guess,iostat=my_iostat, iomsg=my_iomsg) nveclus,ndet,nconv, iter
read(f_guess) Ecoeur,PotNuc read(f_guess,iostat=my_iostat, iomsg=my_iomsg) Ecoeur,PotNuc
allocate (ener(nveclus)) allocate (ener(nveclus))
read(f_guess) (ener(ivec), ivec =1,nveclus) read(f_guess) (ener(ivec), ivec =1,nveclus)
...@@ -1212,7 +1202,7 @@ contains ...@@ -1212,7 +1202,7 @@ contains
psi_0_guess(:,:) = 0.d0 psi_0_guess(:,:) = 0.d0
psi_0_guess(1:ndet , 1:n) = tmp_guess(1:ndet , 1:n) psi_0_guess(1:ndet , 1:n) = tmp_guess(1:ndet , 1:n)
deallocate(ener,tmp_guess) deallocate(tmp_guess)
!!$ sorties !!$ sorties
......
...@@ -263,7 +263,9 @@ Module Info ...@@ -263,7 +263,9 @@ Module Info
!> @brief irrep of the target states !> @brief irrep of the target states
Integer (KIND=kd_int), public :: vec_irrep Integer (KIND=kd_int), public :: vec_irrep
!> @brief Number of target states !> @brief Number of target states
Integer (KIND=kd_int), public :: nvec, nconv Integer (KIND=kd_int), public :: nvec
!> @brief Number of converged states
Integer (KIND=kd_int), public :: nconv
!> @brief Number of spin configurations built from ref0 !> @brief Number of spin configurations built from ref0
Integer (KIND=kd_int), public :: ncfspref0 Integer (KIND=kd_int), public :: ncfspref0
end type v_infotype end type v_infotype
......
File deleted
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment