def run_client(): atoms = getatoms() atoms.calc = EMT() try: with open('client.log', 'w') as fd: client = SocketClient(log=fd, port=port, timeout=timeout) client.run(atoms, use_stress=False) except BrokenPipeError: # I think we can find a way to close sockets so as not to get an # error, but presently things are not like that. pass
"outfilename": "aims.out", } dft_settings = { # system settings "xc": "pbe", "spin": "none", "compute_forces": True, } # ################# Set aims calculator ###################### workdir = "aims_rundir" port_aims = 12345 aux_settings = {"label": workdir, "use_pimd_wrapper": ("localhost", port_aims)} calc = Aims(**usr_settings, **dft_settings, **aux_settings) # atoms.set_calculator(calc) # ################# Create Client ############################ # inet port_ipi = 10200 host_ipi = "localhost" client = SocketClient(host=host_ipi, port=port_ipi) # ################# Create ASE SERVER ############################ with SocketIOCalculator(calc, log="socketio.log", port=port_aims) as io_calc: atoms.set_calculator(io_calc) client.run(atoms)