Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket mode get stucked without any vasp output #57

Open
GengSS opened this issue Jun 14, 2024 · 2 comments
Open

socket mode get stucked without any vasp output #57

GengSS opened this issue Jun 14, 2024 · 2 comments

Comments

@GengSS
Copy link

GengSS commented Jun 14, 2024

Hello,

I am trying to use the socket mode to run vaspinteractive calculator,
Here is my input python script:

import sys
from ase.optimize import BFGS
from ase.io.trajectory import Trajectory
from ase.io import read,write
import os
from vasp_interactive import VaspInteractive
from ase.calculators.socketio import SocketIOCalculator

ncpus = os.environ['NUMBER_OF_CPUS']
parameters = dict(istart=0, icharg=2, encut=400, ispin=2, ediff=1.0e-5, nelm=120, nelmin=4, xc='pbe',
          kpts=(2,2,1), gamma=True, prec="N", algo="N",ismear=0, sigma=0.1,
          npar=8,lreal="Auto",lcharg=False,lwave=False,iwavpr=11, directory='calculator',
          ldau_luj={'Ti': {'L': 2, 'U': 4.5, 'J': 0}},
          command="mpirun -np {} vasp_std".format(ncpus))

atoms=read(sys.argv[1])
atoms.set_pbc(True)
job_id = os.environ['SLURM_JOB_ID']
vpi = VaspInteractive(**parameters)

with SocketIOCalculator(vpi, unixsocket='vasp_jobid_{}'.format(job_id)) as calc:
    atoms.set_calculator(calc)
    trajectory = Trajectory(traj, mode='a', atoms=atoms, master=True)
    dyn = BFGS(atoms, logfile=log, trajectory=trajectory)
    dyn.run(fmax=0.03)
    write("optimized.traj",atoms)

The job is not killed by the queue system, however, I don't see any output files generated by VASP (such as OUTCAR, OSZICAR etc).
In the directory 'calculator', I can only find those files,
ase-sort.dat INCAR KPOINTS POSCAR POTCAR socket-client.log
and socket-client.log is empty.

Is there anything wrong with my input?
BTW, I am using vasp6.3.2 without the patches,

Best,
Geng

@alchem0x2A
Copy link
Collaborator

Hi @GengSS, your vasp-interactive calculator wasn't initialized as socket mode, there are additional keywords to enable the socket communication layer, see

Parameters for socket-I/O mode:
            `use_socket`: if True, attach a socket client to the calculator and self.run() method
                          will be available. Note you don't need to set use_socket when passing through
                          SocketIOCalculator
            `host`: hostname of the socket server running iPI protocol
            `port`: server port to connect to
            `unixsocket`: name of local unix socket
            `timeout`: socket I/O timeout
            `log`: logfile for the socket client. If None, write to stdout

You can try specifying unixsocket in your parameters dict to see if it could solve your issue.

In your case it seems normal usage of vasp-interactive would suffice, could you also give a try? If you have copied the parameters from ex16_socketio.py, I appologize for the confusion as there seems to be some missing parts, I'll fix the examples asap.

@GengSS
Copy link
Author

GengSS commented Jul 4, 2024

Hi @alchem0x2A ,
Thank you for your reply, but I tried to add the 'unixsocket' parameter to VaspInteractive, but it did not work.
I also tried to switch on the use_socket=True, but it still fails to run.
Could you please show me an example that uses unixsocket mode?
Thank you very much in advance.
Best Wishes,
Geng

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants