server command


server protocol
  • protocol = md or mc


server md


This command starts LAMMPS running in “server” mode, where it receives messages from a separate “client” code and responds by sending a reply message back to the client. The specified protocol determines the format and content of messages LAMMPS expects to receive and how it responds.

The Howto client/server doc page gives an overview of client/server coupling of LAMMPS with another code where one code is the “client” and sends request messages to a “server” code. The server responds to each request with a reply message. This enables the two codes to work in tandem to perform a simulation.

When this command is invoked, LAMMPS will run in server mode in an endless loop, waiting for messages from the client code. The client signals when it is done sending messages to LAMMPS, at which point the loop will exit, and the remainder of the LAMMPS script will be processed.

The protocol argument defines the format and content of messages that will be exchanged between the two codes. The current options are:

  • md = run dynamics with another code
  • mc = perform Monte Carlo moves with another code

For protocol md, LAMMPS can be either a client (via the fix client/md command) or server. See the server md doc page for details on the protocol.

For protocol mc, LAMMPS can be the server. See the server mc doc page for details on the protocol.


This command is part of the MESSAGE package. It is only enabled if LAMMPS was built with that package. See the Build package doc page for more info.

A script that uses this command must also use the message command to setup the messaging protocol with the other client code.