more docs, less debug

This commit is contained in:
Steve Plimpton
2022-07-22 14:22:34 -06:00
parent 1777f16d13
commit fc596c03ec
2 changed files with 100 additions and 17 deletions

78
examples/mdi/LATTE/README Normal file
View File

@ -0,0 +1,78 @@
Examples in this directoy use LAMMPS as an MDI driver code and the
LATTE tight-binding code as an MDI engine to perform ab initio MD and
evaluate the energy/forces/virial for a series of MD snapshots or
conformations with LATTE.
Talk about LATTE package and fix latte command
---------
Build LAMMPS with MDI support via the MDI package:
% cd lammps/lib/mdi
% python Install.py -m mpi # creates libmdi.a (not shared)
% cd lammps/src
% make yes-mdi
% make mpi # builds LAMMPS with MDI
---------
Build LATTE in its own Git repo:
cd latte/git
cp makefiles/makefile.CHOICES.mdi makefile.CHOICES
toggle settings:
MAKELIB = OFF
SHARED = ON
MDI = ON
for MDI, also need to set MDI_PATH to mdi/git/build/MDI_Library
also commented out some LIB lines for Cuda
then just type "make"
produces exe = LATTE_DOUBLE and libfile = liblatte_mdi.so
the exe is not the non-MDI LATTE main, but a new one that goes into engine mode
---------
copy lmp_mpi and LATTE_DOUBLE into this dir
set LD_LIB_PATH to ~/latte/git for liblatte_mdi.so file in plugin mode
LATTE always uses in.latte as input file, contains no element info
LATTE always uses latte.in
this version of LATTE does not use MPI, only OpenMP or GPU
run LATTE with OpenMP: setenv OMP_NUM_THREADS max-core-count
---------
Run AIMD test problem:
build LAMMPS with molecule package
LAMMPS uses in.mdi.aimd or in.mdi.aimd.plugin
++ Run with MPI: 1 proc each
mpirun -np 1 lmp_mpi -mdi "-name LMP -role DRIVER -method MPI" \
-log log.aimd.driver.mpi.1 -in in.mdi.aimd : \
-np 1 LATTE_DOUBLE -mdi "-name LATTE -role ENGINE -method MPI"
++ Run in plugin mode: 1 proc
lmp_mpi -mdi \
"-name LMP -role DRIVER -method LINK -plugin_path /home/sjplimp/latte/git" \
-log log.aimd.driver.plugin.1 -in in.mdi.aimd.plugin
---------
Run sequence of configs:
++ Run with MPI: 1 proc each
mpirun -np 1 lmp_mpi -mdi "-name LMP -role DRIVER -method MPI" \
-log log.series.driver.mpi.1 -in in.series.driver : \
-np 1 LATTE_DOUBLE -mdi "-name LATTE -role ENGINE -method MPI"
++ Run in plugin mode: 1 proc
lmp_mpi -mdi \
"-name LMP -role DRIVER -method LINK -plugin_path /home/sjplimp/latte/git" \
-log log.series.driver.plugin.1 -in in.series.driver.plugin

View File

@ -2,15 +2,14 @@ These are examples that work the MDI package in LAMMPS which uses the
MolSSI MDI library for coupling codes together and communicating
between them with MDI messages.
Within the MDI context, one code is the driver and another code is
the engine. The 2 codes can be written in any language; C++ (LAMMPS)
and Python are illustrated here. The 2 codes can each be stand-alone
codes, in which case they can be run on different numbers of processors.
The 2
codes can communicate either via TCP (sockets) or via MPI. For the
TCP case, the driver and engine need to be launched separately,
e.g. in 2 windows on your desktop machine. For the MPI case, a single
mpirun command launches both codes.
Within the MDI context, one code is the driver and another code is the
engine. The 2 codes can be written in any language; C++ (LAMMPS) and
Python are illustrated here. The 2 codes can each be stand-alone
codes, in which case they can be run on different numbers of
processors. The 2 codes can communicate either via TCP (sockets) or
via MPI. For the TCP case, the driver and engine need to be launched
separately, e.g. in 2 windows on your desktop machine. For the MPI
case, a single mpirun command launches both codes.
Alternatively the engine code can be a plugin library which the driver
code loads, in which case the driver and engine run on the same
@ -19,13 +18,19 @@ processors.
LAMMPS supports operating in all these MDI modes. It can be an engine
operating either as a stand-alone code or as a plugin. It can also be
a driver and couple to an engine that is either a stand-alone code or
a plugin. Examples for all these use cases are in this directory.
The Run.sh file shows how run in all the modes. Type "sh Run.sh"
to try them all out.
a plugin.
To use LAMMPS as a plugin engine, you must build it as a shared
library. Something like this with make, which also builds the normal
LAMMPS executable lmp_mpi:
Examples for all these use cases, using LAMMPS as a driver and as an
engine are in this directory. The Run.sh file shows how run in all
the modes. Type "sh Run.sh" to try them all out.
Examples for using LAMMPS as a driver with the tight-binding code LATTE
are in the LATTE sub-directory. See its README file for more info.
Note that to use LAMMPS as a plugin engine for some the examples in
this dir, you must build it as a shared library. Something like this
with traditional make, which also builds the normal LAMMPS executable
lmp_mpi:
cd src
make yes-mdi
@ -39,9 +44,9 @@ Python/mpi4py are using same the same version of MPI.
You will also need MDI installed in your Python. You cannot use the
LAMMPS build of the MDI library for this, b/c LAMMPS builds MDI as a
static library, not shared, which Python requires.
static library, while Python requires a shared library.
You can install MDI in your Python via conda:
Instead you can install MDI in your Python via conda:
% conda install -c conda-forge pymdi=1.4.1