qsimulate-open / bagel

Brilliantly Advanced General Electronic-structure Library
GNU General Public License v3.0
97 stars 43 forks source link

Reading molden file with g function #92

Closed quanp closed 7 years ago

quanp commented 7 years ago

Hello,

I really like the idea of using Molden file from other programs as an input for Bagel. I'm testing a system containing a metal center and I found a bug while trying to read a Molden file containing g basis functions (generated by Molcas). You can see the input, molden, and log files here: https://github.com/quanp/Bagel-test

It seems that Bagel ignores the g function, giving in total 455 basis functions, while it should be 464 basis functions. After that, Bagel crashes with a segmentation fault

[node74:10972] *** Process received signal ***
[node74:10972] Signal: Segmentation fault (11)
[node74:10972] Signal code:  (128)
[node74:10972] Failing at address: (nil)
[node74:10972] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf0a0)[0x7f7eb01ef0a0]
[node74:10972] [ 1] /lib/x86_64-linux-gnu/libc.so.6(+0x77390)[0x7f7eaf232390]
[node74:10972] [ 2] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x7f7eaf23595c]
[node74:10972] [ 3] BAGEL[0x437c22]
[node74:10972] [ 4] BAGEL[0x433656]
[node74:10972] [ 5] BAGEL[0x42e560]
[node74:10972] [ 6] BAGEL[0x42949b]
[node74:10972] [ 7] BAGEL[0x424bad]
[node74:10972] [ 8] BAGEL[0x8791ee]
[node74:10972] [ 9] BAGEL[0x87287b]
[node74:10972] [10] BAGEL[0x442a32]
[node74:10972] [11] BAGEL[0x44015c]
[node74:10972] [12] BAGEL[0x43cc30]
[node74:10972] [13] BAGEL[0x439152]
[node74:10972] [14] BAGEL[0x4351b9]
[node74:10972] [15] BAGEL[0x43079a]
[node74:10972] [16] BAGEL[0x42bb7d]
[node74:10972] [17] BAGEL[0x426922]
[node74:10972] [18] BAGEL[0x417add]
[node74:10972] [19] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f7eaf1d9ead]
[node74:10972] [20] BAGEL[0x411619]
[node74:10972] *** End of error message ***
Segmentation fault

gdb gives:

#0  0x00000000055ad3a4 in bagel::MoldenIn::operator>> ()
#1  0x0000000000872834 in bagel::Reference::Reference(std::shared_ptr<bagel::Geometry const>, std::shared_ptr<bagel::PTree const>) ()
#2  0x0000000000442a32 in _ZN9__gnu_cxx13new_allocatorIN5bagel9ReferenceEE9constructIS2_JRSt10shared_ptrIKNS1_8GeometryEERKS5_IKNS1_5PTreeEEEEEvPT_DpOT0_ ()
#3  0x000000000044015c in _ZNSt16allocator_traitsISaIN5bagel9ReferenceEEE9constructIS1_JRSt10shared_ptrIKNS0_8GeometryEERKS5_IKNS0_5PTreeEEEEEvRS2_PT_DpOT0_ ()
#4  0x000000000043cc30 in _ZNSt23_Sp_counted_ptr_inplaceIN5bagel9ReferenceESaIS1_ELN9__gnu_cxx12_Lock_policyE2EEC2IJRSt10shared_ptrIKNS0_8GeometryEERKS7_IKNS0_5PTreeEEEEES2_DpOT_ ()
#5  0x0000000000439152 in _ZNSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EEC2IN5bagel9ReferenceESaIS5_EJRSt10shared_ptrIKNS4_8GeometryEERKS7_IKNS4_5PTreeEEEEESt19_Sp_make_shared_tagPT_RKT0_DpOT1_ ()
#6  0x00000000004351b9 in _ZNSt12__shared_ptrIN5bagel9ReferenceELN9__gnu_cxx12_Lock_policyE2EEC2ISaIS1_EJRSt10shared_ptrIKNS0_8GeometryEERKS7_IKNS0_5PTreeEEEEESt19_Sp_make_shared_tagRKT_DpOT0_ ()
#7  0x000000000043079a in _ZNSt10shared_ptrIN5bagel9ReferenceEEC2ISaIS1_EJRS_IKNS0_8GeometryEERKS_IKNS0_5PTreeEEEEESt19_Sp_make_shared_tagRKT_DpOT0_ ()
#8  0x000000000042bb7d in _ZSt15allocate_sharedIN5bagel9ReferenceESaIS1_EJRSt10shared_ptrIKNS0_8GeometryEERKS3_IKNS0_5PTreeEEEES3_IT_ERKT0_DpOT1_ ()
#9  0x0000000000426922 in _ZSt11make_sharedIN5bagel9ReferenceEJRSt10shared_ptrIKNS0_8GeometryEERKS2_IKNS0_5PTreeEEEES2_IT_EDpOT0_ ()
#10 0x0000000000417add in main ()

Thank you in advance, Quan

shiozaki commented 7 years ago

FYI, this is what I am getting:

  ---------------------------
      CASSCF calculation     
  ---------------------------

    * nstate   :      1
    * nclosed  :     89
    * nact     :     11
    * nvirt    :    364
  === CASSCF iteration (molden) ===

    * Using the second-order algorithm

      0  0     -2132.21131564     7.72e-06      3.09

         res : 2.71e-04   lamb: 1.00e+00   eps : -2.40e-07   step: 4.16e-04    2.71
         res : 8.28e-05   lamb: 1.00e+00   eps : -2.50e-07   step: 4.45e-04    2.71
         res : 3.72e-05   lamb: 1.00e+00   eps : -2.51e-07   step: 4.57e-04    2.90
         res : 1.95e-05   lamb: 1.00e+00   eps : -2.51e-07   step: 4.64e-04    2.77
         res : 8.78e-06   lamb: 1.00e+00   eps : -2.51e-07   step: 4.65e-04    2.84
         res : 3.67e-06   lamb: 1.00e+00   eps : -2.51e-07   step: 4.63e-04    2.80
         res : 1.74e-06   lamb: 1.00e+00   eps : -2.51e-07   step: 4.62e-04    2.83
         res : 8.72e-07   lamb: 1.00e+00   eps : -2.51e-07   step: 4.62e-04    2.81
         res : 3.47e-07   lamb: 1.00e+00   eps : -2.51e-07   step: 4.62e-04    2.87
      1  0     -2132.21131577     1.55e-07     70.62

    * Second-order optimization converged. *   

    * Integral transformation done. Elapsed time: 10.32

     guess   0:   closed .1.........          open 1.11.1..1..         
quanp commented 7 years ago

Thank you for your fast respond. I will check this. But what I see from your log file, BAGEL runs fine because the active space defined in the Molden file is already converged by Molcas, thus it only takes two iterations for Bagel to converge.

quanp commented 7 years ago

I can confirm that the bug is fixed.

Best regards. Quan

shiozaki commented 7 years ago

Great!