Hi LAMMPS developers and users,
I want to run a LAMMPS script on GPU from Python, just as what Pragin wanted to do in Running LAMMPS on GPU from python script - LAMMPS / LAMMPS General Discussion - Materials Science Community Discourse (matsci.org). I followed Axel’s advice and used the command args:
from lammps import lammps
lmp = lammps(cmdargs=['-sf', 'gpu', '-pk', 'gpu 1'])
lmp.file('myscript.in')
This would be OK if no hybrid pair style was specified. Otherwise, I would be given the error:
ERROR: Must not use GPU neighbor lists with hybrid pair style (src/GPU/fix_gpu.cpp:280)
I know that to bypass the error, I can specify neigh no
and run on the terminal
lmp -sf gpu -pk gpu 1 neigh no -in myscript.in
But how can I specify it in Python? I tried the commands below, but none of them worked and I got the same error.
lmp = lammps(cmdargs=['-sf', 'gpu', '-pk', 'gpu 1 neigh no'])
lmp = lammps(cmdargs=['-sf', 'gpu', '-pk', 'gpu 1', 'neigh', 'no'])
lmp = lammps(cmdargs=['-sf', 'gpu', '-pk', 'gpu 1', 'neigh no'])
Any help or comment is appreciated. Thanks in advance!