CP2K/ASE tests

280 views
Skip to first unread message

S Ling

unread,
Jun 30, 2015, 6:29:30 PM6/30/15
to cp...@googlegroups.com
Hi

I was trying several of the CP2K/ASE tests listed on the following website,


and I got the following error message. I am not very familiar with ASE. Can you tell me what does the error message mean? Two relevant environment variables ASE_CP2K_COMMAND and CP2K_DATA_DIR have been set, and I don't think the error is related to that.

Many thanks!

SL

[aaa@www cp2k]$ python cp2k_O2.py 
Traceback (most recent call last):
  File "cp2k_O2.py", line 35, in <module>
    main()
  File "cp2k_O2.py", line 25, in main
    basis_set="SZV-MOLOPT-SR-GTH")
  File "/home/aaa/.local/lib/python3.3/site-packages/ase/calculators/cp2k.py", line 160, in __init__
    assert self._recv() == '* READY'
AssertionError
Exception TypeError: "'str' does not support the buffer interface" in <bound method CP2K.__del__ of <ase.calculators.cp2k.CP2K object at 0x2ae385f1b250>> ignored

Ole Schütt

unread,
Jul 1, 2015, 1:20:14 AM7/1/15
to cp...@googlegroups.com
Hi SLing,

it seems like you are using Python 3 and have run into a common incompatibility issue. I'll look into it.
Thanks for reporting this.

-Ole


S Ling

unread,
Jul 1, 2015, 5:17:14 AM7/1/15
to cp...@googlegroups.com
Hi Ole,

I have just tried to install ASE using Python 2.7.6, and I still got a similar error message.

SL

===============
aaa@mom3:/work/aaa/ase/ase/test/cp2k> python cp2k_H2_PBE.py

Traceback (most recent call last):
  File "cp2k_H2_PBE.py", line 33, in <module>
    main()
  File "cp2k_H2_PBE.py", line 23, in main
    calc = CP2K(xc='PBE', label='test_H2_PBE')
  File "/work/aaa/ase/ase/calculators/cp2k.py", line 160, in __init__

    assert self._recv() == '* READY'
AssertionError

--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.
To post to this group, send email to cp...@googlegroups.com.
Visit this group at http://groups.google.com/group/cp2k.
For more options, visit https://groups.google.com/d/optout.

Ole Schütt

unread,
Jul 1, 2015, 5:32:15 AM7/1/15
to cp...@googlegroups.com
Hi SLing,

that appears to be a slightly different error message now. Could you run the script again with debugging:


   calc = CP2K(debug=True, ...)

... and send me the output? It should show the communication between ASE and the cp2k_shell.

-Ole

S Ling

unread,
Jul 1, 2015, 6:01:22 AM7/1/15
to cp...@googlegroups.com
Hi Ole,

Please see below error message if I ran the script with debugging.

SL

===============
aaa@mom3:/work/aaa/ase/ase/test/cp2k> python cp2k_H2_PBE.py
aprun -n 24 -N 24 cp2k.popt
Received:
Traceback (most recent call last):
  File "cp2k_H2_PBE.py", line 33, in <module>
    main()
  File "cp2k_H2_PBE.py", line 23, in main
    calc = CP2K(debug=True, xc='PBE', label='test_H2_PBE')

  File "/work/aaa/ase/ase/calculators/cp2k.py", line 160, in __init__
    assert self._recv() == '* READY'
AssertionError
Sending: EXIT

Ole Schütt

unread,
Jul 1, 2015, 7:02:27 AM7/1/15
to cp...@googlegroups.com
Hi SLing,

it looks like you set


  ASE_CP2K_COMMAND
=aprun -n 24 -N 24 cp2k.popt

while you should set it to the cp2k_shell instead:

  ASE_CP2K_COMMAND=aprun -n 24 -N 24 cp2k_shell.popt

I realize that this is not obvious. I'll see if I can print a more meaning full error message for this in the future.

-Ole

S Ling

unread,
Jul 1, 2015, 8:27:23 AM7/1/15
to cp...@googlegroups.com
Hi Ole,

Indeed, replacing cp2k.popt with cp2k_shell.popt solved the problem. Many thanks!

SL

Ole Schütt

unread,
Jul 1, 2015, 12:09:35 PM7/1/15
to cp...@googlegroups.com
> Indeed, replacing cp2k.popt with cp2k_shell.popt solved the problem. Many thanks!

I'm glad to read that.
I just committed a patch to the ASE svn repository. Now it should also work with Python 3.

Since you are apparently one of the first users of this new ASE-CP2K interface, I'm very curious about your experiences.
So, please let me know if you encounter any more problems.

-Ole

Satish Kumar

unread,
May 10, 2016, 12:33:22 PM5/10/16
to cp2k
Hi Ole

I was experiencing a  similar problem but in line 183 of cp2k.py, which is related to
"Error unknown command VERSION". Following is what I did:

$python

Python 2.6.6 (r266:84292, May 22 2015, 08:34:51) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-15)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> from ase.calculators.cp2k import CP2K

>>> from ase.structure import molecule

>>> CP2K.command="env OMP_NUM_THREADS=1 /usr/local/openmpi-1.8.4-gnu/bin/mpirun -n 24 cp2k_shell.popt"

>>> calc = CP2K()

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/usr/lib/python2.6/site-packages/ase/calculators/cp2k.py", line 183, in __init__

    assert self._recv() == '* READY'

AssertionError

#Now with debug=True

>>> calc = CP2K(debug=True)

env OMP_NUM_THREADS=1 /usr/local/openmpi-1.8.4-gnu/bin/mpirun -n 24 cp2k_shell.popt

Received: * READY

Sending: VERSION

Received: * ERROR unknown command VERSION

