aiidateam / aiida-quantumespresso

The official AiiDA plugin for Quantum ESPRESSO
https://aiida-quantumespresso.readthedocs.io
Other
52 stars 77 forks source link

IEEE_INVALID_FLAG causes PWCalculation exception #982

Closed hothello closed 8 months ago

hothello commented 8 months ago

I am running a geometrical optimisation with QE which completes correctly, but exits with The following floating-point exceptions are signalling: IEEE_INVALID_FLAG. This behaviour has been reported on the QE mailing list and is apparently harmless. However, this causes the following exception in AiiDA:

11/09/2023 09:48:38 AM <155000> aiida.orm.nodes.process.calculation.calcjob.CalcJobNode: [REPORT] [9023|PwCalculation|on_except]: Traceback (most recent call last):                                                                                                                                                                                                         
  File "/home/otello/envs/aiida/lib/python3.10/site-packages/plumpy/process_states.py", line 228, in execute                                                                                                                                                                                                                                                                 
    result = self.run_fn(*self.args, **self.kwargs)                                                                                                                                                                                                                                                                                                                          
  File "/home/otello/envs/aiida/lib/python3.10/site-packages/aiida/engine/processes/calcjobs/calcjob.py", line 678, in parse                                                                                                                                                                                                                                                 
    exit_code_retrieved = self.parse_retrieved_output(retrieved_temporary_folder)                                                                                                                                                                                                                                                                                            
  File "/home/otello/envs/aiida/lib/python3.10/site-packages/aiida/engine/processes/calcjobs/calcjob.py", line 789, in parse_retrieved_output                                                                                                                                                                                                                                
    exit_code = parser.parse(**parse_kwargs)                                                                                                                                                                                                                                                                                                                                 
  File "/home/otello/envs/aiida/lib/python3.10/site-packages/aiida_quantumespresso/parsers/pw.py", line 151, in parse                                                                                                                                                                                                                                                        
    exit_code = validator(trajectory, parsed_parameters, logs_stdout)                                                                                                                                                                                                                                                                                                        
  File "/home/otello/envs/aiida/lib/python3.10/site-packages/aiida_quantumespresso/parsers/pw.py", line 244, in validate_ionic                                                                                                                                                                                                                                               
    if not self.is_ionically_converged(trajectory):                                                                                                                                                                                                                                                                                                                          
  File "/home/otello/envs/aiida/lib/python3.10/site-packages/aiida_quantumespresso/parsers/pw.py", line 278, in is_ionically_converged                                                
    fixed_coords = settings.get('FIXED_COORDS', None)                                                                                                                                 
UnboundLocalError: local variable 'settings' referenced before assignment

This is the command that is executed by AiiDA : 'mpirun' '-np' '4' 'pw.x' '-in' 'aiida.in' > 'aiida.out'. And this is the script aiida.in:

&CONTROL
  calculation = 'relax'
  etot_conv_thr =   1.0000000000d-04
  forc_conv_thr =   1.0000000000d-04
  outdir = './out/'
  prefix = 'aiida'
  pseudo_dir = './pseudo/'
  restart_mode = 'from_scratch'
  verbosity = 'high'
/
&SYSTEM
  degauss =   1.0000000000d-02
  ecutwfc = 30
  ibrav = 0
  nat = 4
  ntyp = 2
  occupations = 'smearing'
  smearing = 'mp'
/
&ELECTRONS
  conv_thr =   1.0000000000d-06
  electron_maxstep = 50
  mixing_beta =   3.0000000000d-01
/
&IONS
/
ATOMIC_SPECIES
Cl     35.453 cl_pbe_v1.4.uspp.F.UPF
Na     22.98977 na_pbe_v1.5.uspp.F.UPF
ATOMIC_POSITIONS angstrom
Na           0.0000000000       0.0000000000       0.0000000000
Na           5.4620000000       5.4620000000       5.4620000000
Cl           2.7310000000       2.7310000000       2.7310000000
Cl           8.1930000000       8.1930000000       8.1930000000
K_POINTS automatic
4 4 4 0 0 0
CELL_PARAMETERS angstrom
      5.4620000000       2.7310000000       2.7310000000
      2.7310000000       5.4620000000       2.7310000000
      2.7310000000       2.7310000000       5.4620000000

My system has installed QE-7.2 and:

aiida-core                   2.4.0
aiida-pseudo                 1.1.0
aiida-quantumespresso        4.4.0
sphuber commented 8 months ago

Hi @hothello . The floating-point exception is indeed harmless and it is not what is causing AiiDA to except. It is due to another bug, but that was already resolved here: https://github.com/aiidateam/aiida-quantumespresso/commit/5d4a7d9405b757e2ecf65a72c1ee92aa2fb36a39 This was released with v4.4.0. You say that that is the version that you are using, but the stack trace shows that you are on the older version. Please run pip install aiida-quantumespresso==4.4.0 and try to run the calculation again. That should fix the problem.

hothello commented 8 months ago

Thank you so much. I confirm that after upgrading the plugin from within the AiiDA environment, the exception was gone.