Commit e01185c2 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

correct some errors and misconceptions about zlib and USER-OMP

parent 907b061e
Loading
Loading
Loading
Loading
+17 −16
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ available on your system.
If CMake cannot find the library, you can set these variables:

-D ZLIB_INCLUDE_DIR=path    # path to zlib.h header file 
-D ZLIB_LIBRARIES=path      # path to libzlib.a (.so) file :pre
-D ZLIB_LIBRARIES=path      # path to libz.a (.so) file :pre

[Traditional make]:

@@ -720,23 +720,24 @@ USER-OMP package :h4,link(user-omp)

[CMake build]:

No additional settings are needed besides "-D PKG_USER-OMP=yes".

TODO: Is "-D BUILD_OMP=yes" also needed?  Or is it enabled
if PKG_USER-OMP is set?
No additional settings are required besides "-D PKG_USER-OMP=yes".  If
CMake detects OpenMP support, the USER-OMP code will be compiled with
multi-threading support enabled, otherwise as optimized serial code.

[Traditional make]:

These compile and link flags must be added to your Makefile.machine file.
To enable multi-threading support in the USER-OMP package (and other
styles supporting OpenMP) the following compile and link flags must
be added to your Makefile.machine file.
See src/MAKE/OPTIONS/Makefile.omp for an example.

CCFLAGS: -fopenmp
CCFLAGS: -fopenmp               # for GNU Compilers
CCFLAGS: -qopenmp -restrict     # for Intel compilers on Linux
LINKFLAGS: -fopenmp
LINKFLAGS: -fopenmp             # for GNU Compilers
LINKFLAGS: -qopenmp             # for Intel compilers on Linux :pre

For other platforms and compilers, consult the OpenMP documentation
for the compiler.
For other platforms and compilers, please consult the documentation
about OpenMP support for your compiler.

:line

@@ -747,18 +748,18 @@ for a QM/MM simulation. You must also build Quantum ESPRESSO and
create a new executable (pwqmmm.x) which links LAMMPS and Quantum
ESPRESSO together.  These are steps 3 and 4 described in the
lib/qmmm/README file.  Unfortunately, the Quantum ESPRESSO developers
keep breaking the interface that the QM/MM code in LAMMPS is using, so
that currently (summer 2018) using this feature requires either
have been breaking the interface that the QM/MM code in LAMMPS is using,
so that currently (Summer 2018) using this feature requires either
correcting the library interface feature in recent Quantum ESPRESSO
releases, or using an outdated version of QE. The last version of
Quantum ESPRESSO known to work with this QM/MM interface in LAMMPS was
version 5.4.1 from 2016.
Quantum ESPRESSO known to work with this QM/MM interface was version
5.4.1 from 2016.

[CMake build]:

The CMake build system currently does not support building the full
QM/MM-capable hybrid executable of LAMMPS and QE called pwqmmm.x.  You
must use the traditional make build for this package.
QM/MM-capable hybrid executable of LAMMPS and QE called pwqmmm.x.  
You must use the traditional make build for this package.

[Traditional make]:

+6 −6
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ explain how to do this for building both with CMake and make.

"FFT library"_#fft for use with the "kspace_style pppm"_kspace_style.html command
"Size of LAMMPS data types"_#size
"Read or write compressed files"_#compress
"Read or write compressed files"_#gzip
"Output of JPG and PNG files"_#graphics via the "dump image"_dump_image.html command
"Output of movie files"_#graphics via the "dump_movie"_dump_image.html command
"Memory allocation alignment"_#align
@@ -223,7 +223,7 @@ variables:
-D PNG_INCLUDE_DIR=path     # path to png.h header file 
-D PNG_LIBRARIES=path       # path to libpng.a (.so) file 
-D ZLIB_INCLUDE_DIR=path    # path to zlib.h header file 
-D ZLIB_LIBRARIES=path      # path to libzlib.a (.so) file 
-D ZLIB_LIBRARIES=path      # path to libz.a (.so) file 
-D FFMPEG_EXECUTABLE=path   # path to ffmpeg executable :pre

[Makefile.machine settings]:
@@ -233,8 +233,8 @@ LMP_INC = -DLAMMPS_PNG
LMP_INC = -DLAMMPS_FFMPEG :pre

