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

NWChem 7.0.2 XC B3LYP-Grimme2 PSPW segfault crash #274

Closed
Alchem334 opened this issue Nov 28, 2020 · 3 comments
Closed

NWChem 7.0.2 XC B3LYP-Grimme2 PSPW segfault crash #274

Alchem334 opened this issue Nov 28, 2020 · 3 comments
Labels

Comments

@Alchem334
Copy link

Description

Plane-wave DFT calculations with exchange-corellation potential "B3LYP-Grimme2" crash with segfault on NWChem 7.0.2.

Settings

OS xUbuntu 20.04

NWChem compiled from source https://github.com/nwchemgit/nwchem/releases/download/v7.0.2-release/nwchem-7.0.2-release.revision-b9985dfa-srconly.2020-10-12.tar.bz2

Compiled with with commands

export NWCHEM_TOP=/home/alchem/Sources/nwchem-7.0.2/
export NWCHEM_TARGET=LINUX64
export USE_MPI=y
export NWCHEM_MODULES="all python"
export MRCC_METHODS=FALSE
export CCSDTQ=FALSE
export USE_PYTHONCONFIG=Y
export BLASOPT="-lopenblas64 -lpthread -lrt"
export LAPACK_LIB="-lopenblas64 -lpthread -lrt"
export BLAS_SIZE=8

make nwchem_config

make

Log file

log.txt

To reproduce

Input file

nwchem.txt

Steps to reproduce:

  1. Execute nwchem with the input file attached

Additional context

Running through gdb generates the following backtrace

Thread 1 "nwchem" received signal SIGSEGV, Segmentation fault.
0x000055555604c8d2 in becke_smalln_correction_ ()
(gdb) bt
#0  0x000055555604c8d2 in becke_smalln_correction_ ()
#1  0x00005555560508fb in gen_b3lyp_bw_restricted_ ()
#2  0x0000555556044fa8 in v_bwexc_ ()
#3  0x000055555603e95f in v_bwexc_all_ ()
#4  0x0000555556034105 in electron_gen_scf_potentials_ ()
#5  0x0000555556035651 in electron_run_ ()
#6  0x0000555556017bcf in psi_1get_tgradient_ ()
#7  0x0000555556115695 in cgminimize_ ()
#8  0x000055555610c8c5 in cgsd_energy_ ()
#9  0x0000555556103d70 in cgsdv5_ ()
#10 0x0000555555577194 in task_gradient_doit (rtdb=0, theory=..., energy=6.0134700169990685e-154, gradient=..., _theory=_theory@entry=32)
    at task_gradient.F:511
#11 0x0000555555577cfb in task_gradient (rtdb=0) at task_gradient.F:120
#12 0x00005555555683cb in task (rtdb=0) at task.F:373
#13 0x0000555555560f19 in nwchem () at nwchem.F:320
#14 0x00005555555614ea in main (argc=argc@entry=2, argv=0x7fffffffd57e) at nwchem.F:404
#15 0x00007ffff51060b3 in __libc_start_main (main=0x5555555614cb <main>, argc=2, argv=0x7fffffffd038, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffd028) at ../csu/libc-start.c:308
#16 0x000055555555f52e in _start ()

Error is in src/nwpw/pspw/lib/exchange-correlation/b3lyp.F:647. This is where the Becke_smalln_correction subroutine is called.

              call Becke_smalln_correction(n,n_thrd,agr,beta,lda_c,
     >                                   chi,chi2,chiSQ,K,F1,F2,
     >                                   xe,fdnx,fdagrx)

One argument is missing in the call to Becke_smalln_correction. The function is defined in the file src/nwpw/pspw/lib/exchange-correlation/blyp.f:13 and it takes 15 arguments, but in its calls in the b3lyp.F file only 14 arguments are passed to it.

      subroutine Becke_smalln_correction(n,n_thrd,agr,fac,beta,lda_c,
     >                                   chi,chi2,chiSQ,K,F1,F2,
     >                                   xe,fdnx,fdagrx)

I honestly don't understand how gfortran compiles this.

@ebylaska
Copy link
Collaborator

ebylaska commented Nov 28, 2020 via email

@Alchem334
Copy link
Author

Tried commit d9c7972 now. Attached log
log2.txt

The calculation passed without error.

@edoapra edoapra added the bug label May 26, 2021
@edoapra
Copy link
Collaborator

edoapra commented May 26, 2021

Confirmed that commit 0ec0cfc fixes this issue

@edoapra edoapra closed this as completed May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants