QuantumPackage / qp2

Quantum Package : a programming environment for wave function methods
https://quantumpackage.github.io/qp2/
GNU Affero General Public License v3.0
69 stars 32 forks source link

Problems with qp run diagonalize_h #311

Closed Navihdz closed 10 months ago

Navihdz commented 10 months ago

Hi everyone,

I hope this message finds you well. I'm currently facing an issue while attempting to execute the diagonalization command (qp run diagonalize_h) in the Quantum Package.

Problem Description:

Upon creating the ezfio file, running SCF and CISD calculations, and obtaining coefficients (psi_coef.gz) and determinants (psi_det.gz) files from qp2, I modify the determinant file by adding new alpha and beta determinant pairs (ensuring no repetition with existing determinants). Simultaneously, I add new coefficients initialized to 0 in the coefficients file. The modified files maintain the same format as the original ones.

My goal is to augment my configuration search by introducing new determinants. However, when attempting to diagonalize with an increased number of determinants (beyond 500), I encounter a memory allocation error. I'm uncertain whether I'm following the correct procedure or if additional modifications are required.

Steps Taken:

Modified the file file.ezfio/determinats/n_det to reflect the new number of determinants. Switched from WSL to Ubuntu, yet the issue persisted.

System Information:

OS: Ubuntu 22.04.3 LTS RAM: 32GB Processor: i5 10th Gen GPU: 4070 Disk: 2TB free Example Run: I executed a CISD calculation for C2, obtaining around 5000 determinants. Adding 4974 more to have a total of 9975 determinants for Davidson diagonalization. The run initiates normally, but during the diagonalization phase, a segmentation fault occurs.

Error Details:

|to_diagonalize.ezfio>
(base) ivan@ivan-B460MAORUSELITE:~/Descargas/solving_fci$ qp run diagonalize_h 
Date: 29/11/2023 00:06:36
===============
Quantum Package
===============

Git Commit: Dev stable
Git Date  : Wed Nov 8 17:28:59 2023 +0100
Git SHA1  : 0f320db735bfdbdf9861c9cad9f3f64175cc8c3c
EZFIO Dir : to_diagonalize.ezfio

Task server running : tcp://127.0.1.1:53399
 * mo_label          Canonical
* Number of determinants                                      9975
* Dimension of the psi arrays                                 9975
 Read psi_coef        9975           1
* mo_num                                                        28
* N_int                                                          1
 Read  mo_coef
 Read psi_det
 MO map initialized:                 82621
.. >>>>> [ IO READ: mo_class ] <<<<< ..
 AO map initialized :                108345
 Providing the AO integrals

.. >>>>> [ RES  MEM :          0.010 GB ] [ VIRT MEM :          1.812 GB ] <<<<< ..
.. >>>>> [ WALL TIME:           0.18  s ] [ CPU  TIME:           1.25  s ] <<<<< ..

Nuclear Coordinates (Angstroms)
===============================

================ ============ ============ ============ ============
      Atom          Charge          X            Y            Z 
================ ============ ============ ============ ============
C                    6.000000     0.000000     0.000000     0.626200
C                    6.000000     0.000000     0.000000    -0.626200
================ ============ ============ ============ ============

Minimal interatomic distance found:       1.2524 Angstrom
 Sorting the map                                                           
 AO integrals provided:
  Size of AO map :           0.38172721862792969      MB
  Number of AO integrals :                28697
  cpu  time :   2.1381509999999997      s
  wall time :  0.22858958200004054      s  ( x    9.3536677450139454       )

 AO -> MO integrals transformation
 ---------------------------------

* Total available memory (GB)                                   31
* Target maximum memory (GB)                                    31
 Getting AOs
 1st transformation
 2nd transformation
 3rd transformation
 4th transformation
 Molecular integrals provided:
  Size of MO map              1.4325790405273438      MB
  Number of MO integrals:                 61309
  cpu  time :  0.69869899999999996      s
  wall time :  0.14305923999995684      s  ( x    4.8839837259041134      )
 Providing the one-electron integrals
* Number of unique alpha determinants                         1430
* Number of unique beta determinants                          1419

.. >>>>> [ RES  MEM :          0.048 GB ] [ VIRT MEM :          3.713 GB ] <<<<< ..
.. >>>>> [ WALL TIME:           0.55  s ] [ CPU  TIME:           4.03  s ] <<<<< ..

* Nuclear repulsion energy                           15.21109835848256    

.. >>>>> [ RES  MEM :          0.048 GB ] [ VIRT MEM :          3.713 GB ] <<<<< ..
.. >>>>> [ WALL TIME:           0.55  s ] [ CPU  TIME:           4.08  s ] <<<<< ..

Davidson Diagonalization
------------------------

* Number of states                                               1
* Number of states in diagonalization                            4
* Number of determinants                                      9975
* Number of threads for diagonalization                         12
* Memory(Gb)                                        0.1469145342707634E-01

===== ================ =========== =========== 
Iter       Energy          S^2       Residual  
===== ================ =========== =========== 

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7f09e5223960 in ???
#1  0x7f09e5222ac5 in ???
#2  0x7f09e4e4251f in ???
    at ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
#3  0x55ec9cffde6d in h_s2_u_0_nstates_openmp_work_1_._omp_fn.0
    at /home/ivan/Descargas/qp2/src/tools/IRPF90_temp/davidson/u0_hs2_u0.irp.F90:496
#4  0x7f09e5d5bc0d in ???
#5  0x7f09e4e94ac2 in start_thread
    at ./nptl/pthread_create.c:442
#6  0x7f09e4f26a3f in ???
    at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
#7  0xffffffffffffffff in ???
Segmentation fault (core dumped)
Program exited with code 139.
Wall time: 0:00:03

I have spent several hours attempting to resolve this issue and thoroughly checked the Quantum Package documentation without success. Your assistance in troubleshooting or providing guidance would be greatly appreciated.

Thank you for your time and support.

Best regards,

scemama commented 10 months ago

Hello, it seems that something in wrong in the way you added the extra determinants. Can you post a tar.gz of your EZFIO directory before adding the new determinants, and another one after adding the determinants?

Navihdz commented 10 months ago

Thank you for your prompt response.

I've attached the tar.gz files containing my EZFIO data. The first set includes 5132 determinants computed by CISD, and the second set incorporates an additional 3962 determinants, resulting in a total of 9094 determinants.

After performing the CISD calculation, executing qp run diagonalize_h proceeds without any issues. However, when I attempt to modify and add new determinants, the diagonalization process encounters an error.

I suspect that I may have overlooked a necessary modification in the EZFIO file. Currently, I've only adjusted the n_det parameter. I am unsure if there are other variables that require modification.

In an attempt to troubleshoot, I experimented with toggling the value in the read_wf file between 'true' and 'false'. Additionally, I modified the value of n_det_qp_edit. Unfortunately, I am uncertain about the purpose of qp_edit files and whether they play a role in resolving my issue.

Furthermore, I conducted tests by adjusting parameters within the Davidson folder, but these attempts have not yielded success.

Any insights or guidance you can provide to help me understand and resolve this issue would be greatly appreciated.

Thank you,

ezfio_after.tar.gz ezfio_before.tar.gz

scemama commented 10 months ago

Hello, I found the problem: there are many duplicates in your determinant list: 5134 6064 5134 6439 5134 8585 5135 5153 5135 5235 5135 5938 5135 5945 5135 6226 ....

For QP to work, you need to include each determinant only once.