JPG_INC = -I/usr/local/include   # path to jpeglib.h, png.h, zlib.h header files if make cannot find them
JPG_PATH = -L/usr/lib            # paths to libjpeg.a, libpng.a, libzlib.a (.so) files if make cannot find them
JPG_LIB = -ljpeg -lpng -lzlib    # library names :pre
JPG_PATH = -L/usr/lib            # paths to libjpeg.a, libpng.a, libz.a (.so) files if make cannot find them
JPG_LIB = -ljpeg -lpng -lz       # library names :pre

As with CMake, you do not need to set JPG_INC or JPG_PATH, if make can
find the graphics header and library files.  You must specify JPG_LIB
@@ -254,7 +254,7 @@ crash.

:line

Read or write compressed files :h3,link(compress)
Read or write compressed files :h3,link(gzip)

If this option is enabled, large files can be read or written with
gzip compression by several LAMMPS commands, including
@@ -281,7 +281,7 @@ library calls (required by popen()) can interfere with the fast
communication library and lead to simulations using compressed output
or input to hang or crash. For selected operations, compressed file
I/O is also available using a compression library instead, which is
what the "COMPRESS package"_Packages.html enables.
what the "COMPRESS package"_Packages_details.html#PKG-COMPRESS enables.

:line

+17 −15
Original line number Diff line number Diff line
@@ -10,28 +10,29 @@ Documentation"_ld - "LAMMPS Commands"_lc :c
USER-OMP package :h3

The USER-OMP package was developed by Axel Kohlmeyer at Temple
University.  It provides multi-threaded versions of most pair styles,
nearly all bonded styles (bond, angle, dihedral, improper), several
Kspace styles, and a few fix styles.  The package currently uses the
OpenMP interface for multi-threading.
University.  It provides optimized and multi-threaded versions
of many pair styles, nearly all bonded styles (bond, angle, dihedral,
improper), several Kspace styles, and a few fix styles.  It uses
the OpenMP interface for multi-threading, but can also be compiled
without OpenMP support, providing optimized serial styles in that case.

Here is a quick overview of how to use the USER-OMP package, assuming
one or more 16-core nodes.  More details follow.

use -fopenmp with CCFLAGS and LINKFLAGS in Makefile.machine
make yes-user-omp
make mpi                                   # build with USER-OMP package, if settings added to Makefile.mpi
make omp                                   # or Makefile.omp already has settings :pre
make omp                                   # Makefile.omp already has OpenMP settings for GNU compilers
make mpi                                   # or build with USER-OMP package without OpenMP :pre

lmp_mpi -sf omp -pk omp 16 < in.script                         # 1 MPI task, 16 threads
mpirun -np 4 lmp_mpi -sf omp -pk omp 4 -in in.script           # 4 MPI tasks, 4 threads/task
mpirun -np 32 -ppn 4 lmp_mpi -sf omp -pk omp 4 -in in.script   # 8 nodes, 4 MPI tasks/node, 4 threads/task :pre
env OMP_NUM_THREADS=16 lmp_omp -sf omp -in in.script           # 1 MPI task, 16 threads according to OMP_NUM_THREADS
lmp_mpi -sf omp -in in.script                                  # 1 MPI task, no threads, optimized kernels
mpirun -np 4 lmp_omp -sf omp -pk omp 4 -in in.script           # 4 MPI tasks, 4 threads/task
mpirun -np 32 -ppn 4 lmp_omp -sf omp -pk omp 4 -in in.script   # 8 nodes, 4 MPI tasks/node, 4 threads/task :pre

[Required hardware/software:]

Your compiler must support the OpenMP interface.  You should have one
or more multi-core CPUs so that multiple threads can be launched by
each MPI task running on a CPU.
To enable multi-threading, your compiler must support the OpenMP interface.
You should have one or more multi-core CPUs, as multiple threads can only be
launched by each MPI task on the local node (using shared memory).

[Building LAMMPS with the USER-OMP package:]

@@ -41,8 +42,9 @@ one command as described on the "Packages
details"_Packages_details.html#USER-OMP doc page.

Note that the CCFLAGS and LINKFLAGS settings in Makefile.machine must
include "-fopenmp".  Likewise, if you use an Intel compiler, the
CCFLAGS setting must include "-restrict".
include "-fopenmp" for the GNU compilers.  If you use an Intel compiler,
the corresponding flag is "-qopenmp" and the CCFLAGS setting must also
include "-restrict".

[Run with the USER-OMP package from the command line:]