CP2K calculator in ASE - generating output files
Satish Kumar
satis... at gmail.com
Tue Jul 19 02:06:05 UTC 2016
Hello CP2K users
I have CP2K 3.0 compiled that I use as ASE calculator. I am having trouble
getting any output from a calculation using ASE. I am using Python 2.6.
This is the python test script I wanted to test.
from ase.test import NotAvailable
from ase.structure import molecule
from ase import units
from ase.calculators.cp2k import CP2K
import os
def main():
os.environ["ASE_CP2K_COMMAND"]="/usr/local/bin/mpirun -n 4
/usr/local/cp2k-3.0/exe/local/cp2k_shell.popt"
calc = CP2K(label='test_O2', debug=True, uks=True, cutoff=150 *
units.Rydberg,
basis_set="/home/siyemperumal/GTH_BASIS_SETS_5-12-10")
o2 = molecule('O2', calculator=calc)
o2.center(vacuum=2.0)
energy = o2.get_potential_energy()
energy_ref = -861.057011375
diff = abs((energy - energy_ref) / energy_ref)
assert diff < 1e-10
print('passed test "O2"')
main()
There is no error when I run this script. However, there are no output
files written in the working directory also. Even for such a small job, I
tried waiting for few hours hoping it to finish and produce some output.
But there is no output generated.
The following is the output produces when I run the script:
/usr/local/bin/mpirun -n 4 /usr/local/cp2k-3.0/exe/local/cp2k_shell.popt
Received: * READY
Sending: VERSION
Received: CP2K Shell Version: 2.0
Received: * READY
Sending: HARSH
Received: * READY
system_changes: ['positions', 'numbers', 'cell', 'pbc', 'initial_charges',
'initial_magmoms']
Writting to file: test_O2.inp
!!! Generated by ASE !!!
&GLOBAL
PROJECT test_O2
&END GLOBAL
&FORCE_EVAL
METHOD Quickstep
STRESS_TENSOR ANALYTICAL
&PRINT
&STRESS_TENSOR ON
&END STRESS_TENSOR
&END PRINT
&DFT
BASIS_SET_FILE_NAME BASIS_MOLOPT
POTENTIAL_FILE_NAME POTENTIAL
UNRESTRICTED_KOHN_SHAM ON
&MGRID
CUTOFF [eV] 2.040854674163798109e+03
&END MGRID
&SCF
MAX_SCF 50
&END SCF
&LS_SCF
MAX_SCF 50
&END LS_SCF
&XC
&XC_FUNCTIONAL LDA
&END XC_FUNCTIONAL
&END XC
&POISSON
PERIODIC NONE
PSOLVER MT
&END POISSON
&END DFT
&SUBSYS
&COORD
O 2.000000000000000000e+00 2.000000000000000000e+00
3.245955999999999619e+00
O 2.000000000000000000e+00 2.000000000000000000e+00
1.999999999999999778e+00
&END COORD
&CELL
PERIODIC NONE
A 4.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00
B 0.000000000000000000e+00 4.000000000000000000e+00
0.000000000000000000e+00
C 0.000000000000000000e+00 0.000000000000000000e+00
5.245955999999999619e+00
&END CELL
&KIND O
BASIS_SET /home/siyemperumal/GTH_BASIS_SETS_5-12-10
POTENTIAL GTH-LDA
&END KIND
&END SUBSYS
&END FORCE_EVAL
Sending: WRITE_FILE
Sending: test_O2.inp
Sending: 50
Sending: !!! Generated by ASE !!!
Sending: &GLOBAL
Sending: PROJECT test_O2
Sending: &END GLOBAL
Sending: &FORCE_EVAL
Sending: METHOD Quickstep
Sending: STRESS_TENSOR ANALYTICAL
Sending: &PRINT
Sending: &STRESS_TENSOR ON
Sending: &END STRESS_TENSOR
Sending: &END PRINT
Sending: &DFT
Sending: BASIS_SET_FILE_NAME BASIS_MOLOPT
Sending: POTENTIAL_FILE_NAME POTENTIAL
Sending: UNRESTRICTED_KOHN_SHAM ON
Sending: &MGRID
Sending: CUTOFF [eV] 2.040854674163798109e+03
Sending: &END MGRID
Sending: &SCF
Sending: MAX_SCF 50
Sending: &END SCF
Sending: &LS_SCF
Sending: MAX_SCF 50
Sending: &END LS_SCF
Sending: &XC
Sending: &XC_FUNCTIONAL LDA
Sending: &END XC_FUNCTIONAL
Sending: &END XC
Sending: &POISSON
Sending: PERIODIC NONE
Sending: PSOLVER MT
Sending: &END POISSON
Sending: &END DFT
Sending: &SUBSYS
Sending: &COORD
Sending: O 2.000000000000000000e+00 2.000000000000000000e+00
3.245955999999999619e+00
Sending: O 2.000000000000000000e+00 2.000000000000000000e+00
1.999999999999999778e+00
Sending: &END COORD
Sending: &CELL
Sending: PERIODIC NONE
Sending: A 4.000000000000000000e+00 0.000000000000000000e+00
0.000000000000000000e+00
Sending: B 0.000000000000000000e+00 4.000000000000000000e+00
0.000000000000000000e+00
Sending: C 0.000000000000000000e+00 0.000000000000000000e+00
5.245955999999999619e+00
Sending: &END CELL
Sending: &KIND O
Sending: BASIS_SET /home/siyemperumal/GTH_BASIS_SETS_5-12-10
Sending: POTENTIAL GTH-LDA
Sending: &END KIND
Sending: &END SUBSYS
Sending: &END FORCE_EVAL
Sending: *END
When I do a Ctrl+C and interrupt, the following is the error produced:
KeyboardInterrupt
/home/siyemperumal/.local/lib/python2.6/site-packages/ase/calculators/cp2k.py:450:
RuntimeWarning: CP2K-shell not ready, sending SIGTERM.
warn("CP2K-shell not ready, sending SIGTERM.", RuntimeWarning)
Please let me know your thoughts on this. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20160718/19d72b02/attachment.htm>
More information about the CP2K-user
mailing list