SCF cycle deteriorates during relaxation  [SOLVED]

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

Moderator: bguster

Locked
gabriel.antonius
Posts: 58
Joined: Mon May 03, 2010 10:34 pm

SCF cycle deteriorates during relaxation

Post by gabriel.antonius » Sun Feb 05, 2017 9:44 pm

Dear all,

I systematically encounter a problem during structural relaxations. It happens for every kind of relaxations, e.g. optcell=0 and ionmov=7, and for every SCF procedure, e.g. iscf=17.

As the algorithm proceeds through the molecular dynamics steps, the SCF cycle takes more and more steps to converge and eventually fails. For example, in the first few iterations, the SCF cycle converges in 20 steps, but at Iteration 10, the SCF cycle is not even converged after 80 steps, so the whole relaxation fizzles at this point. If however I start a new relaxation from the coordinates obtained before the procedure failed, then the SCF cycle is well behaved, at least for a couple of iterations until it deteriorates again. Needless to say, this problem makes the relaxation process unnecessarily human-time-consuming.

I also notice that in the first few iterations, the SCF cycle converges in *less* step than Iteration 1. Therefore, I am guessing that the algorithm somehow carries a history that is supposed to help the SCF cycle, but it must also be responsible for the deterioration of the relaxation.

If this is correct, is there a way to avoid carrying a history through the relaxation? I tried specifying prtden=0 to make sure that the density of a previous iteration is not written, but that doesn’t solve the problem. Perhaps the density of a previous iteration is still kept in memory?

I also tried altering the SCF procedure with different values of npulayit, nnsclo, and iscf, without success. Altering the value of dtion doesn’t help either.
Gabriel Antonius
Université du Québec à Trois-Rivières

ebousquet
Posts: 469
Joined: Tue Apr 19, 2011 11:13 am
Location: University of Liege, Belgium

Re: SCF cycle deteriorates during relaxation

Post by ebousquet » Thu Feb 09, 2017 10:05 am

Dear Gabriel,
Can you attach your output file to see a bit more the details?
Your divergence looks quite strange, it sounds like a compilation problem (I mean the optimization flags you used that can induce some errors, which cumulates over the iteration steps) but I'm not sure. Can you also send us the compilation flags you used to compile Abinit?
Best wishes,
Eric

gabriel.antonius
Posts: 58
Joined: Mon May 03, 2010 10:34 pm

Re: SCF cycle deteriorates during relaxation

Post by gabriel.antonius » Thu Feb 09, 2017 7:32 pm

Yes, here is the output file of one such calculation. This is a 2D system, but I've seen this problem happening with bulk systems as well.

I did not specify any optimization flag, so I'm using the default optimization level "-O2".

Here are the flags listed by doing "grep FCFLAGS config.log":

Code: Select all

FCFLAGS =  -g -extend-source -vec-report0 -noaltparam -nofpscomp  
FCFLAGS_64BITS =
FCFLAGS_DEBUG = -g
FCFLAGS_EXTRA =
FCFLAGS_F90 =
FCFLAGS_FIXEDFORM = -fixed
FCFLAGS_FREEFORM = -free
FCFLAGS_HINTS = -extend-source -vec-report0 -noaltparam -nofpscomp
FCFLAGS_MODDIR = -module $(abinit_moddir)
FCFLAGS_OPENMP =
FCFLAGS_OPTIM = -O2 -xHost


And the content of my autoconf file:

Code: Select all

enable_mpi='yes'
with_mpi_prefix='/opt/mvapich2/intel/ib/'
with_linalg_flavor="custom"
with_trio_flavor="etsf_io+netcdf"
with_dft_flavor="libxc"
enable_gw_dpc="yes"
enable_64bit_flags="yes"


I can try compiling with a lower optimization level.

I also found this unanswered thread on the Abinit forum that seems to encounter the same problem:
http://forum.abinit.org/viewtopic.php?f=9&t=3114

Thanks,
Attachments
calc.out
(178.75 KiB) Downloaded 338 times
Gabriel Antonius
Université du Québec à Trois-Rivières

User avatar
gmatteo
Posts: 291
Joined: Sun Aug 16, 2009 5:40 pm

Re: SCF cycle deteriorates during relaxation  [SOLVED]

Post by gmatteo » Thu Feb 09, 2017 7:43 pm

Hi Gabriel,

FCFLAGS_OPTIM = -O2 -xHost


xHost is a very problematic option, especially on recent intel architectures and code compiled with ifort
(the compiler activates vectorization that may not behave in a deterministic way and this causes weird behaviour
and/or numerical instabilities e.g. structural relaxations exploding after the 2-3 iterations, SCF cycles not converging ...)

The build system uses -xHost by default if FCFLAGS is not explicitly specified by the user
(we changed the default behaviour in version 8.3).
Could you try to configure/compile with:

FCFLAGS="-g -O2 -extend-source -vec-report0 -noaltparam -nofpscomp"

gabriel.antonius
Posts: 58
Joined: Mon May 03, 2010 10:34 pm

Re: SCF cycle deteriorates during relaxation

Post by gabriel.antonius » Tue Feb 14, 2017 1:07 am

Indeed, removing the "-xHost" flag solved the problem. Overall, the SCF cycle is now faster (requires less steps) and no longer deteriorates.

Thank you very much!
Gabriel Antonius
Université du Québec à Trois-Rivières

Locked