[ase-users] Using sockets to do NEB calculations

Kushagra Agrawal AgrawalK2 at cardiff.ac.uk
Wed Jun 17 13:28:57 CEST 2020


Hi everyone

I am trying to run neb with sockets using FHI-aims calculator. But the problem is, the sockets are not working. When I try to define the socket calculator outside the for loop of images, it tells me I need a new calculator for every image. And when I try to define it within the for loop, it just gives me a socket time out error.
Can anyone confirm whether it is possible to run the NEB at all with the sockets? for reference, I am copying the code here.

from ase.constraints import FixAtoms
from ase.io import read, write
from ase.calculators.aims import Aims, AimsCube
from ase.calculators.lj import LennardJones
from ase.neb import NEB
#from ase.optimize import MDMin
from ase.optimize.fire import FIRE as QuasiNewton
from ase.calculators.socketio import SocketIOCalculator
import socket

#port
port=22736

#Calculator
def calc():
cal= Aims(k_grid='5 5 4',
xc='pbe',
vdw_correction_hirshfeld='true',
spin="none",
relativistic="atomic_zora scalar",
sc_iter_limit="300",
compute_forces="true",
final_forces_cleaned='true',
use_dipole_correction="true",
use_pimd_wrapper=(socket.gethostname(), port))
return SocketIOCalculator(cal, port=port)

#  Make images
images = read('traj.traj@:')

#define atoms to freeze
freeze=FixAtoms(indices=[12,36,14,38,18,42,16,40,0,24,2,26,6,30,4,28,45,21,47,23,33,9,35,11])

#setting the calculator
for image in images:
image.set_calculator(calc())
image.set_constraint(freeze)

# Make the NEB object, interpolate to guess the intermediate steps
neb = NEB(images, climb=True)

# Relax the NEB path:
minimizer = QuasiNewton(neb, trajectory='neb.traj')
minimizer.run(fmax=0.05)

socket.close()


Any leads with this will be appreciated.

Regards
Kushagra Agrawal
Visiting Doctoral Researcher
0.27, Department of Chemistry
Cardiff School of Chemistry
Cardiff University
Cardiff CF10 3AT
UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20200617/229878cb/attachment.html>


More information about the ase-users mailing list