aiidateam / aiida-quantumespresso

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

'PwCalculation' object has no attribute 'FAILED_KEY' #116

Closed DanielMarchand closed 6 years ago

DanielMarchand commented 6 years ago

Running the calculation:

$launch_calculation_pw -c pw6.2.1_personal@danielLocal -p SSSP_accuracy -s 87

Chugs along fine, but the calculation later fails:

Running a pw.x calculation in the scf mode...
Traceback (most recent call last):
  File "/home/daniel/anaconda2/envs/aiida/bin/launch_calculation_pw", line 11, in <module>
    load_entry_point('aiida-quantumespresso', 'console_scripts', 'launch_calculation_pw')()
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/daniel/RnD/aiida-quantumespresso/aiida_quantumespresso/cli/calculations/pw/base.py", line 54, in launch
    results, pk = run(process, _return_pid=True, **inputs)
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/aiida/work/run.py", line 91, in run
    result = fut.result()
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/plum/engine/serial.py", line 33, in __init__
    func(process, *args, **kwargs)
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/plum/process.py", line 322, in run_until_complete
    self.__director.run_till_end()
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/plum/process.py", line 816, in run_till_end
    if self._proc.tick() is False:
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/plum/process.py", line 283, in tick
    return self.__director.tick()
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/plum/process.py", line 808, in tick
    MONITOR.process_failed(self._proc.pid)
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/plum/process_monitor.py", line 69, in process_failed
    ProcessMonitorListener.on_monitored_process_failed, pid)
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/plum/util.py", line 39, in fire_event
    getattr(l, event_function.__name__)(*args, **kwargs)
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/aiida/work/process.py", line 526, in on_monitored_process_failed
    calc_node._set_attr(calc_node.FAILED_KEY, True)
  File "/home/daniel/anaconda2/envs/aiida/lib/python2.7/site-packages/aiida/orm/implementation/general/calculation/__init__.py", line 215, in __getattr__
    self.__class__.__name__, name))

It would seem that even if there are legitimate problems with the calculation it should fail in a more controlled manner? I've manually checked the output file, aiida.out and the calculation itself seems fine. Could this be because I"m using quantum espresso v.6.2?

Disclaimer: The computer for this code uses a 'direct' scheduler perhaps that is causing problems?

DanielMarchand commented 6 years ago

Extra info, logshow of the failing calculation PK:

$verdi calculation logshow 91

*** 91: FAILED
*** (empty scheduler output file)
*** Scheduler errors:
Note: The following floating-point exceptions are signalling: IEEE_DIVIDE_BY_ZERO IEEE_DENORMAL

*** 2 LOG MESSAGES:
+-> ERROR at 2018-03-19 14:26:12.004374+00:00
|   The xml output file 'data-file.xml' was not found but is required
+-> ERROR at 2018-03-19 14:26:12.047981+00:00
|   [parsing of calc 91] The parser returned an error, but it should have created an output node with some partial results and warnings. Check there for more information on the problem
sphuber commented 6 years ago

There is two problems here. 1) You are using Quantum ESPRESSO v6.2 which no longer print the output file data-file.xml, which is what the parser depends on. This is the error message you see in the logshow output and why aiida tries to mark the calculation as failed. As far as it is concerned, it could not find the output file and therefore assumes the calculation failed. The reason that the file is not there is because the QE developers deprecated this in v6.2. There is a flag that you can set during compilation of the code to tell it to write the old XML, but I can't remember which flag it is. Otherwise your best bet is to use v6.1 which should work just fine. 2) Due to the parsing failing, aiida tries to put the calculation into the failed state, which in the version you are running means setting a certain attribute of the calculation to True. The name of this attribute is defined by the FAILED_KEY. However, apparently the version of plum that you are running does not match the version of aiida-core, because plum tries to get this FAILED_KEY but apparently it is not defined. How did you install aiida-core? Which version are you running?

DanielMarchand commented 6 years ago

I'm using the latest commit from the dev branch and I installed it from following the instructions given in readthedocs as far as I recall.

I'm currently reinstalling everything so I can answer this more precisely, and will get back to you soon.

DanielMarchand commented 6 years ago

Hi Sebastiaan,

Currently I'll focus on solving problem (2.), after which I"ll try reinstalling quantum espresso with the relevant flags to solve problem (1.)

I've tinkered for a while and keep getting the same FAILED_KEY error. I've listed the installation steps I"ve taken below In listing the installation steps I've tried to find the right mix between brevity and completeness, (e.g. I don't go over DB setup in detail) let me know if any details you think are important are missing.

# create a cloned conda environment for my test
conda create --name testclone --clone base

# pip install
pip install -U setuptools pip
pip install -e aiida_core # aiida_core cloned and checked out to v11.2
pip install -e aiida_core[atomic_tools,docs,advanced_plotting]

# I run a personal bash script that sets up AIIDA_PATH and the .aiida config dir for conda
../Src/aiida_scripts/aiida_conda_envinit.sh
source deactivate
source activate testclone

# using quicksetup
verdi quicksetup
Profile name [quicksetup]: testclone
Email Address (identifies your data when sharing): testclone@epfl.ch
First Name: test
Last Name: clone
Institution: EPFL
using found password for aiida_qs_daniel

# adding quantum espresso plugin
pip install -e aiida-quantumespresso # aiida-quantumespresso cloned, latest develop commit
reentry scan -r aiida
sphuber commented 6 years ago

It is difficult to say from a distance. Do you have it running on your laptop? If so feel free to drop by my office so we can debug it in person. That would be by far the easiest and most effective

DanielMarchand commented 6 years ago

Would appear that this was fixed in your branch: sphuber/fix_1307_calculation_failed_key