segfault with libMBD

Problems running VASP: crashes, internal errors, "wrong" results.


Moderators: Global Moderator, Moderator

Message
Author
chuanlu_yang1
Newbie
Newbie
Posts: 7
Joined: Tue Apr 28, 2020 2:24 pm

Re: segfault with libMBD

#16 Post by chuanlu_yang1 » Tue Oct 07, 2025 11:42 am

I have designed a code to directly call the libMBD twice, and found that it can work successfully. Moreover, I have checked several points and noticed that during the first ionic step (I also tested with a static calculation), the apparently normal calculation in fact does not compute the vdW energy, as shown below in the OUTCAR file. Furthermore, when I moved the two lines under CASE(14) from the first position to the second in vdwforcefield.F, the structural optimization with IVDW=14 could complete successfully. However, all vdW energies and gradients became zero. Therefore, I believe the problem should lie in either libmd.F or vdwforcefield.F. The following is the corresponding result extracted from the OUTCAR file.
FORCE on cell =-STRESS in cart. coord. units (eV):
Direction XX YY ZZ XY YZ ZX
--------------------------------------------------------------------------------------
Alpha Z 20.71241 20.71241 20.71241
Ewald 11137.71754 11137.73871-12224.71345 0.00004 0.00000 0.00000
Hartree 11324.13471 11324.15579-11242.42892 0.00000 -0.00000 0.00000
E(xc) -134.97114 -134.95777 -135.87443 -0.00000 0.00000 0.00000
Local -23027.07751-23027.03326 22895.15380 -0.00003 0.00000 0.00000
n-local 257.35542 257.31064 265.25763 1.38537 0.00003 -0.00000
augment -58.99432 -58.99793 -60.24963 0.00000 -0.00000 0.00000
Kinetic 469.58608 469.54860 466.45144 0.71598 -0.00005 0.00000
Fock 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
vdW 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
-------------------------------------------------------------------------------------


fabien_tran1
Global Moderator
Global Moderator
Posts: 502
Joined: Mon Sep 13, 2021 11:02 am

Re: segfault with libMBD

#17 Post by fabien_tran1 » Wed Oct 08, 2025 9:38 am

Thanks again for investigating the problem. Yes, there is indeed a severe bug in libmbd.F. I did not test properly this interface to libMBD that I wrote. I will try to fix the issue as soon as possible and post the fix.


fabien_tran1
Global Moderator
Global Moderator
Posts: 502
Joined: Mon Sep 13, 2021 11:02 am

Re: segfault with libMBD

#18 Post by fabien_tran1 » Wed Oct 08, 2025 2:12 pm

The bug fix is provided in the attached file. The modifications are in vdwforcefield.F and libmbd.F. To apply the patch, unzip the file and do the following:

Code: Select all

cd /path/to/vasp.6.5.1
patch -p1 < /path/to/patch.txt

Then, recompile VASP. Please, tell me if there is still a problem.

Thank you very much for having reported the problem.

You do not have the required permissions to view the files attached to this post.

chuanlu_yang1
Newbie
Newbie
Posts: 7
Joined: Tue Apr 28, 2020 2:24 pm

Re: segfault with libMBD

#19 Post by chuanlu_yang1 » Thu Oct 16, 2025 1:27 am

Thanks!


Locked