Dear All

There is a quite nice example in the lammps "examples" directory of showing how to use lammps as a library within c/c++.

However this is in MPI, does anybody know whether it is possible to force lammps to run in serial in this mode. There is a function in the previous file

"lmp = new LAMMPS(0, NULL, comm_lammps)"

which I'm assuming changes this behaviour.

In addition using lammps in this way is quite fast but is significantly slowed down by printing to standard output. Does anybody know how to suppress the output to only gather the result?



LAMMPS always is compiled against an MPI library, but you can use the dummy library in the src/STUBS folder to run in serial (see Makefile.serial).

You can turn off screen/log file output via command line flags, which can also be passed to the library init.