Received: * ERROR, type HELP for help

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/usr/lib/python2.6/site-packages/ase/calculators/cp2k.py", line 183, in __init__

    assert self._recv() == '* READY'

AssertionError

>>>


When I am manually working with cp2k_shell.popt, I do see the 'READY *' status 
and the cp2k_shell.popt seem to be fine. I also tried with Python 2.7.3 but the 
Assertion Error persists. 

Thank you for your time.

Ole Schütt

unread,
May 10, 2016, 12:40:54 PM5/10/16
to cp...@googlegroups.com
Hi Satish,

it seems like your using a fairly dated version of CP2K. I'm afraid
you'll have to update your CP2K installation in order to use the ASE
calculator.

-Ole
>> http://www.cp2k.org/tools:ase [1]
>> Visit this group at http://groups.google.com/group/cp2k [2].
>> For more options, visit https://groups.google.com/d/optout [3].
>
> --
> You received this message because you are subscribed to the Google
> Groups "cp2k" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cp2k+uns...@googlegroups.com.
> To post to this group, send email to cp...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cp2k [2].
> For more options, visit https://groups.google.com/d/optout [3].
>
> --
> You received this message because you are subscribed to the Google
> Groups "cp2k" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cp2k+uns...@googlegroups.com.
> To post to this group, send email to cp...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cp2k [2].
> For more options, visit https://groups.google.com/d/optout [3].
>
> --
> You received this message because you are subscribed to the Google
> Groups "cp2k" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cp2k+uns...@googlegroups.com.
> To post to this group, send email to cp...@googlegroups.com.
> Visit this group at https://groups.google.com/group/cp2k [4].
> For more options, visit https://groups.google.com/d/optout [3].
>
>
> Links:
> ------
> [1] http://www.cp2k.org/tools:ase
> [2] http://groups.google.com/group/cp2k
> [3] https://groups.google.com/d/optout
> [4] https://groups.google.com/group/cp2k

Satish Kumar

unread,
May 10, 2016, 12:48:03 PM5/10/16
to cp...@googlegroups.com

I am using CP2K 2.6. Is that too old and not supported?

You received this message because you are subscribed to a topic in the Google Groups "cp2k" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cp2k/t-88ZILx4lk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cp2k+uns...@googlegroups.com.

To post to this group, send email to cp...@googlegroups.com.
Visit this group at https://groups.google.com/group/cp2k.
For more options, visit https://groups.google.com/d/optout.

Ole Schütt

unread,
May 10, 2016, 1:01:14 PM5/10/16
to cp...@googlegroups.com
Yes, CP2K 2.6 is too old. You'll need CP2K version 3.0 or svn trunk.
Ideally, you also upgrade to the latest ASE release 3.11.0, because
there has been recent a bugfix in the Calculator.

-Ole
>> http://www.cp2k.org/tools:ase [1] [1]
>> Visit this group at http://groups.google.com/group/cp2k [2] [2].
>> For more options, visit https://groups.google.com/d/optout [3] [3].
>
>  --
>  You received this message because you are subscribed to the Google
> Groups "cp2k" group.
>  To unsubscribe from this group and stop receiving emails from it,
> send an email to cp2k+uns...@googlegroups.com.
>  To post to this group, send email to cp...@googlegroups.com.
>  Visit this group at http://groups.google.com/group/cp2k [2] [2].
>  For more options, visit https://groups.google.com/d/optout [3] [3].
>
>  --
>  You received this message because you are subscribed to the Google
> Groups "cp2k" group.
>  To unsubscribe from this group and stop receiving emails from it,
> send an email to cp2k+uns...@googlegroups.com.
>  To post to this group, send email to cp...@googlegroups.com.
>  Visit this group at http://groups.google.com/group/cp2k [2] [2].
>  For more options, visit https://groups.google.com/d/optout [3] [3].
>
>  --
>  You received this message because you are subscribed to the Google
> Groups "cp2k" group.
>  To unsubscribe from this group and stop receiving emails from it,
> send an email to cp2k+uns...@googlegroups.com.
>  To post to this group, send email to cp...@googlegroups.com.
>  Visit this group at https://groups.google.com/group/cp2k [4] [4].
>  For more options, visit https://groups.google.com/d/optout [3] [3].
>
> Links:
> ------
> [1] http://www.cp2k.org/tools:ase [1]
> [2] http://groups.google.com/group/cp2k [2]
> [3] https://groups.google.com/d/optout [3]
> [4] https://groups.google.com/group/cp2k [4]
>
> --
> You received this message because you are subscribed to a topic in
> the Google Groups "cp2k" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cp2k/t-88ZILx4lk/unsubscribe [5].
> To unsubscribe from this group and all its topics, send an email to
> cp2k+uns...@googlegroups.com.
> To post to this group, send email to cp...@googlegroups.com.
> Visit this group at https://groups.google.com/group/cp2k [4].
> For more options, visit https://groups.google.com/d/optout [3].
>
> --
> You received this message because you are subscribed to the Google
> Groups "cp2k" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cp2k+uns...@googlegroups.com.
> To post to this group, send email to cp...@googlegroups.com.
> Visit this group at https://groups.google.com/group/cp2k [4].
> For more options, visit https://groups.google.com/d/optout [3].
>
>
> Links:
> ------
> [1] http://www.cp2k.org/tools:ase
> [2] http://groups.google.com/group/cp2k
> [3] https://groups.google.com/d/optout
> [4] https://groups.google.com/group/cp2k
> [5] https://groups.google.com/d/topic/cp2k/t-88ZILx4lk/unsubscribe

Satish Kumar

unread,
May 10, 2016, 1:04:24 PM5/10/16
to cp2k
Alright. Thank you :)
Reply all
Reply to author
Forward
0 new messages