Running Lammps with one processor but LATTE in parallel

I am trying to run relaxations of graphene in Lammps with LATTE parallelized over kpoints. I currently have Lammps and LATTE built with MPI, but I am unsure of how to partition resources.

So far, I have tried running lammps in multi-partition mode, where I specify one partition has 1 processor and the second partition has X number of processors (i.e. mpirun -np 42 lmp_mpi -partition 1 41 -in input_file). In the input file I then specify:

partition yes 1 fix 1 all nve
partition yes 2 fix 2 all latte NULL

Running this command gives the following error:
"Open MPI has detected that this process has attempted to initialize
MPI (via MPI_INIT or MPI_INIT_THREAD) more than once. This is

[a34n18:76070] *** An error occurred in MPI_Init
[a34n18:76070] *** reported by process [1622214326,1]
[a34n18:76070] *** on a NULL communicator
[a34n18:76070] *** Unknown error
[a34n18:76070] *** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
[a34n18:76070] *** and potentially your MPI job)"

I think the origin of this problem is running fix latte with lmp_mpi, because even when I do not partition, but just have one MPI task, I still get this error.

Is this the correct way to go about solving this problem, or am I on the wrong track here?

If you use the partition command the way you do, you will run two independent calculations, one with the fix nve and the other with fix latte instead. So that obviously cannot work.

Please note the following:

  • fix latte is obsolete and using an effectively unmaintained version of LATTE.
  • fix latte requires compiling LATTE without MPI support and does not allow to run LAMMPS in parallel. For starters, you cannot have both, LAMMPS and LATTE call MPI_Init() as the error message indicates, the LATTE code would have to be updated to check with MPI_Initialized() whether calling MPI_Init() is required or not. I am confident that other changes are required, too.
  • during execution the of a run using fix latte, the code will execute LAMMPS code, then fix latte will call out to the embedded LATTE library and return control to LAMMPS afterwards, so no partitioning needed.
  • in the most recent LAMMPS release (15 June 2023), the LATTE package has been removed and the coupling between LAMMPS and LATTE changed to use the MDI package using the MDI library. This requires a specific branch of LATTE where currently development happens. You can find detailed instructions in a README file and examples in the examples/QUANTUM/LATTE folder of this release.