Multiple simulation boxes per MPI Rank in LAMMPS


I am trying to create multiple simulation boxes within every MPI rank in LAMMPS. Is there a good way of doing this, either through LAMMPS commands or through modifying the internals of LAMMPS as currently, it seems like each MPI Rank is only allowed 1 simulation box.


@ryandeng You have to provide a very compelling reason why the two boxes have to be on the same MPI rank.

In general, the LAMMPS way of handling this would be to run in multi-partition mode and then have one box per MPI ranks. Please see the commands and styles in the REPLICA package for examples. If need be, you can oversubscribe your MPI ranks. The LAMMPS manual mentions this.

Otherwise, you can create your own main() function in which your first create two copies of the world communicator and then create a LAMMPS instance for each box and feed each the suitable input files or commands). However, this is likely more cumbersome than the multi-partition setup.