Skip to content
Snippets Groups Projects
Commit 0384ef89 authored by Steve Plimpton's avatar Steve Plimpton
Browse files

more tweaks to client/server doc pages

parent 25907c85
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,7 @@ client or server. ...@@ -61,7 +61,7 @@ client or server.
"message"_message.html "message"_message.html
"fix client md"_fix_client_md.html = LAMMPS is a client for running MD "fix client md"_fix_client_md.html = LAMMPS is a client for running MD
"server md"_server_md.html = LAMMPS is a server for computing MD forces "server md"_server_md.html = LAMMPS is a server for computing MD forces
"server mc"_server_mc.html = LAMMPS is a server for computing a Monte Carlo energy "server mc"_server_mc.html = LAMMPS is a server for computing a Monte Carlo energy :ul
The server doc files give details of the message protocols The server doc files give details of the message protocols
for data that is exchanged bewteen the client and server. for data that is exchanged bewteen the client and server.
...@@ -119,7 +119,7 @@ For message exchange in {mpi/one} mode: ...@@ -119,7 +119,7 @@ For message exchange in {mpi/one} mode:
Launch both codes in a single mpirun command: Launch both codes in a single mpirun command:
mpirun -np 2 lmp_mpi -mpicolor 0 -in in.message.client -log log.client : -np 4 lmp_mpi -mpicolor 1 -in in.message.server -log log.server mpirun -np 2 lmp_mpi -mpicolor 0 -in in.message.client -log log.client : -np 4 lmp_mpi -mpicolor 1 -in in.message.server -log log.server :pre
The two -np values determine how many procs the client and the server The two -np values determine how many procs the client and the server
run on. run on.
......
...@@ -63,7 +63,7 @@ See the src/MESSAGE/server_mc.cpp file for details on how LAMMPS uses ...@@ -63,7 +63,7 @@ See the src/MESSAGE/server_mc.cpp file for details on how LAMMPS uses
these messages. See the examples/COUPLE/lammmps_mc/mc.cpp file for an these messages. See the examples/COUPLE/lammmps_mc/mc.cpp file for an
example of how an MC driver code can use these messages. example of how an MC driver code can use these messages.
Let NATOMS=1, EINIT=2, DISPLACE=3, ACCEPT=4, RUN=5. Define NATOMS=1, EINIT=2, DISPLACE=3, ACCEPT=4, RUN=5.
[Client sends one of these kinds of message]: [Client sends one of these kinds of message]:
...@@ -93,9 +93,9 @@ cs->pack(2,3*natoms,x) # 2nd field = 3N coords of Natoms :pre ...@@ -93,9 +93,9 @@ cs->pack(2,3*natoms,x) # 2nd field = 3N coords of Natoms :pre
cs->send(DISPLACE,1) # msgID = 3 with 1 field cs->send(DISPLACE,1) # msgID = 3 with 1 field
cs->pack_double(1,poteng) # 1st field = new potential energy of system :pre cs->pack_double(1,poteng) # 1st field = new potential energy of system :pre
cs->send(ACCEPT,0) # msgID = 4 with no fields cs->send(ACCEPT,0) # msgID = 4 with no fields :pre
cs->send(RUN,0) # msgID = 5 with no fields cs->send(RUN,0) # msgID = 5 with no fields :pre
:line :line
......
...@@ -51,9 +51,9 @@ can complete the timestep. This command could also be used with a ...@@ -51,9 +51,9 @@ can complete the timestep. This command could also be used with a
client code that performs energy minimization, using the server to client code that performs energy minimization, using the server to
compute forces and energy each iteration of its minimizer. compute forces and energy each iteration of its minimizer.
When using the "fix client/md" command, LAMMPS (as the client code) When using the "fix client/md"_fix_client_md.html command, LAMMPS (as
does the timestepping and receives needed energy, forces, and pressure the client code) does the timestepping and receives needed energy,
values from the server code. forces, and pressure values from the server code.
The format and content of the exchanged messages are explained here in The format and content of the exchanged messages are explained here in
a conceptual sense. Python-style pseudo code for the library calls to a conceptual sense. Python-style pseudo code for the library calls to
...@@ -69,9 +69,11 @@ a quantum code (VASP) can use use these messages. ...@@ -69,9 +69,11 @@ a quantum code (VASP) can use use these messages.
The following pseudo-code uses these values, defined as enums. The following pseudo-code uses these values, defined as enums.
enum{SETUP=1,STEP}; Define:
enum{DIM=1,PERIODICITY,ORIGIN,BOX,NATOMS,NTYPES,TYPES,COORDS,UNITS,CHARGE};
enum{FORCES=1,ENERGY,PRESSURE,ERROR}; :pre SETUP=1, STEP=2
DIM=1, PERIODICITY=2, ORIGIN=3, BOX=4, NATOMS=5, NTYPES=6, TYPES=7, COORDS=8, UNITS-9, CHARGE=10
FORCES=1, ENERGY=2, PRESSURE=3, ERROR=4 :pre
[Client sends 2 kinds of messages]: [Client sends 2 kinds of messages]:
...@@ -98,7 +100,7 @@ cs->send(STEP,nfields) # msgID with nfields :pre ...@@ -98,7 +100,7 @@ cs->send(STEP,nfields) # msgID with nfields :pre
cs->pack(COORDS,3*natoms,x) # vector of 3N atom coords cs->pack(COORDS,3*natoms,x) # vector of 3N atom coords
cs->pack(ORIGIN,3,origin) # lower-left corner of simulation box cs->pack(ORIGIN,3,origin) # lower-left corner of simulation box
cs->pack(BOX,9,box) # 3 edge vectors of simulation box cs->pack(BOX,9,box) # 3 edge vectors of simulation box :pre
[Server replies to either kind of message]: [Server replies to either kind of message]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment