Python ase-CP2K communication stalls

140 views
Skip to first unread message

Ioachim Dusa

unread,
5:27 AM (10 hours ago) 5:27 AM
to cp2k
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
cp2k.out
relax.py
debugging.out
Reply all
Reply to author
Forward
0 new messages