Convergence stops due to NaN after 20 Broyden steps

Total energy, geometry optimization, DFT+U, spin....

Moderator: bguster

Locked
marcs
Posts: 12
Joined: Mon Mar 01, 2010 9:07 am

Convergence stops due to NaN after 20 Broyden steps

Post by marcs » Thu Apr 29, 2010 9:59 am

Hi forum,

after 20 Broyden/MD steps the convergence stops with lots of NaN values.
I am using abinit 6.0.3 and are calculating charged O-Vacancies in ZnO with jellium background.
Calculations without charge and with "charge +1" ran fine, "charge +2" ends up with NaN error.
USPP and PAW was used.

Any help is very much appreciated.

Marc

BTW: Couldn't upload log file as *.gz or *.7z so I had to insert some of the text below.

Part of the log file:

****** TOTAL Dij in Ha (atom 1) *****
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ...
... only 12 components have been written...

****** TOTAL Dij in Ha (atom 71) *****
NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN

ITER STEP NUMBER 31
vtorho : nnsclo_now= 1, note that nnsclo,dbl_nnsclo,istep= 0 0 31
starting lobpcg, with nblockbd,mpi_enreg%nproc_band 47 7
WARNING in zheev, info= 6
WARNING in zpotrf, info= 1
WARNING in zhegv, info= 13
WARNING in zpotrf, info= 1
WARNING in zpotrf, info= 1
WARNING in zheev, info= 20
condition number of the Gram matrix= NaN
Lobpcgccwf: restart performed





Part of the input file:

#ZnO wurzite (hexagonal) structure
#Structural optimization run

#Datasets: convergence on ecut
ndtset 1 jdtset 1

# Set 1 : Internal coordinate optimization
irdwfk1 1
ionmov1 2 # Use BFGS algorithm for structural optimization
ntime1 80 # Maximum number of optimization steps
tolmxf1 1.0e-6 # Optimization is converged when maximum force
tolvrs1 1.0d-15 # Strict tolerance on (squared) residual of the SCF


kptopt 1
ngkpt 2 2 2 # 2x2x2 Monkhorst-Pack grid
nshiftk 1 # Use one copy of grid only (default)
shiftk 0.0 0.0 0.5 # This choice of origin for the k point grid
# preserves the hexagonal symmetry of the grid,
# which would be broken by the default choice.

# GGA+U definition
usepawu 1
lpawu 2 -1
upawu 9.5 0.0 eV # Relaxation without U
jpawu 1.0 0.0 eV # Relaxation without J

#Common input data
#Starting approximation for the unit cell
acell 1.8537890785E+01 1.8537890785E+01 1.9866355563E+01 Bohr
rprim sqrt(0.75) 0.5 0.0
-sqrt(0.75) 0.5 0.0
0.0 0.0 1.0
chkprim 0

#Definition of the atom types and atoms
ntypat 2
znucl 30 8
natom 71
typat 36*1 35*2

