[CP2K-user] [CP2K:22022] Re: Python ase-CP2K communication stalls
Ioachim Dusa
ioachimdusa at gmail.com
Mon Jan 5 13:44:33 UTC 2026
To provide further information: I have also built in some printing on the
cp2k_shell side yielding
2026-01-05 12:37:11.335 INFO: GET_E arg1: 1
2026-01-05 12:37:11.335 INFO: env_id=1 (from "1")
2026-01-05 12:37:11.335 OUT: GET_E: -1.1265646594004E+04
2026-01-05 12:37:11.335 OUT: * READY
However on the python-ase side I obtain:
Time-py: 2026-01-05 12:37:11.335682 Received: -1.1265646594004E+04
Time-py: 2026-01-05 12:37:11.375882 Received: * READY
Time-py: 2026-01-05 12:37:11.376014 Sending: GET_F 1
Time-py: 2026-01-05 12:37:11.376104 Sending done
Time-py: 2026-01-05 12:37:11.376195 Flushing done
>From which I infer that the GET_F command is for sure sent by ase but it
never arrives at the cp2k_shell. Does anyone have any idea of how I could
proceed and resolve the issue?
Ioachim Dusa schrieb am Samstag, 3. Januar 2026 um 08:05:40 UTC:
> In addition to above: I have added to the cp2k.py send function a flush,
> i.e. :
>
> self._child.stdin.write(line + '\n')
>
> self._child.stdin.flush()
>
> The programme is still stuck, however it is now waiting for the forces to
> be transferred.
>
> Sending: GET_E 1
>
> Received: -1.1265646679912E+04
>
> Received: * READY
>
> Sending: GET_F 1
>
> Ioachim Dusa schrieb am Freitag, 2. Januar 2026 um 10:27:10 UTC:
>
>> Dear cp2k community,
>>
>> happy new year!
>>
>> I am having trouble with the calculator implementation of cp2k in ase,
>> which I use for structure relaxation of a system with about 200 atoms.
>> Here, after a few relaxation steps the program freezes, without yielding
>> any errors. In a nutshell I am using the cp2k ase calculator coupled with
>> BFGSLineSearch: (see attached relax.py script)
>>
>> cp2k_calc = CP2K(
>>
>> print_level="LOW",
>>
>> debug=*True*,
>>
>> auto_write=*True*,
>>
>> set_pos_file=*True*,
>>
>> basis_set=*None*,
>>
>> inp=cp2k_inp,
>>
>> command="srun --cpus-per-task=8 cp2k_shell.psmp",
>>
>> max_scf=30,
>>
>> basis_set_file=*None*,
>>
>> potential_file=*None*,
>>
>> pseudo_potential=*None*,
>>
>> xc=*None*
>>
>> )
>>
>> # ATTACH THE CALCULATOR
>>
>> ecf = UnitCellFilter(atoms, mask=[1, 1, 0, 0, 0, 1],
>> scalar_pressure=pressure * to_eV_per_A3)
>>
>> opt = BFGSLineSearch(ecf, trajectory=f"{seed}-opt.traj", logfile=f
>> "{seed}-opt.log")
>>
>> conv = opt.run(fmax=2e-4, steps=2000)
>>
>>
>> This yields the log file:
>> .....
>>
>> BFGSLineSearch: 25[ 42] 22:35:49 -11251.564792 0.0208
>>
>> BFGSLineSearch: 26[ 44] 22:37:14 -11251.564866 0.0243
>>
>> BFGSLineSearch: 27[ 46] 22:38:34 -11251.564972 0.0113
>>
>> BFGSLineSearch: 28[ 48] 22:39:57 -11251.564986 0.0129
>>
>> BFGSLineSearch: 29[ 49] 22:40:49 -11251.565118 0.0148
>>
>> BFGSLineSearch: 30[ 55] 22:43:39 -11251.565136 0.0148
>>
>> where at this point the computation freezes.
>> At first I thought that the problem might be related to these posts (
>> https://groups.google.com/g/cp2k/c/QJ7AvFvWxio,
>> https://groups.google.com/g/cp2k/c/2C7_YEHFKPg/m/DfUyEZo9AwAJ), where
>> the issues came from the communication of the positions over stdin stdout,
>> which made troubles with the openMPI library. However, as seen above, I am
>> using the set_pos_file option and also the debugging output seems to point
>> out that the program is waiting for the energy to be transferred:
>>
>> Writing restart to: cp2k
>>
>> system_changes: ['cell', 'positions']
>>
>> Sending: UNITS_EV_A
>>
>> Received: * READY
>>
>> Sending: SET_CELL 1
>>
>> Sending: 1.461098823523022006e+01 -4.272432504248221269e-02
>> 0.000000000000000000e+00
>>
>> Sending: 4.368728107838069918e-02 1.478971208354484723e+01
>> 0.000000000000000000e+00
>>
>> Sending: 0.000000000000000000e+00 0.000000000000000000e+00
>> 1.500000000000000000e+01
>>
>> Received: * READY
>>
>> Sending: SET_POS_FILE cp2k.pos 1
>>
>> Received: 5.9071093868361E-02
>>
>> Received: * READY
>>
>> Sending: EVAL_EF 1
>>
>> Received: * READY
>>
>> Sending: GET_E 1
>>
>> Regarding the cp2k output file (see attached) it is stuck after the SCF
>> convergence at the line
>>
>> Total energy: -414.00490349713448
>>
>> Any help is appreciated, thank you very much!
>> Best,
>> Ioachim
>>
>
--
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+unsubscribe at googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/f2399cbd-ea17-483e-9519-1e1d770dfce6n%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20260105/00e7ccc9/attachment-0001.htm>
More information about the CP2K-user
mailing list