Is it possible to run pimd simulations with more beads than mpi threads?

Hi LAMMPS users and developers!

I’m trying to run a PIMD simulation in LAMMPS. The fix pimd doc page says that the simulation need to be started in this way:

mpirun -np P lmp_mpi -partition MxN -in script

where P=M*N. Since I have to launch M (# of beads) partitions, it seems that I need to use at least M mpi threads. However, this is not feasible in my specific setup (I’m working with a custom pair style connecting to an external program, and having M mpi threads means launching M instances of that program, which leads to OOM).
I’m wondering if it’s possible to e.g. run a simulation with 32 beads on 8 mpi threads, where one thread is responsible for 4 beads. Maybe the forces of 4 beads are evaluated in turn, i.e. first the coordinates of 1st beads are sent for force evaluation, then the 2nd beads (after the results of 1st beads have returned), etc. Time integration occurs after all forces have returned.
If it’s not possible with the current LAMMPS version, I want to get a crude estimate on how difficult it’ll be to implement this (to see if I want to implement this myself, or I should find other solutions).


It is not possible.

It would be a substantial effort. Basically, you would need to have a different Integrate class that will maintain N LAMMPS class instances on M MPI tasks to have the N * M total tasks and set up that custom pair style in such a way that multiple of those can connect to the same external program.

Thanks for the reply! So I guess I’d try to find other solutions first.