xred 1.1158587310E-01 2.2245960322E-01 -1.1879629568E-03
4.4518115260E-01 2.2369563853E-01 1.8061593371E-03
7.7754039678E-01 2.2245960322E-01 -1.1879629568E-03
1.1093572920E-01 5.5520479173E-01 -1.0589297328E-03
4.4518115260E-01 5.5481884740E-01 1.8061593371E-03
7.7630436147E-01 5.5481884740E-01 1.8061593371E-03
1.1093572920E-01 8.8906427080E-01 -1.0589297328E-03
4.4479520827E-01 8.8906427080E-01 -1.0589297328E-03
7.7754039678E-01 8.8841412690E-01 -1.1879629568E-03
1.1165198357E-01 2.2249265845E-01 4.9982369899E-01
4.5176319710E-01 2.3685972753E-01 4.9441137386E-01
7.7750734155E-01 2.2249265845E-01 4.9982369899E-01
1.1117830071E-01 5.5568993475E-01 4.9933888661E-01
4.5176319710E-01 5.4823680290E-01 4.9441137386E-01
7.6314027247E-01 5.4823680290E-01 4.9441137386E-01
1.1117830071E-01 8.8882169929E-01 4.9933888661E-01
4.4431006525E-01 8.8882169929E-01 4.9933888661E-01
7.7750734155E-01 8.8834801643E-01 4.9982369899E-01
2.2232943022E-01 1.1154468830E-01 2.4981368076E-01
5.5588192475E-01 1.1154468830E-01 2.4981368076E-01
8.8888888889E-01 1.1111111111E-01 2.4913885622E-01
2.2232943022E-01 4.4411807525E-01 2.4981368076E-01
5.5555555556E-01 4.4444444444E-01 2.6579918406E-01
8.8845531170E-01 4.4411807525E-01 2.4981368076E-01
2.2222222222E-01 7.7777777778E-01 2.4904616371E-01
5.5588192475E-01 7.7767056978E-01 2.4981368076E-01
8.8845531170E-01 7.7767056978E-01 2.4981368076E-01
2.2359868664E-01 1.1179025810E-01 7.4836279846E-01
5.5485823813E-01 1.1179025810E-01 7.4836279846E-01
8.8888888889E-01 1.1111111111E-01 7.4957808757E-01
2.2359868664E-01 4.4514176187E-01 7.4836279846E-01
5.5555555556E-01 4.4444444444E-01 7.4981788550E-01
8.8820974190E-01 4.4514176187E-01 7.4836279846E-01
2.2222222222E-01 7.7777777778E-01 7.4945537609E-01
5.5485823813E-01 7.7640131336E-01 7.4836279846E-01
8.8820974190E-01 7.7640131336E-01 7.4836279846E-01
1.1113184592E-01 2.2223258962E-01 1.8925571115E-01
4.4623509068E-01 2.2580351469E-01 1.9281540640E-01
7.7776741038E-01 2.2223258962E-01 1.8925571115E-01
1.1087055125E-01 5.5507443583E-01 1.8964361359E-01
4.4623509068E-01 5.5376490932E-01 1.9281540640E-01
7.7419648531E-01 5.5376490932E-01 1.9281540640E-01
1.1087055125E-01 8.8912944875E-01 1.8964361359E-01
4.4492556417E-01 8.8912944875E-01 1.8964361359E-01
7.7776741038E-01 8.8886815408E-01 1.8925571115E-01
1.1120090020E-01 2.2226711677E-01 6.8984914045E-01
4.4538387608E-01 2.2410108550E-01 6.8547647903E-01
7.7773288323E-01 2.2226711677E-01 6.8984914045E-01
1.1103721008E-01 5.5540775349E-01 6.8948926684E-01
4.4538387608E-01 5.5461612392E-01 6.8547647903E-01
7.7589891450E-01 5.5461612392E-01 6.8547647903E-01
1.1103721008E-01 8.8896278992E-01 6.8948926684E-01
4.4459224651E-01 8.8896278992E-01 6.8948926684E-01
7.7773288323E-01 8.8879909980E-01 6.8984914045E-01
2.2526913149E-01 1.1335176965E-01 4.4015508590E-01
5.5474930483E-01 1.1335176965E-01 4.4015508590E-01
8.8888888889E-01 1.1111111111E-01 4.3970831420E-01
2.2526913149E-01 4.4525069517E-01 4.4015508590E-01
8.8664823035E-01 4.4525069517E-01 4.4015508590E-01
2.2222222222E-01 7.7777777778E-01 4.3914801371E-01
5.5474930483E-01 7.7473086851E-01 4.4015508590E-01
8.8664823035E-01 7.7473086851E-01 4.4015508590E-01
2.2352660024E-01 1.1170637492E-01 9.3926452617E-01
5.5484644135E-01 1.1170637492E-01 9.3926452617E-01
8.8888888889E-01 1.1111111111E-01 9.3975656713E-01
2.2352660024E-01 4.4515355865E-01 9.3926452617E-01
5.5555555556E-01 4.4444444444E-01 9.3909401631E-01
8.8829362508E-01 4.4515355865E-01 9.3926452617E-01
2.2222222222E-01 7.7777777778E-01 9.3970511776E-01
5.5484644135E-01 7.7647339976E-01 9.3926452617E-01
8.8829362508E-01 7.7647339976E-01 9.3926452617E-01


