Problems using cp2k interfaced with ase

267 views
Skip to first unread message

Lucas Bandeira

unread,
Jan 15, 2021, 8:47:30 AM1/15/21
to cp...@googlegroups.com
Dear CP2K users,

I am using cp2k interfaced with ase for calculating water adsorption on surfaces. The last time I have tried, I obtained the following error message:

Traceback (most recent call last):
  File "Au_water.py", line 120, in <module>
    opt.run(fmax=0.05)
  File "/usr/lib/python3/dist-packages/ase/optimize/optimize.py", line 170, in run
    self.set_force_consistent()
  File "/usr/lib/python3/dist-packages/ase/optimize/optimize.py", line 223, in set_force_consistent
    self.atoms.get_potential_energy(force_consistent=True)
  File "/usr/lib/python3/dist-packages/ase/atoms.py", line 682, in get_potential_energy
    self, force_consistent=force_consistent)
  File "/usr/lib/python3/dist-packages/ase/calculators/calculator.py", line 441, in get_potential_energy
    energy = self.get_property('energy', atoms)
  File "/usr/lib/python3/dist-packages/ase/calculators/calculator.py", line 486, in get_property
    self.calculate(atoms, [name], system_changes)
  File "/usr/lib/python3/dist-packages/ase/calculators/cp2k.py", line 233, in calculate
    self._create_force_env()
  File "/usr/lib/python3/dist-packages/ase/calculators/cp2k.py", line 303, in _create_force_env
    self._force_env_id = int(self._shell.recv())
ValueError: invalid literal for int() with base 10: '--------------------------------------------------------------------------'
/usr/lib/python3/dist-packages/ase/calculators/cp2k.py:472: RuntimeWarning: CP2K-shell not ready, sending SIGTERM.
  warn("CP2K-shell not ready, sending SIGTERM.", RuntimeWarning)


Honestly, I have no idea what is wrong. Could somebody help me to solve this problem? Attached to this email are the  .py file used for ase, the generated cp2k input file and the error message. I am using cp2k version 6.1.

Yours faithfully,

Lucas Bandeira


Au111-H2O_TZVP_450Ry.inp
error
Au_water.py

Maxime Van den Bossche

unread,
Jan 18, 2021, 10:53:54 AM1/18/21
to cp2k
Dear Lucas,

When encountering such problems, it is best to provide a minimum-working-example
that reproduces the original problem (instead of the full production script itself).
In many cases, this process itself will already indicate a solution.
Can you for example run the simple H2O example in https://www.cp2k.org/tools:ase?

If I would need to guess, I would bet that the "slab.calc = calc1" statement does not
properly initialize the calculator, and that you would need e.g. "slab.set_calculator(calc)"
instead.

Best,
Maxime
Op vrijdag 15 januari 2021 om 14:47:30 UTC+1 schreef bandeir...@gmail.com:

bandeir...@gmail.com

unread,
Jan 18, 2021, 12:06:29 PM1/18/21
to cp2k
Dear Maxime,

Thank you for your reply. I tried to perform the example in the link you have just sent, and it worked properly. In addition, I've tried the same system using a different calculator, the EMT calculator, and it also worked. I think the problem is in the input I'm using or the way I am setting the arguments to run CP2K, but I could not figure out the problem exactly.

Yours sincerely,

Lucas Bandeira
Reply all
Reply to author
Forward
0 new messages