When I was trying to use the following code to extract variables in LAMMPS in PyLammps, running with multiple core using
mpirun -np 4 python3 extract_variables.py:
from lammps import PyLammps L = PyLammps() L.variable("a equal 1") a = L.variables["a"]
I receive complain from python on my screen output
TypeError: 'NoneType' object is not subscriptable (please see the attached file for full error output error.txt (1.4 KB)). I have tried to change the buffering mode to line buffering as instructed earlier in the mailing list (i.e. using
stdbuf -oL), but it doesn’t work. I’m wondering what else can I try to fix this?
Information that might be helpful: I use WSL to run LAMMPS and PyLammps, as instructed by Richard Berger in the documentation. I checkout’ed the master branch a month ago, and my python3 version is 3.8.10.
Many thanks for help in advance! I’ll provide information as needed.