#Definition of the plane wave basis set
ecut 16.0 # Maximum kinetic energy cutoff (Hartree)
ecutsm 0.5 # Smoothing energy needed for lattice paramete
pawecutdg 32.0


#Definition of the self-consistency procedure
diemac 9.0 # Model dielectric preconditioner
nstep 80 # Maxiumum number of SCF iterations
istwfk *1 # Do NOT take advantage of the time-reversal symmetry
charge 2
#Definition of parallelization

paral_kgb 1 # Parallelize over k-points
wfoptalg 14 # Locally Optimal Block Preconditioned ConjugateGradient
fftalg 401 # FFT routines for MPI
intxc 0 # "Usual" xc quadrature on fft grid
fft_opt_lob 2 # Calls to getghc made parallel on set of bands nbdblock
npkpt 2 # Number of processors for k-point parallelization
npband 7 # Number of processors for band parallization
npfft 1 # Number of processors for fft parallelization
bandpp 1 # Bands per processor
iprcch 6 # Forces corrected with use of Harris functional formula
accesswff 1 # Make wave functions accessible via MPI I/O

mverstra
Posts: 655
Joined: Wed Aug 19, 2009 12:01 pm

Re: Convergence stops due to NaN after 20 Broyden steps

Post by mverstra » Tue May 04, 2010 5:02 pm

Have you checked that the atomic positions are still reasonable at the last steps? Broyden may have exploded the cell or something. Try restarting with the final positions to see whether it is a "real" bug or some accumulated error in the current wavefunctions/projectors.

Does the ETOT stay reasonable, and is it only the Dij which contain NaNs?

Matthieu
Matthieu Verstraete
University of Liege, Belgium

marcs
Posts: 12
Joined: Mon Mar 01, 2010 9:07 am

Re: Convergence stops due to NaN after 20 Broyden steps

Post by marcs » Wed May 05, 2010 9:29 pm

Thanks Matthieu for your response.

The atomic positions in the output file still seem reasonable to me. But restarting with these positions does not converge and gives ETOT between 2880 and up to 138000 Ha. Maybe you are right about the exploded cell.

Attached you will find the ETOT of the last Broyden step. Not only Dij shows NaN, it is also etotal, fcart and strten.

ETOT 20 -2878.4926707535 8.595E-11 1.399E-07 7.458E-10 1.212E-06 5.057E-04
ETOT 21 -2878.4926707538 -3.101E-10 1.451E-07 1.235E-09 1.657E-06 5.054E-04
ETOT 22 -2878.4926707541 -3.101E-10 1.456E-07 6.548E-10 7.661E-07 5.055E-04
ETOT 23 -2878.4926707537 4.075E-10 1.390E-07 5.117E-10 1.560E-07 5.055E-04
ETOT 24 -2878.4926707532 5.152E-10 1.295E-07 3.031E-10 4.269E-07 5.055E-04
ETOT 25 -2878.4926707537 -4.702E-10 1.094E-07 4.816E-10 5.502E-07 5.054E-04
ETOT 26 -2878.4926707541 -4.584E-10 1.193E-07 3.974E-10 6.315E-07 5.055E-04
ETOT 27 -2878.4926707544 -2.528E-10 1.111E-07 4.117E-10 7.349E-07 5.053E-04
ETOT 28 NaN NaN 1.192E-07 NaN NaN NaN
ETOT 29 NaN NaN 0.000E+00 NaN NaN NaN
ETOT 30 NaN NaN 0.000E+00 NaN NaN NaN

Kind regards,
Marc

Robin
Posts: 61
Joined: Thu Jan 14, 2010 3:18 am

Re: Convergence stops due to NaN after 20 Broyden steps

Post by Robin » Sat Jun 12, 2010 1:14 pm

I also encountered such problem several times before in both geometrical and RF calculations. I increased the value of toldfe, and Abinit worked again.

Sincerely,
Guangfu Luo

Locked