qsimulate-open / bagel

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

CASPT2 gradient crashed #233

Closed FreemanTheMaverick closed 2 years ago

FreemanTheMaverick commented 2 years ago

Hi. I am trying optimizing a molecule with CASPT2. The input file is as follows:

{"bagel":[
{
 "title":"molecule",
 "basis":"cc-pvdz",
 "df_basis":"cc-pvdz-jkfit",
 "angstrom" : "false",
 "geometry":[
  { "atom" : "C", "xyz" : [      0.883183,      0.807464,     -0.197396 ] },
  { "atom" : "N", "xyz" : [      1.306682,      3.221987,     -0.623703 ] },
  { "atom" : "N", "xyz" : [      1.594794,      5.351055,     -0.993168 ] },
  { "atom" : "C", "xyz" : [     -1.775624,     -0.000728,      0.111730 ] },
  { "atom" : "C", "xyz" : [     -3.744736,      1.805903,      0.069680 ] },
  { "atom" : "C", "xyz" : [     -2.398096,     -2.575258,      0.449315 ] },
  { "atom" : "C", "xyz" : [     -6.270445,      1.061773,      0.354959 ] },
  { "atom" : "H", "xyz" : [     -3.315904,      3.815312,     -0.173825 ] },
  { "atom" : "C", "xyz" : [     -4.934455,     -3.301764,      0.735841 ] },
  { "atom" : "H", "xyz" : [     -0.897292,     -3.985394,      0.501266 ] },
  { "atom" : "C", "xyz" : [     -6.883282,     -1.503975,      0.659494 ] },
  { "atom" : "H", "xyz" : [     -7.760016,      2.496692,      0.323158 ] },
  { "atom" : "H", "xyz" : [     -5.379375,     -5.304560,      1.002036 ] },
  { "atom" : "H", "xyz" : [     -8.850588,     -2.080605,      0.928304 ] },
  { "atom" : "C", "xyz" : [      3.163529,     -0.794677,     -0.069129 ] },
  { "atom" : "O", "xyz" : [      3.185760,     -3.064813,      0.303696 ] },
  { "atom" : "O", "xyz" : [      5.277488,      0.619997,     -0.429948 ] },
  { "atom" : "C", "xyz" : [      7.576789,     -0.820229,     -0.333122 ] },
  { "atom" : "H", "xyz" : [      7.594787,     -2.280389,     -1.812924 ] },
  { "atom" : "H", "xyz" : [      9.096684,      0.553298,     -0.647612 ] },
  { "atom" : "H", "xyz" : [      7.794198,     -1.738170,      1.519477 ] }
 ]
},
{
 "title":"hf"
},
{
 "title":"casscf",
 "nact":8,
 "nclosed":42
},
{
 "title":"optimize",
 "export":"true",
 "method":[{
 "title":"caspt2",
 "smith":{
  "method":"caspt2",
  "shift":0.2
 },
 "nact":8,
 "nclosed":42
}]
},
{
 "title":"print",
 "file":"20+++.bag.molden",
 "orbitals":true
}
]}

but got the following error:

      -------------------

       - CASPT2 lambda equation                  260.27
       - Correlated density matrix evaluation     32.60

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   RANK 0 PID 77457 RUNNING AT hhnode-ib-6
=   KILLED BY SIGNAL: 11 (Segmentation fault)
===================================================================================
[hhnode-ib-6:77457:0:77457] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x652251d3a000)
==== backtrace (tid:  77457) ====
 0 0x000000000004cb95 ucs_debug_print_backtrace()  ???:0
 1 0x000000000004baed __intel_avx_memmove()  ???:0
 2 0x0000000019a95ae4 bagel::RMAWindow<double>::operator=()  ???:0
 3 0x000000000fe8879d bagel::SMITH::StorageIncore<double>::operator=()  ???:0
 4 0x000000000fe88855 bagel::SMITH::Tensor_<double>::operator=()  ???:0
 5 0x000000000fe88925 bagel::SMITH::Tensor_<double>::copy()  ???:0
 6 0x0000000011344042 bagel::SMITH::MSCASPT2::MSCASPT2::solve_gradient()  ???:0
 7 0x000000001010840e bagel::SMITH::CASPT2::CASPT2::solve_gradient()  ???:0
 8 0x000000001005557c bagel::Smith::compute_gradient()  ???:0
 9 0x000000001008220f bagel::CASPT2Grad::compute_gradient()  ???:0
10 0x0000000010083f4a bagel::GradEval<bagel::CASPT2Grad>::compute()  ???:0
11 0x000000000f8a3c6f bagel::Force::compute()  ???:0
12 0x000000000ee7f6ae bagel::impl::run_bagel_()  ???:0
13 0x000000000ee7e7d7 bagel::run_bagel_from_input()  ???:0
14 0x0000000000401b0e main()  ???:0
15 0x0000000000022505 __libc_start_main()  ???:0
16 0x00000000004017f9 _start()  ???:0
=================================

once it comes to evaluation of CASPT2 gradient. The error disappears when I use CAS(6,6) instead of CAS(8,8). This led me to think that it was due to lack of memory. Then I switched from 16 MPIs to 4 MPIs, with one thread per MPI, but the problem still exists.

Any help will be appreciated.

shiozaki commented 2 years ago

Looks to originate from the MPI library. Please try different versions of Intel MPI. Since 2019 Intel MPI has been pretty buggy but 2021.4 seems to have fixed many of the bugs.

FreemanTheMaverick commented 2 years ago

Looks to originate from the MPI library. Please try different versions of Intel MPI. Since 2019 Intel MPI has been pretty buggy but 2021.4 seems to have fixed many of the bugs.

Thank you! I will try it.

shiozaki commented 2 years ago

If it persists write here again, I will try to reproduce the issue.

FreemanTheMaverick commented 2 years ago

Turning to Intel_2021.4 solves the problem. Thank you very much!