Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGFPE in L-BFGS geometry optimizer #1230

Open
foxtran opened this issue Mar 25, 2025 · 1 comment
Open

SIGFPE in L-BFGS geometry optimizer #1230

foxtran opened this issue Mar 25, 2025 · 1 comment
Labels
unconfirmed This report has not yet been confirmed by the developers

Comments

@foxtran
Copy link
Contributor

foxtran commented Mar 25, 2025

Describe the bug

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0  0x1537ca6f6b4f in ???
#1  0xf3e494 in __xtb_david2_MOD_solver_sdavidson
	at xtb/src/david2.f90:340
#2  0xb6193f in __xtb_relaxation_engine_MOD_lbfgs_relax
	at xtb/src/relaxation_engine.f90:1136
#3  0xb70fd8 in __xtb_relaxation_engine_MOD_l_ancopt
	at xtb/src/relaxation_engine.f90:734
#4  0xa14e61 in __xtb_geoopt_MOD_geometry_optimization
	at xtb/src/geoopt_driver.f90:155
#5  0x426ad4 in __xtb_prog_main_MOD_xtbmain
	at xtb/src/prog/main.F90:842
#6  0x42d7c2 in xtb_prog_primary
	at xtb/src/prog/primary.f90:57
#7  0x42d863 in main
	at xtb/src/prog/primary.f90:20

To Reproduce

Happens with locally-modified version (smaller thresholds for geometry optimization: tighter than extreme, but not reached) based on current master branch with L-BFGS geometry optimizer. Some atoms are fixed (~15% of all of them).

Expected behaviour
No SIGFPE.

Additional context

Last few geometry optimization steps produces large step length:

   gradient norm :     0.0006433 Eh/a0  converged?    E=F G=F D=F
   step length   :     0.0457340 a0
--
   gradient norm :     0.0004382 Eh/a0  converged?    E=F G=F D=F
   step length   :     0.0294820 a0
--
   gradient norm :     0.0004506 Eh/a0  converged?    E=F G=F D=F
   step length   :     0.0680663 a0
--
   gradient norm :     0.0005634 Eh/a0  converged?    E=F G=F D=F
   step length   :     0.0574646 a0
--
   gradient norm :     0.0005648 Eh/a0  converged?    E=F G=F D=F
   step length   :     0.0208301 a0

!!!!! Updated Hessian !!!!!
Using Lindh-Hessian (1995)
 Shifting diagonal of input Hessian by    1.0156336463987828E-002
 Lowest  eigenvalues of input Hessian
    0.010000    0.010156    0.010156    0.010156    0.010156    0.010156
    0.010156    0.010156    0.010156    0.010156    0.010156    0.010156
    0.010156    0.010156    0.010156    0.010156    0.010156    0.010156
 Highest eigenvalues
    2.349039    2.356476    2.365074    2.401702    2.465249    2.496497
!!!!

--
   gradient norm :     0.0138380 Eh/a0  converged?    E=F G=F D=F
   step length   :     0.0910316 a0
--
   gradient norm :     0.1517329 Eh/a0  converged?    E=F G=F D=F
   step length   :     1.6871844 a0
--
   gradient norm :     0.2867047 Eh/a0  converged?    E=F G=F D=F
   step length   :   500.2718670 a0
--
   gradient norm :     0.4277285 Eh/a0  converged?    E=F G=F D=F
   step length   :  2769.1668924 a0
--
   gradient norm :     0.5817691 Eh/a0  converged?    E=F G=F D=F
   step length   : 14982.8583466 a0
--
   gradient norm :     0.7541627 Eh/a0  converged?    E=F G=F D=F
   step length   : 76943.0922821 a0
--
   gradient norm :     0.9474460 Eh/a0  converged?    E=F G=F D=F
   step length   :372790.8534898 a0
--
   gradient norm :     1.1623631 Eh/a0  converged?    E=F G=F D=F
   step length   :************** a0
--
   gradient norm :     1.4004933 Eh/a0  converged?    E=F G=F D=F
   step length   :************** a0
--
   gradient norm :     1.6608298 Eh/a0  converged?    E=F G=F D=F
   step length   :************** a0
--
   gradient norm :     1.9448164 Eh/a0  converged?    E=F G=F D=F
   step length   :************** a0
--
   gradient norm :     2.2571612 Eh/a0  converged?    E=F G=F D=F
   step length   :************** a0

Lindh-Hessian was recomputed 5 times, but only the last one produces this weird behaviour.

@foxtran foxtran added the unconfirmed This report has not yet been confirmed by the developers label Mar 25, 2025
@foxtran
Copy link
Contributor Author

foxtran commented Mar 25, 2025

Problematic line:

vecf1=vecf2/(valn(1)-adiag)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed This report has not yet been confirmed by the developers
Projects
None yet
Development

No branches or pull requests

1 participant