vossjo / ase-espresso

ase interface for Quantum Espresso
GNU General Public License v3.0
65 stars 55 forks source link

Using "logfile" option for optimizer results in same output printed to file several times #12

Closed RKBK closed 8 years ago

RKBK commented 8 years ago

If the "logfile" option is used for e.g. a QuasiNewton object (https://wiki.fysik.dtu.dk/ase/ase/optimize.html), ase-espresso prints out the results for each step in a geometry optimization several times (once per cpu?):

"BFGSLineSearch: 0[ 0] 23:13:15 -41756.800112 6.2481 BFGSLineSearch: 0[ 0] 23:26:29 -41756.800112 6.2481 BFGSLineSearch: 0[ 0] 23:37:45 -41756.800112 6.2481 BFGSLineSearch: 0[ 0] 23:54:46 -41756.800112 6.2481 BFGSLineSearch: 1[ 2] 00:32:45 -41758.172586 1.8584 BFGSLineSearch: 1[ 2] 00:45:42 -41758.172586 1.8584 BFGSLineSearch: 1[ 2] 00:56:32 -41758.172586 1.8584 BFGSLineSearch: 1[ 2] 00:57:28 -41758.172586 1.8584 BFGSLineSearch: 1[ 2] 00:59:24 -41758.172586 1.8584 BFGSLineSearch: 1[ 2] 01:13:45 -41758.172586 1.8584 BFGSLineSearch: 2[ 3] 01:16:12 -41758.654872 1.3327 BFGSLineSearch: 2[ 3] 01:28:26 -41758.654872 1.3327 BFGSLineSearch: 2[ 3] 01:40:43 -41758.654872 1.3327 BFGSLineSearch: 2[ 3] 01:43:59 -41758.654872 1.3327 BFGSLineSearch: 3[ 4] 01:45:31 -41758.831627 0.8044 BFGSLineSearch: 2[ 3] 01:57:35 -41758.654872 1.3327 BFGSLineSearch: 3[ 4] 02:10:02 -41758.831627 0.8044 BFGSLineSearch: 3[ 4] 02:14:15 -41758.831627 0.8044 BFGSLineSearch: 3[ 4] 02:26:34 -41758.831627 0.8044"

The expected result is of course that the output from each step is printed only once to the file.

RKBK commented 8 years ago

This does not happen anymore, so has to be something problematic in just that job.

vossjo commented 8 years ago

There should be no per-process output, as the ASE optimizer output is written by python (which is running serially, only pw.x, pp.x, etc. run in parallel). This could have been a case where the initial symmetry in the structure is broken during relaxation, in that case subsequent force calculations will be erroneous and the relaxation won't converge. This can happen when there are ase constraints on the system that break symmetry. There would be three solutions to that case: either turn off symmetry (nosym=True), let pw.x do the relaxation itself (relax_atoms()) [this way pw.x should be aware of any symmetry-breaking constraints], or set mode='scf', this way a fresh pw.x is started for every ionic step (which means loosing some efficiency).