I am trying to run the attached python script which imports lammps as module and makes use of the OpenKIM interface.
When I run the script in serial mode using the command:
which is part of a loop over all particles of the system. Following the instructions in the manual, this command is executed only if MPI.COMM_WORLD.rank == 0.
I have tested the script using the latest version available at GitHub.
How can I overcome this issue?
Thanks in advance for your help
Evangelos Voyiatzis
I am trying to run the attached python script which imports lammps as module and makes use of the OpenKIM interface.
When I run the script in serial mode using the command:
which is part of a loop over all particles of the system. Following the instructions in the manual, this command is executed only if MPI.COMM_WORLD.rank == 0.
I have tested the script using the latest version available at GitHub.
How can I overcome this issue?
i don’t think there is a simple way to resolve this within PyLammps.
the operation in evaluating L.atoms[iat].type requires an MPI_Alltoall() internally in the LAMMPS library to make distributed per-atom data globally available, but the PyLammps code also references internal functionality, that only provides data on MPI rank 0 (since it make LAMMPS generate output and then parses this output).
For complex and advanced operations like you are trying to do, I would fall back to the lammps module. There are gather/scatter operations that you can use. The fact that PyLammps in many functionality depends on triggering output (sometimes even by sending additional commands to the LAMMPS instance) makes it very problematic for parallel runs (as output is only generated on rank 0, and may have problems with block buffering, depending on the MPI library implementation).