Skip to content

[BUG] dp as ASE calculator, no output until the whole script is finished #802

@shuaijiang-ustc

Description

@shuaijiang-ustc

Hi, everyone, I am trying to use dp as ASE calculator to obtain energy and force for each input geometry. The dp force field has been trained under dp 1.2.0 in centos7 and performs well.
Every time I submt the python script to put geometry into dp calculator iteratively, there is no output energy or force until all the geometries calculations are finished. However, normally, the whole cycle cannot be finished since the system memory soon ran out. Here is my code:
def get_E(isomer):
isomer.set_cell(100 * np.identity(3))
isomer.set_pbc((False, False, False))
isomer.calc=DP(model="graph.pb")
E=isomer.get_potential_energy()[0]
return E

f=open('E_ML.txt','w')
for one_xyz in xyz:
xyz_atoms_objs=ase.io.read(one_xyz,index=':')
for isomer in xyz_atoms_objs:
E=get_E(isomer)
f.write(str(E)+'\n')
f.close()
Any suggestions are sinerely welcomed!
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions