Merge branch 'master' into USER-DPD_kokkos as of patch 10Aug17

This commit is contained in:
Tim Mattox 2017-08-11 13:25:28 -04:00
commit 4041db8d1a
151 changed files with 2662 additions and 2690 deletions

BIN
doc/src/JPG/bow_tutorial_01.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
doc/src/JPG/bow_tutorial_02.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
doc/src/JPG/bow_tutorial_03.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
doc/src/JPG/bow_tutorial_04.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
doc/src/JPG/bow_tutorial_05.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
doc/src/JPG/bow_tutorial_06.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
doc/src/JPG/bow_tutorial_07.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
doc/src/JPG/bow_tutorial_08.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
doc/src/JPG/bow_tutorial_09.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
doc/src/JPG/bow_tutorial_10.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -1,7 +1,7 @@
<!-- HTML_ONLY -->
<HEAD>
<TITLE>LAMMPS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="24 Jul 2017 version">
<META NAME="docnumber" CONTENT="10 Aug 2017 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -21,7 +21,7 @@
<H1></H1>
LAMMPS Documentation :c,h3
24 Jul 2017 version :c,h4
10 Aug 2017 version :c,h4
Version info: :h4

View File

@ -233,8 +233,8 @@ set any needed options for the package via "-pk" "command-line switch"_Section_s
use accelerated styles in your input via "-sf" "command-line switch"_Section_start.html#start_6 or "suffix"_suffix.html command | lmp_machine -in in.script -sf gpu
:tb(c=2,s=|)
Note that the first 4 steps can be done as a single command, using the
src/Make.py tool. This tool is discussed in "Section
Note that the first 4 steps can be done as a single command with
suitable make command invocations. This is discussed in "Section
4"_Section_packages.html of the manual, and its use is
illustrated in the individual accelerator sections. Typically these
steps only need to be done once, to create an executable that uses one

View File

@ -49,6 +49,7 @@ Lists of both kinds of directories are given below.
Lowercase directories :h4
accelerate: run with various acceleration options (OpenMP, GPU, Phi)
airebo: polyethylene with AIREBO potential
balance: dynamic load balancing, 2d system
body: body particles, 2d system
cmap: CMAP 5-body contributions to CHARMM force field

View File

@ -25,6 +25,17 @@ There are two kinds of packages in LAMMPS, standard and user packages:
"Table of standard packages"_#table_standard
"Table of user packages"_#table_user :ul
Either of these kinds of packages may work as is, may require some
additional code compiled located in the lib folder, or may require
an external library to be downloaded, compiled, installed, and LAMMPS
configured to know about its location and additional compiler flags.
You can often do the build of the internal or external libraries
in one step by typing "make lib-name args='...'" from the src dir,
with appropriate arguments included in args='...'. If you just type
"make lib-name" you should see a help message about supported flags
and some examples. For more details about this, please study the
tables below and the sections about the individual packages.
Standard packages are supported by the LAMMPS developers and are
written in a syntax and style consistent with the rest of LAMMPS.
This means the developers will answer questions about them, debug and
@ -34,7 +45,9 @@ LAMMPS.
User packages have been contributed by users, and begin with the
"user" prefix. If they are a single command (single file), they are
typically in the user-misc package. User packages don't necessarily
meet the requirements of the standard packages. If you have problems
meet the requirements of the standard packages. This means the
developers will try to keep things working and usually can answer
technical questions about compiling the package. If you have problems
using a feature provided in a user package, you may need to contact
the contributor directly to get help. Information on how to submit
additions you make to LAMMPS as single files or as a standard or user
@ -78,10 +91,10 @@ Package, Description, Doc page, Example, Library
"COMPRESS"_#COMPRESS, I/O compression, "dump */gz"_dump.html, -, sys
"CORESHELL"_#CORESHELL, adiabatic core/shell model, "Section 6.6.25"_Section_howto.html#howto_25, coreshell, -
"DIPOLE"_#DIPOLE, point dipole particles, "pair_style dipole/cut"_pair_dipole.html, dipole, -
"GPU"_#GPU, GPU-enabled styles, "Section 5.3.1"_accelerate_gpu.html, WWW bench, int
"GPU"_#GPU, GPU-enabled styles, "Section 5.3.1"_accelerate_gpu.html, "Benchmarks"_http://lammps.sandia.gov/bench.html, int
"GRANULAR"_#GRANULAR, granular systems, "Section 6.6.6"_Section_howto.html#howto_6, pour, -
"KIM"_#KIM, openKIM wrapper, "pair_style kim"_pair_kim.html, kim, ext
"KOKKOS"_#KOKKOS, Kokkos-enabled styles, "Section 5.3.3"_accelerate_kokkos.html, WWW bench, -
"KIM"_#KIM, OpenKIM wrapper, "pair_style kim"_pair_kim.html, kim, ext
"KOKKOS"_#KOKKOS, Kokkos-enabled styles, "Section 5.3.3"_accelerate_kokkos.html, "Benchmarks"_http://lammps.sandia.gov/bench.html, -
"KSPACE"_#KSPACE, long-range Coulombic solvers, "kspace_style"_kspace_style.html, peptide, -
"MANYBODY"_#MANYBODY, many-body potentials, "pair_style tersoff"_pair_tersoff.html, shear, -
"MC"_#MC, Monte Carlo options, "fix gcmc"_fix_gcmc.html, -, -
@ -90,7 +103,7 @@ Package, Description, Doc page, Example, Library
"MOLECULE"_#MOLECULE, molecular system force fields, "Section 6.6.3"_Section_howto.html#howto_3, peptide, -
"MPIIO"_#MPIIO, MPI parallel I/O dump and restart, "dump"_dump.html, -, -
"MSCG"_#MSCG, multi-scale coarse-graining wrapper, "fix mscg"_fix_mscg.html, mscg, ext
"OPT"_#OPT, optimized pair styles, "Section 5.3.5"_accelerate_opt.html, WWW bench, -
"OPT"_#OPT, optimized pair styles, "Section 5.3.5"_accelerate_opt.html, "Benchmarks"_http://lammps.sandia.gov/bench.html, -
"PERI"_#PERI, Peridynamics models, "pair_style peri"_pair_peri.html, peri, -
"POEMS"_#POEMS, coupled rigid body motion, "fix poems"_fix_poems.html, rigid, int
"PYTHON"_#PYTHON, embed Python code in an input script, "python"_python.html, python, sys
@ -101,8 +114,7 @@ Package, Description, Doc page, Example, Library
"SHOCK"_#SHOCK, shock loading methods, "fix msst"_fix_msst.html, -, -
"SNAP"_#SNAP, quantum-fitted potential, "pair snap"_pair_snap.html, snap, -
"SRD"_#SRD, stochastic rotation dynamics, "fix srd"_fix_srd.html, srd, -
"VORONOI"_#VORONOI, Voronoi tesselation, "compute voronoi/atom"_compute_voronoi_atom.html, -, ext
:tb(ea=c,ca1=l)
"VORONOI"_#VORONOI, Voronoi tesselation, "compute voronoi/atom"_compute_voronoi_atom.html, -, ext :tb(ea=c,ca1=l)
[USER packages] :link(table_user),p
@ -118,7 +130,7 @@ Package, Description, Doc page, Example, Library
"USER-EFF"_#USER-EFF, electron force field,"pair_style eff/cut"_pair_eff.html, USER/eff, -
"USER-FEP"_#USER-FEP, free energy perturbation,"compute fep"_compute_fep.html, USER/fep, -
"USER-H5MD"_#USER-H5MD, dump output via HDF5,"dump h5md"_dump_h5md.html, -, ext
"USER-INTEL"_#USER-INTEL, optimized Intel CPU and KNL styles,"Section 5.3.2"_accelerate_intel.html, WWW bench, -
"USER-INTEL"_#USER-INTEL, optimized Intel CPU and KNL styles,"Section 5.3.2"_accelerate_intel.html, "Benchmarks"_http://lammps.sandia.gov/bench.html, -
"USER-LB"_#USER-LB, Lattice Boltzmann fluid,"fix lb/fluid"_fix_lb_fluid.html, USER/lb, -
"USER-MANIFOLD"_#USER-MANIFOLD, motion on 2d surfaces,"fix manifoldforce"_fix_manifoldforce.html, USER/manifold, -
"USER-MEAMC"_#USER-MEAMC, modified EAM potential (C++), "pair_style meam/c"_pair_meam.html, meam, -
@ -126,7 +138,7 @@ Package, Description, Doc page, Example, Library
"USER-MISC"_#USER-MISC, single-file contributions, USER-MISC/README, USER/misc, -
"USER-MOLFILE"_#USER-MOLFILE, "VMD"_vmd_home molfile plug-ins,"dump molfile"_dump_molfile.html, -, ext
"USER-NETCDF"_#USER-NETCDF, dump output via NetCDF,"dump netcdf"_dump_netcdf.html, -, ext
"USER-OMP"_#USER-OMP, OpenMP-enabled styles,"Section 5.3.4"_accelerate_omp.html, WWW bench, -
"USER-OMP"_#USER-OMP, OpenMP-enabled styles,"Section 5.3.4"_accelerate_omp.html, "Benchmarks"_http://lammps.sandia.gov/bench.html, -
"USER-PHONON"_#USER-PHONON, phonon dynamical matrix,"fix phonon"_fix_phonon.html, USER/phonon, -
"USER-QMMM"_#USER-QMMM, QM/MM coupling,"fix qmmm"_fix_qmmm.html, USER/qmmm, ext
"USER-QTB"_#USER-QTB, quantum nuclear effects,"fix qtb"_fix_qtb.html "fix qbmsst"_fix_qbmsst.html, qtb, -
@ -136,8 +148,7 @@ Package, Description, Doc page, Example, Library
"USER-SMTBQ"_#USER-SMTBQ, second moment tight binding QEq potential,"pair_style smtbq"_pair_smtbq.html, USER/smtbq, -
"USER-SPH"_#USER-SPH, smoothed particle hydrodynamics,"SPH User Guide"_PDF/SPH_LAMMPS_userguide.pdf, USER/sph, -
"USER-TALLY"_#USER-TALLY, pairwise tally computes,"compute XXX/tally"_compute_tally.html, USER/tally, -
"USER-VTK"_#USER-VTK, dump output via VTK, "compute vtk"_dump_vtk.html, -, ext
:tb(ea=c,ca1=l)
"USER-VTK"_#USER-VTK, dump output via VTK, "compute vtk"_dump_vtk.html, -, ext :tb(ea=c,ca1=l)
:line
:line
@ -364,9 +375,12 @@ GPU package :link(GPU),h4
[Contents:]
Dozens of pair styles and a version of the PPPM long-range Coulombic
solver optimized for NVIDIA GPUs. All such styles have a "gpu" as a
suffix in their style name. "Section 5.3.1"_accelerate_gpu.html gives
details of what hardware and Cuda software is required on your system,
solver optimized for GPUs. All such styles have a "gpu" as a
suffix in their style name. The GPU code can be compiled with either
CUDA or OpenCL, however the OpenCL variants are no longer actively
maintained and only the CUDA versions are regularly tested.
"Section 5.3.1"_accelerate_gpu.html gives details of what
hardware and GPU software is required on your system,
and details on how to build and use this package. Its styles can be
invoked at run time via the "-sf gpu" or "-suffix gpu" "command-line
switches"_Section_start.html#start_6. See also the "KOKKOS"_#KOKKOS
@ -378,32 +392,41 @@ package, which has GPU-enabled styles.
[Install or un-install:]
Before building LAMMPS with this package, you must first build the GPU
library in lib/gpu from a set of provided C and Cuda files. You can
library in lib/gpu from a set of provided C and CUDA files. You can
do this manually if you prefer; follow the instructions in
lib/gpu/README. You can also do it in one step from the lammps/src
lib/gpu/README. Please note, that the GPU library uses MPI calls, so
you have to make certain to use the same MPI library (or the STUBS
library) settings as the main LAMMPS code. That same applies to the
-DLAMMPS_BIGBIG, -DLAMMPS_SMALLBIG, or -DLAMMPS_SMALLSMALL define.
You can also do it in one step from the lammps/src
dir, using a command like these, which simply invoke the
lib/gpu/Install.py script with the specified args:
make lib-gpu # print help message
make lib-gpu args="-m" # build GPU library with default Makefile.linux
make lib-gpu args="-i xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
make lib-gpu args="-i xk7 -p single -o xk7.single -m" # ditto, also build GPU library
make lib-gpu # print help message
make lib-gpu args="-b" # build GPU library with default Makefile.linux
make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
make lib-gpu args="-m mpi -p mixed -b" # build GPU library with mixed precision using settings in Makefile.mpi :pre
Note that this procedure starts with one of the existing
Makefile.machine files in lib/gpu. It allows you to alter 4 important
settings in that Makefile, via the -h, -a, -p, -e switches,
and save the new Makefile, if desired:
Note that this procedure through the '-m machine' flag starts with one of
the existing Makefile.machine files in lib/gpu. For your convenience,
machine makefiles for "mpi" and "serial" are provided, which have the
same settings as the corresponding machine makefiles in the main LAMMPS
source folder. In addition you can alter 4 important settings in that
Makefile, via the -h, -a, -p, -e switches, and also save a copy of the
new Makefile, if desired:
CUDA_HOME = where NVIDIA Cuda software is installed on your system
CUDA_HOME = where NVIDIA CUDA software is installed on your system
CUDA_ARCH = what GPU hardware you have (see help message for details)
CUDA_PRECISION = precision (double, mixed, single)
EXTRAMAKE = which Makefile.lammps.* file to copy to Makefile.lammps :ul
If the library build is successful, 2 files should be created:
lib/gpu/libgpu.a and lib/gpu/Makefile.lammps. The latter has settings
that enable LAMMPS to link with Cuda libraries. If the settings in
Makefile.lammps for your machine are not correct, the LAMMPS build
will fail.
If the library build is successful, at least 3 files should be created:
lib/gpu/libgpu.a, lib/gpu/nvc_get_devices, and lib/gpu/Makefile.lammps.
The latter has settings that enable LAMMPS to link with CUDA libraries.
If the settings in Makefile.lammps for your machine are not correct,
the LAMMPS build will fail, and lib/gpu/Makefile.lammps may need to
be edited.
You can then install/un-install the package and build LAMMPS in the
usual manner:
@ -499,11 +522,13 @@ in lib/kim/README. You can also do it in one step from the lammps/src
dir, using a command like these, which simply invoke the
lib/kim/Install.py script with the specified args.
make lib-kim # print help message
make lib-kim args="-b . none" # install KIM API lib with only example models
make lib-kim args="-b . Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
make lib-kim args="-b . OpenKIM" # install KIM API lib with all models
make lib-kim args="-a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver :pre
make lib-kim # print help message
make lib-kim args="-b " # (re-)install KIM API lib with only example models
make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
make lib-kim args="-b -a everything" # install KIM API lib with all models
make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver
make lib-kim args="-p /usr/local/kim-api" # use an existing KIM API installation at the provided location
make lib-kim args="-p /usr/local/kim-api -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver :pre
Note that in LAMMPS lingo, a KIM model driver is a pair style
(e.g. EAM or Tersoff). A KIM model is a pair style for a particular
@ -547,7 +572,7 @@ KOKKOS package :link(KOKKOS),h4
Dozens of atom, pair, bond, angle, dihedral, improper, fix, compute
styles adapted to compile using the Kokkos library which can convert
them to OpenMP or Cuda code so that they run efficiently on multicore
them to OpenMP or CUDA code so that they run efficiently on multicore
CPUs, KNLs, or GPUs. All the styles have a "kk" as a suffix in their
style name. "Section 5.3.3"_accelerate_kokkos.html gives details of
what hardware and software is required on your system, and how to
@ -577,28 +602,28 @@ files for examples.
For multicore CPUs using OpenMP:
KOKKOS_DEVICES = OpenMP
KOKKOS_ARCH = HSW # HSW = Haswell, SNB = SandyBridge, BDW = Broadwell, etc
KOKKOS_ARCH = HSW # HSW = Haswell, SNB = SandyBridge, BDW = Broadwell, etc :pre
For Intel KNLs using OpenMP:
KOKKOS_DEVICES = OpenMP
KOKKOS_ARCH = KNL
KOKKOS_ARCH = KNL :pre
For NVIDIA GPUs using Cuda:
For NVIDIA GPUs using CUDA:
KOKKOS_DEVICES = Cuda
KOKKOS_ARCH = Pascal60,Power8 # P100 hosted by an IBM Power8, etc
KOKKOS_ARCH = Kepler37,Power8 # K80 hosted by an IBM Power8, etc
KOKKOS_ARCH = Kepler37,Power8 # K80 hosted by an IBM Power8, etc :pre
For GPUs, you also need these 2 lines in your Makefile.machine before
the CC line is defined, in this case for use with OpenMPI mpicxx. The
2 lines define a nvcc wrapper compiler, which will use nvcc for
compiling Cuda files or use a C++ compiler for non-Kokkos, non-Cuda
compiling CUDA files or use a C++ compiler for non-Kokkos, non-CUDA
files.
KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd)
export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper
CC = mpicxx
CC = mpicxx :pre
Once you have an appropriate Makefile.machine, you can
install/un-install the package and build LAMMPS in the usual manner.
@ -734,6 +759,12 @@ MEAM package :link(MEAM),h4
A pair style for the modified embedded atom (MEAM) potential.
Please note that the MEAM package has been superseded by the
"USER-MEAMC"_#USER-MEAMC package, which is a direct translation
of the MEAM package to C++. USER-MEAMC contains additional
optimizations making it run faster than MEAM on most machines,
while providing the identical features and USER interface.
[Author:] Greg Wagner (Northwestern U) while at Sandia.
[Install or un-install:]
@ -744,9 +775,10 @@ follow the instructions in lib/meam/README. You can also do it in one
step from the lammps/src dir, using a command like these, which simply
invoke the lib/meam/Install.py script with the specified args:
make lib-meam # print help message
make lib-meam args="-m gfortran" # build with GNU Fortran compiler
make lib-meam args="-m ifort" # build with Intel ifort compiler :pre
make lib-meam # print help message
make lib-meam args="-m mpi" # build with default Fortran compiler compatible with your MPI library
make lib-meam args="-m serial" # build with compiler compatible with "make serial" (GNU Fortran)
make lib-meam args="-m ifort" # build with Intel Fortran compiler using Makefile.ifort :pre
The build should produce two files: lib/meam/libmeam.a and
lib/meam/Makefile.lammps. The latter is copied from an existing
@ -789,6 +821,9 @@ A variety of compute, fix, pair, dump styles with specialized
capabilities that don't align with other packages. Do a directory
listing, "ls src/MISC", to see the list of commands.
NOTE: the MISC package contains styles that require using the
-restrict flag, when compiling with Intel compilers.
[Install or un-install:]
make yes-misc
@ -902,9 +937,9 @@ University of Chicago.
Before building LAMMPS with this package, you must first download and
build the MS-CG library. Building the MS-CG library and using it from
LAMMPS requires a C++11 compatible compiler, and that LAPACK and GSL
(GNU Scientific Library) libraries be installed on your machine. See
the lib/mscg/README and MSCG/Install files for more details.
LAMMPS requires a C++11 compatible compiler and that the GSL
(GNU Scientific Library) headers and libraries are installed on your
machine. See the lib/mscg/README and MSCG/Install files for more details.
Assuming these libraries are in place, you can do the download and
build of MS-CG manually if you prefer; follow the instructions in
@ -912,15 +947,16 @@ lib/mscg/README. You can also do it in one step from the lammps/src
dir, using a command like these, which simply invoke the
lib/mscg/Install.py script with the specified args:
make lib-mscg # print help message
make lib-mscg args="-g -b -l" # download and build in default lib/mscg/MSCG-release-master
make lib-mscg args="-h . MSCG -g -b -l" # download and build in lib/mscg/MSCG
make lib-mscg args="-h ~ MSCG -g -b -l" # download and build in ~/mscg :pre
make lib-mscg # print help message
make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master
# with the settings compatible with "make serial"
make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master
# with the settings compatible with "make mpi"
make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release :pre
Note that the final -l switch is to create 2 symbolic (soft) links,
"includelink" and "liblink", in lib/mscg to point to the MS-CG src
dir. When LAMMPS builds it will use these links. You should not need
to edit the lib/mscg/Makefile.lammps file.
Note that 2 symbolic (soft) links, "includelink" and "liblink", will be created in lib/mscg
to point to the MS-CG src/installation dir. When LAMMPS is built in src it will use these links.
You should not need to edit the lib/mscg/Makefile.lammps file.
You can then install/un-install the package and build LAMMPS in the
usual manner:
@ -966,11 +1002,11 @@ make no-opt
make machine :pre
NOTE: The compile flag "-restrict" must be used to build LAMMPS with
the OPT package. It should be added to the CCFLAGS line of your
Makefile.machine. See Makefile.opt in src/MAKE/OPTIONS for an
example.
the OPT package when using Intel compilers. It should be added to
the CCFLAGS line of your Makefile.machine. See Makefile.opt in
src/MAKE/OPTIONS for an example.
CCFLAGS: add -restrict :ul
CCFLAGS: add -restrict for Intel compilers :ul
[Supporting info:]
@ -1039,9 +1075,10 @@ follow the instructions in lib/poems/README. You can also do it in
one step from the lammps/src dir, using a command like these, which
simply invoke the lib/poems/Install.py script with the specified args:
make lib-poems # print help message
make lib-poems args="-m g++" # build with GNU g++ compiler
make lib-poems args="-m icc" # build with Intel icc compiler :pre
make lib-poems # print help message
make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi")
make lib-poems args="-m icc" # build with Intel icc compiler :pre
The build should produce two files: lib/poems/libpoems.a and
lib/poems/Makefile.lammps. The latter is copied from an existing
@ -1151,9 +1188,10 @@ follow the instructions in lib/reax/README. You can also do it in one
step from the lammps/src dir, using a command like these, which simply
invoke the lib/reax/Install.py script with the specified args:
make lib-reax # print help message
make lib-reax args="-m gfortran" # build with GNU Fortran compiler
make lib-reax args="-m ifort" # build with Intel ifort compiler :pre
make lib-reax # print help message
make lib-reax args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
make lib-reax args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
make lib-reax args="-m ifort" # build with Intel ifort compiler :pre
The build should produce two files: lib/reax/libreax.a and
lib/reax/Makefile.lammps. The latter is copied from an existing
@ -1370,15 +1408,15 @@ one step from the lammps/src dir, using a command like these, which
simply invoke the lib/voronoi/Install.py script with the specified
args:
make lib-voronoi # print help message
make lib-voronoi args="-g -b -l" # download and build in default lib/voronoi/voro++-0.4.6
make lib-voronoi args="-h . voro++ -g -b -l" # download and build in lib/voronoi/voro++
make lib-voronoi args="-h ~ voro++ -g -b -l" # download and build in ~/voro++ :pre
make lib-voronoi # print help message
make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++-<version>
make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++
make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6 :pre
Note that the final -l switch is to create 2 symbolic (soft) links,
"includelink" and "liblink", in lib/voronoi to point to the Voro++ src
dir. When LAMMPS builds it will use these links. You should not need
to edit the lib/voronoi/Makefile.lammps file.
Note that 2 symbolic (soft) links, "includelink" and "liblink", are
created in lib/voronoi to point to the Voro++ src dir. When LAMMPS
builds in src it will use these links. You should not need to edit
the lib/voronoi/Makefile.lammps file.
You can then install/un-install the package and build LAMMPS in the
usual manner:
@ -1420,7 +1458,8 @@ from the lammps/src dir, using a command like these, which simply
invoke the lib/atc/Install.py script with the specified args:
make lib-atc # print help message
make lib-atc args="-m g++" # build with GNU g++ compiler
make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-atc args="-m icc" # build with Intel icc compiler :pre
The build should produce two files: lib/atc/libatc.a and
@ -1437,8 +1476,10 @@ can either exist on your system, or you can use the files provided in
lib/linalg. In the latter case you also need to build the library
in lib/linalg with a command like these:
make lib-linalg # print help message
make lib-atc args="-m gfortran" # build with GNU Fortran compiler
make lib-linalg # print help message
make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
make lib-linalg args="-m gfortran" # build with GNU Fortran compiler :pre
You can then install/un-install the package and build LAMMPS in the
usual manner:
@ -1478,9 +1519,10 @@ follow the instructions in lib/awpmd/README. You can also do it in
one step from the lammps/src dir, using a command like these, which
simply invoke the lib/awpmd/Install.py script with the specified args:
make lib-awpmd # print help message
make lib-awpmd args="-m g++" # build with GNU g++ compiler
make lib-awpmd args="-m icc" # build with Intel icc compiler :pre
make lib-awpmd # print help message
make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial")
make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-awpmd args="-m icc" # build with Intel icc compiler :pre
The build should produce two files: lib/awpmd/libawpmd.a and
lib/awpmd/Makefile.lammps. The latter is copied from an existing
@ -1496,8 +1538,10 @@ these can either exist on your system, or you can use the files
provided in lib/linalg. In the latter case you also need to build the
library in lib/linalg with a command like these:
make lib-linalg # print help message
make lib-atc args="-m gfortran" # build with GNU Fortran compiler
make lib-linalg # print help message
make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial")
make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi")
make lib-linalg args="-m gfortran" # build with GNU Fortran compiler :pre
You can then install/un-install the package and build LAMMPS in the
usual manner:
@ -1590,9 +1634,11 @@ Restraints. A "fix colvars"_fix_colvars.html command is implemented
which wraps a COLVARS library, which implements these methods.
simulations.
[Authors:] Axel Kohlmeyer (Temple U). The COLVARS library was written
by Giacomo Fiorin (ICMS, Temple University, Philadelphia, PA, USA) and
Jerome Henin (LISM, CNRS, Marseille, France).
[Authors:] The COLVARS library is written and maintained by
Giacomo Fiorin (ICMS, Temple University, Philadelphia, PA, USA)
and Jerome Henin (LISM, CNRS, Marseille, France), originally for
the NAMD MD code, but with portability in mind. Axel Kohlmeyer
(Temple U) provided the interface to LAMMPS.
[Install or un-install:]
@ -1604,7 +1650,9 @@ which simply invoke the lib/colvars/Install.py script with the
specified args:
make lib-colvars # print help message
make lib-colvars args="-m g++" # build with GNU g++ compiler :pre
make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial")
make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi")
make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled :pre
The build should produce two files: lib/colvars/libcolvars.a and
lib/colvars/Makefile.lammps. The latter is copied from an existing
@ -1892,7 +1940,12 @@ Also see the "KOKKOS"_#KOKKOS, "OPT"_#OPT, and "USER-OMP"_#USER-OMP
packages, which have styles optimized for CPUs and KNLs.
You need to have an Intel compiler, version 14 or higher to take full
advantage of this package.
advantage of this package. While compilation with GNU compilers is
supported, performance will be suboptimal.
NOTE: the USER-INTEL package contains styles that require using the
-restrict flag, when compiling with Intel compilers.
[Author:] Mike Brown (Intel).
@ -1909,17 +1962,17 @@ For CPUs:
OPTFLAGS = -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits
CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload \
-fno-alias -ansi-alias -restrict $(OPTFLAGS)
-fno-alias -ansi-alias -restrict $(OPTFLAGS)
LINKFLAGS = -g -qopenmp $(OPTFLAGS)
LIB = -ltbbmalloc -ltbbmalloc_proxy
LIB = -ltbbmalloc -ltbbmalloc_proxy :pre
For KNLs:
OPTFLAGS = -xMIC-AVX512 -O2 -fp-model fast=2 -no-prec-div -qoverride-limits
CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload \
-fno-alias -ansi-alias -restrict $(OPTFLAGS)
-fno-alias -ansi-alias -restrict $(OPTFLAGS)
LINKFLAGS = -g -qopenmp $(OPTFLAGS)
LIB = -ltbbmalloc
LIB = -ltbbmalloc :pre
Once you have an appropriate Makefile.machine, you can
install/un-install the package and build LAMMPS in the usual manner.
@ -2224,11 +2277,15 @@ CPUs.
[Author:] Axel Kohlmeyer (Temple U).
NOTE: The compile flags "-restrict" and "-fopenmp" must be used to
build LAMMPS with the USER-OMP package, as well as the link flag
"-fopenmp". They should be added to the CCFLAGS and LINKFLAGS lines
of your Makefile.machine. See src/MAKE/OPTIONS/Makefile.omp for an
example.
NOTE: To enable multi-threading support the compile flag "-fopenmp"
and the link flag "-fopenmp" (for GNU compilers, you have to look up
the equivalent flags for other compilers) must be used to build LAMMPS.
When using Intel compilers, also the "-restrict" flag is required.
The USER-OMP package can be compiled without enabling OpenMP; then
all code will be compiled as serial and the only improvement over the
regular styles are some data access optimization. These flags should
be added to the CCFLAGS and LINKFLAGS lines of your Makefile.machine.
See src/MAKE/OPTIONS/Makefile.omp for an example.
Once you have an appropriate Makefile.machine, you can
install/un-install the package and build LAMMPS in the usual manner:
@ -2241,7 +2298,7 @@ make machine :pre
make no-user-omp
make machine :pre
CCFLAGS: add -fopenmp and -restrict
CCFLAGS: add -fopenmp (and -restrict when using Intel compilers)
LINKFLAGS: add -fopenmp :ul
[Supporting info:]
@ -2310,12 +2367,14 @@ without changes to LAMMPS itself.
Before building LAMMPS with this package, you must first build the
QMMM library in lib/qmmm. You can do this manually if you prefer;
follow the first two steps explained in lib/colvars/README. You can
follow the first two steps explained in lib/qmmm/README. You can
also do it in one step from the lammps/src dir, using a command like
these, which simply invoke the lib/colvars/Install.py script with the
these, which simply invoke the lib/qmmm/Install.py script with the
specified args:
make lib-qmmm # print help message
make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial")
make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi")
make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler :pre
The build should produce two files: lib/qmmm/libqmmm.a and
@ -2492,15 +2551,13 @@ follow the instructions in lib/smd/README. You can also do it in one
step from the lammps/src dir, using a command like these, which simply
invoke the lib/smd/Install.py script with the specified args:
make lib-smd # print help message
make lib-smd args="-g -l" # download in default lib/smd/eigen-eigen-*
make lib-smd args="-h . eigen -g -l" # download in lib/smd/eigen
make lib-smd args="-h ~ eigen -g -l" # download and build in ~/eigen :pre
make lib-smd # print help message
make lib-smd args="-b" # download and build in default lib/smd/eigen-eigen-...
make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3 :pre
Note that the final -l switch is to create a symbolic (soft) link
named "includelink" in lib/smd to point to the Eigen dir. When LAMMPS
builds it will use this link. You should not need to edit the
lib/smd/Makefile.lammps file.
Note that a symbolic (soft) link named "includelink" is created in
lib/smd to point to the Eigen dir. When LAMMPS builds it will use
this link. You should not need to edit the lib/smd/Makefile.lammps file.
You can then install/un-install the package and build LAMMPS in the
usual manner:

View File

@ -587,8 +587,7 @@ Typing "make clean-all" or "make clean-machine" will delete *.o object
files created when LAMMPS is built, for either all builds or for a
particular machine.
Changing the LAMMPS size limits via -DLAMMPS_SMALLBIG or
-DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL :h6
Changing the LAMMPS size limits via -DLAMMPS_SMALLBIG or -DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL :h6
As explained above, any of these 3 settings can be specified on the
LMP_INC line in your low-level src/MAKE/Makefile.foo.
@ -659,7 +658,16 @@ utilities.
For Cygwin and the MinGW cross-compilers, suitable makefiles are
provided in src/MAKE/MACHINES. When using other compilers, like
Visual C++ or Intel compilers for Windows, you may have to implement
your own build system. Since none of the current LAMMPS core developers
your own build system. Due to differences between the Windows OS
and Windows system libraries to Unix-like environments like Linux
or MacOS, when compiling for Windows a few adjustments may be needed:
Do not set the -DLAMMPS_MEMALIGN define (see LMP_INC makefile variable)
Add -lwsock32 -lpsapi to the linker flags (see LIB makefile variable)
Try adding -static-libgcc or -static or both to the linker flags when your
LAMMPS executable complains about missing .dll files :ul
Since none of the current LAMMPS core developers
has significant experience building executables on Windows, we are
happy to distribute contributed instructions and modifications, but
we cannot provide support for those.
@ -909,7 +917,7 @@ src/MAKE/OPTIONS, which include the settings. Note that the
USER-INTEL and KOKKOS packages can use settings that build LAMMPS for
different hardware. The USER-INTEL package can be compiled for Intel
CPUs and KNLs; the KOKKOS package builds for CPUs (OpenMP), GPUs
(Cuda), and Intel KNLs.
(CUDA), and Intel KNLs.
Makefile.intel_cpu
Makefile.intel_phi

View File

@ -62,7 +62,7 @@ respectively to your input script.
[Required hardware/software:]
To use this package, you currently need to have an NVIDIA GPU and
install the NVIDIA Cuda software on your system:
install the NVIDIA CUDA software on your system:
Check if you have an NVIDIA GPU: cat /proc/driver/nvidia/gpus/0/information
Go to http://www.nvidia.com/object/cuda_get.html
@ -74,13 +74,8 @@ Run lammps/lib/gpu/nvc_get_devices (after building the GPU library, see below) t
This requires two steps (a,b): build the GPU library, then build
LAMMPS with the GPU package.
You can do both these steps in one line, using the src/Make.py script,
described in "Section 4"_Section_packages.html of the manual.
Type "Make.py -h" for help. If run from the src directory, this
command will create src/lmp_gpu using src/MAKE/Makefile.mpi as the
starting Makefile.machine:
Make.py -p gpu -gpu mode=single arch=31 -o gpu -a lib-gpu file mpi :pre
You can do both these steps in one line as described in
"Section 4"_Section_packages.html of the manual.
Or you can follow these two (a,b) steps:
@ -90,7 +85,7 @@ The GPU library is in lammps/lib/gpu. Select a Makefile.machine (in
lib/gpu) appropriate for your system. You should pay special
attention to 3 settings in this makefile.
CUDA_HOME = needs to be where NVIDIA Cuda software is installed on your system
CUDA_HOME = needs to be where NVIDIA CUDA software is installed on your system
CUDA_ARCH = needs to be appropriate to your GPUs
CUDA_PREC = precision (double, mixed, single) you desire :ul

View File

@ -225,11 +225,9 @@ source /opt/intel/parallel_studio_xe_2016.3.067/psxevars.sh
# or psxevars.csh for C-shell
make intel_cpu_intelmpi :pre
Alternatively, the build can be accomplished with the src/Make.py
script, described in "Section 4"_Section_packages.html of the
manual. Type "Make.py -h" for help. For an example:
Make.py -v -p intel omp -intel cpu -a file intel_cpu_intelmpi :pre
Alternatively this can be done as a single command with
suitable make command invocations. This is discussed in "Section
4"_Section_packages.html of the manual.
Note that if you build with support for a Phi coprocessor, the same
binary can be used on nodes with or without coprocessors installed.
@ -244,8 +242,7 @@ highly recommended for CCFLAGS and LINKFLAGS. LIB should include
is required for CCFLAGS and "-qoffload" is required for LINKFLAGS.
Other recommended CCFLAG options for best performance are
"-O2 -fno-alias -ansi-alias -qoverride-limits fp-model fast=2
-no-prec-div". The Make.py command will add all of these
automatically.
-no-prec-div".
NOTE: The vectorization and math capabilities can differ depending on
the CPU. For Intel compilers, the "-x" flag specifies the type of

View File

@ -60,8 +60,7 @@ More details follow.
use a C++11 compatible compiler
make yes-kokkos
make mpi KOKKOS_DEVICES=OpenMP # build with the KOKKOS package
make kokkos_omp # or Makefile.kokkos_omp already has variable set
Make.py -v -p kokkos -kokkos omp -o mpi -a file mpi # or one-line build via Make.py :pre
make kokkos_omp # or Makefile.kokkos_omp already has variable set :pre
mpirun -np 16 lmp_mpi -k on -sf kk -in in.lj # 1 node, 16 MPI tasks/node, no threads
mpirun -np 2 -ppn 1 lmp_mpi -k on t 16 -sf kk -in in.lj # 2 nodes, 1 MPI task/node, 16 threads/task
@ -82,8 +81,7 @@ use a C++11 compatible compiler
KOKKOS_DEVICES = Cuda, OpenMP
KOKKOS_ARCH = Kepler35
make yes-kokkos
make machine
Make.py -p kokkos -kokkos cuda arch=31 -o kokkos_cuda -a file kokkos_cuda :pre
make machine :pre
mpirun -np 1 lmp_cuda -k on t 6 -sf kk -in in.lj # one MPI task, 6 threads on CPU
mpirun -np 4 -ppn 1 lmp_cuda -k on t 6 -sf kk -in in.lj # ditto on 4 nodes :pre
@ -98,8 +96,7 @@ use a C++11 compatible compiler
KOKKOS_DEVICES = OpenMP
KOKKOS_ARCH = KNC
make yes-kokkos
make machine
Make.py -p kokkos -kokkos phi -o kokkos_phi -a file mpi :pre
make machine :pre
host=MIC, Intel Phi with 61 cores (240 threads/phi via 4x hardware threading):
mpirun -np 1 lmp_g++ -k on t 240 -sf kk -in in.lj # 1 MPI task on 1 Phi, 1*240 = 240
@ -116,7 +113,7 @@ To build with Kokkos support for CPUs, 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 build with Kokkos support for NVIDIA GPUs, NVIDIA Cuda software
To build with Kokkos support for NVIDIA GPUs, NVIDIA CUDA software
version 7.5 or later must be installed on your system. See the
discussion for the "GPU"_accelerate_gpu.html package for details of
how to check and do this.
@ -135,9 +132,9 @@ mode like the USER-INTEL package supports.
You must choose at build time whether to build for CPUs (OpenMP),
GPUs, or Phi.
You can do any of these in one line, using the src/Make.py script,
described in "Section 4"_Section_packages.html of the manual.
Type "Make.py -h" for help. If run from the src directory, these
You can do any of these in one line, using the suitable make command
line flags as described in "Section 4"_Section_packages.html of the
manual. If run from the src directory, these
commands will create src/lmp_kokkos_omp, lmp_kokkos_cuda, and
lmp_kokkos_phi. Note that the OMP and PHI options use
src/MAKE/Makefile.mpi as the starting Makefile.machine. The CUDA

View File

@ -23,8 +23,7 @@ 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
Make.py -v -p omp -o mpi -a file mpi # or one-line build via Make.py :pre
make omp # or Makefile.omp already has settings :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
@ -40,14 +39,11 @@ each MPI task running on a CPU.
The lines above illustrate how to include/build with the USER-OMP
package in two steps, using the "make" command. Or how to do it with
one command via the src/Make.py script, described in "Section
4"_Section_packages.html of the manual. Type "Make.py -h" for
help.
one command as described in "Section 4"_Section_packages.html of the manual.
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". The Make.py command will
add these automatically.
CCFLAGS setting must include "-restrict".
[Run with the USER-OMP package from the command line:]

View File

@ -21,8 +21,7 @@ Here is a quick overview of how to use the OPT package. More details
follow.
make yes-opt
make mpi # build with the OPT package
Make.py -v -p opt -o mpi -a file mpi # or one-line build via Make.py :pre
make mpi # build with the OPT package :pre
lmp_mpi -sf opt -in in.script # run in serial
mpirun -np 4 lmp_mpi -sf opt -in in.script # run in parallel :pre
@ -35,13 +34,10 @@ None.
The lines above illustrate how to build LAMMPS with the OPT package in
two steps, using the "make" command. Or how to do it with one command
via the src/Make.py script, described in "Section
4"_Section_packages.html of the manual. Type "Make.py -h" for
help.
as described in "Section 4"_Section_packages.html of the manual.
Note that if you use an Intel compiler to build with the OPT package,
the CCFLAGS setting in your Makefile.machine must include "-restrict".
The Make.py command will add this automatically.
[Run with the OPT package from the command line:]

View File

@ -217,7 +217,7 @@ This compute is part of the VORONOI package. It is only enabled if
LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
It also requiers you have a copy of the Voro++ library built and
It also requires you have a copy of the Voro++ library built and
installed on your system. See instructions on obtaining and
installing the Voro++ software in the src/VORONOI/README file.

View File

@ -75,7 +75,7 @@ equations, but is used in calculating the deviation from the Hugoniot.
The keyword {beta} is a scaling term that can be added to the MSST
ionic equations of motion to account for drift in the conserved
quantity during long timescale simulations, similar to a Berendson
thermostat. See "(Reed)"_#Reed and "(Goldman)"_#Goldman for more
thermostat. See "(Reed)"_#Reed and "(Goldman)"_#Goldman2 for more
details. The value of {beta} must be between 0.0 and 1.0 inclusive.
A value of 0.0 means no contribution, a value of 1.0 means a full
contribution.
@ -108,7 +108,7 @@ being driven by DFTB+, a density-functional tight-binding code. If the
keyword {dftb} is used with a value of {yes}, then the MSST equations
are altered to account for the electron entropy contribution to the
Hugonio relations and total energy. See "(Reed2)"_#Reed2 and
"(Goldman)"_#Goldman for details on this contribution. In this case,
"(Goldman)"_#Goldman2 for details on this contribution. In this case,
you must define a "fix external"_fix_external.html command in your
input script, which is used to callback to DFTB+ during the LAMMPS
timestepping. DFTB+ will communicate its info to LAMMPS via that fix.
@ -188,6 +188,6 @@ timestep.
:link(Reed2)
[(Reed2)] Reed, J. Phys. Chem. C, 116, 2205 (2012).
:link(Goldman)
:link(Goldman2)
[(Goldman)] Goldman, Srinivasan, Hamel, Fried, Gaus, and Elstner,
J. Phys. Chem. C, 117, 7885 (2013).

View File

@ -78,7 +78,7 @@ especially when the temperature of the initial state is below the
classical limit or there is a great change in the zero point energies
between the initial and final states. Theoretical post processing
quantum corrections of shock compressed water and methane have been
reported as much as 30% of the temperatures "(Goldman)"_#Goldman. A
reported as much as 30% of the temperatures "(Goldman)"_#Goldman1. A
self-consistent method that couples the shock to a quantum thermal
bath described by a colored noise Langevin thermostat has been
developed by Qi et al "(Qi)"_#Qi and applied to shocked methane. The
@ -212,7 +212,7 @@ T_init=300.0. e0, p0, and v0 are calculated on the first step.
:line
:link(Goldman)
:link(Goldman1)
[(Goldman)] Goldman, Reed and Fried, J. Chem. Phys. 131, 204103 (2009)
:link(Qi)

View File

@ -109,7 +109,8 @@ atoms in the specified group. This can be useful for models where a
large portion of the simulation is particles that do not interact with
other particles or with each other via pairwise interactions. The
group specified with this option must also be specified via the
"atom_modify first"_atom_modify.html command.
"atom_modify first"_atom_modify.html command. Note that specifying
"all" as the group-ID effectively turns off the {include} option.
The {exclude} option turns off pairwise interactions between certain
pairs of atoms, by not including them in the neighbor list. These are
@ -213,5 +214,5 @@ space.
[Default:]
The option defaults are delay = 10, every = 1, check = yes, once = no,
cluster = no, include = all, exclude = none, page = 100000, one =
2000, and binsize = 0.0.
cluster = no, include = all (same as no include option defined),
exclude = none, page = 100000, one = 2000, and binsize = 0.0.

View File

@ -27,13 +27,34 @@ pair_coeff * * Ar Ar :pre
[Description:]
This pair style is a wrapper on the "Knowledge Base for Interatomic
Models (KIM)"_https://openkim.org repository of interatomic potentials,
so that they can be used by LAMMPS scripts.
Models (OpenKIM)"_https://openkim.org repository of interatomic
potentials, so that they can be used by LAMMPS scripts.
In KIM lingo, a potential is a "model" and a model contains both the
analytic formulas that define the potential as well as the parameters
needed to run it for one or more materials, including coefficients and
cutoffs.
Note that in LAMMPS lingo, a KIM model driver is a pair style
(e.g. EAM or Tersoff). A KIM model is a pair style for a particular
element or alloy and set of parameters, e.g. EAM for Cu with a
specific EAM potential file.
See the current list of "KIM model
drivers"_https://openkim.org/kim-items/model-drivers/alphabetical.
See the current list of all "KIM
models"_https://openkim.org/kim-items/models/by-model-drivers
See the list of "example KIM models"_https://openkim.org/kim-api which
are included in the KIM library by default, in the "What is in the KIM
API source package?" section.
To use this pair style, you must first download and install the KIM
API library from the "OpenKIM website"_https://openkim.org. The "KIM
section of Section packages"_Section_packages.html#KIM has
instructions on how to do this with a simple make command, when
building LAMMPS.
See the examples/kim dir for an input script that uses a KIM model
(potential) for Lennard-Jones.
:line
The argument {virialmode} determines how the global virial is
calculated. If {KIMvirial} is specified, the KIM model performs the

View File

@ -50,7 +50,7 @@ Intel(R) Xeon Phi(TM) coprocessors. :l
KOKKOS = a collection of atom, pair, and fix styles optimized to run
using the Kokkos library on various kinds of hardware, including GPUs
via Cuda and many-core chips via OpenMP or threading. :l
via CUDA and many-core chips via OpenMP or threading. :l
USER-OMP = a collection of pair, bond, angle, dihedral, improper,
kspace, compute, and fix styles with support for OpenMP

View File

@ -0,0 +1,203 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
Using LAMMPS with Bash on Windows :h3
[written by Richard Berger]
:line
Starting with Windows 10 you can install Linux tools directly in Windows. This
allows you to compile LAMMPS following the same procedure as on a real Ubuntu
Linux installation. Software can be easily installed using the package manager
via apt-get and all files are accessible in both the Windows Explorer and your
Linux shell (bash). This avoids switching to a different operating system or
installing a virtual machine. Everything runs on Windows.
Installing Bash on Windows :h4
Prerequisites :h5
Windows 10 (64bit only)
Latest updates installed :ul
Enable developer mode :h5
You enable this feature by first opening Windows Settings and enabling
Developer mode. Go to the Windows settings and search for "developer". This
will allow you to install software which comes from outside of the Windows
Store. You might be prompted to reboot your compute. Please do so.
:image(JPG/bow_tutorial_01_small.png,JPG/bow_tutorial_01.png)
:image(JPG/bow_tutorial_02_small.png,JPG/bow_tutorial_02.png)
:image(JPG/bow_tutorial_03_small.png,JPG/bow_tutorial_03.png)
Install Windows Subsystem for Linux :h5
Next you must ensure that the Window Subsystem for Linux is installed. Again,
search for "enable windows features" in the Settings dialog. This opens a
dialog with a list of features you can install. Add a checkmark to Windows
Subsystem for Linux (Beta) and press OK.
:image(JPG/bow_tutorial_04_small.png,JPG/bow_tutorial_04.png)
:image(JPG/bow_tutorial_05.png,JPG/bow_tutorial_05.png)
Install Bash for Windows :h5
After installation completes, type "bash" in the Windows Start menu search.
Select the first found option. This will launch a command-line window which
will prompt you about installing Ubuntu on Windows. Confirm with "y" and press
enter. This will then download Ubuntu for Windows.
:image(JPG/bow_tutorial_06.png)
:image(JPG/bow_tutorial_07.png)
During installation, you will be asked for a new password. This will be used
for installing new software and running commands with sudo.
:image(JPG/bow_tutorial_08.png)
Type exit to close the command-line window.
Go to the Start menu and type "bash" again. This time you will see a "Bash on
Ubuntu on Windows" Icon. Start this program.
:image(JPG/bow_tutorial_09.png)
Congratulations, you have installed [Bash on Ubuntu on Windows].
:image(JPG/bow_tutorial_10.png)
:line
Compiling LAMMPS in Bash on Windows :h4
The installation of LAMMPS in this environment is identical to working inside
of a real Ubuntu Linux installation. At the time writing, it uses Ubuntu 16.04.
Installing prerequisite packages :h5
First upgrade all existing packages using
sudo apt update
sudo apt upgrade -y :pre
Next install the following packages, which include compilers and libraries
needed for various LAMMPS features:
sudo apt install -y build-essential ccache gfortran openmpi-bin libopenmpi-dev libfftw3-dev libjpeg-dev libpng12-dev python-dev python-virtualenv libblas-dev liblapack-dev libhdf5-serial-dev hdf5-tools :pre
Files in Ubuntu on Windows :h5
When you launch "Bash on Ubuntu on Windows" you will start out in your Linux
user home directory /home/[username]. You can access your Windows user directory
using the /mnt/c/Users/[username] folder.
Download LAMMPS :h5
Obtain a copy of the LAMMPS code and go into it using "cd"
Option 1: Downloading LAMMPS tarball using wget :h6
wget http://lammps.sandia.gov/tars/lammps-stable.tar.gz
tar xvzf lammps-stable.tar.gz
cd lammps-31Mar17 :pre
Option 2: Obtaining LAMMPS code from GitHub :h6
git clone https://github.com/lammps/lammps.git
cd lammps :pre
Compiling LAMMPS :h5
At this point you can compile LAMMPS like on Ubuntu Linux.
Compiling serial version :h6
cd src/
make -j 4 serial :pre
This will create an executable called lmp_serial in the src/ directory
Compiling MPI version :h6
cd src/
make -j 4 mpi :pre
This will create an executable called lmp_mpi in the src/ directory
:line
Finally, please note the absolute path of your src folder. You can get this using
pwd :pre
or
echo $PWD :pre
To run any examples you need the location of the executable. For now, let us
save this location in a temporary variable
LAMMPS_DIR=$PWD :pre
:line
Running an example script :h5
Once compiled you can execute some of the LAMMPS examples. Switch into the
examples/melt folder
cd ../examples/melt :pre
The full path of the serial executable is $LAMMPS_DIR/lmp_serial, while the mpi
version is $LAMMPS_DIR/lmp_mpi. You can run the melt example with either
version as follows:
$LAMMPS_DIR/lmp_serial -in in.melt :pre
or
mpirun -np 4 $LAMMPS_DIR/lmp_mpi -in in.melt :pre
Note the use of our variable $LAMMPS_DIR, which expands into the full path of
the LAMMPS src folder we saved earlier.
Adding your executable directory to your PATH :h6
You can avoid having to type the full path of your LAMMPS binary by adding its
parent folder to the PATH environment variable as follows:
export PATH=$LAMMPS_DIR:$PATH :pre
Input scripts can then be run like this:
lmp_serial -in in.melt :pre
or
mpirun -np 4 lmp_mpi -in in.melt :pre
However, this PATH variable will not persist if you close your bash window.
To persist this setting edit the $HOME/.bashrc file using your favorite editor
and add this line
export PATH=/full/path/to/your/lammps/src:$PATH :pre
[Example:]
For an executable lmp_serial with a full path
/home/richard/lammps/src/lmp_serial :pre
the PATH variable should be
export PATH=/home/richard/lammps/src:$PATH :pre
NOTE: This should give you a jump start when trying to run LAMMPS on Windows.
To become effective in this environment I encourage you to look into Linux
tutorials explaining Bash and Basic Unix commands (e.g., "Linux
Journey"_https://linuxjourney.com)

View File

@ -48,21 +48,17 @@ System-wide Installation :h3
Step 1: Building LAMMPS as a shared library :h4
To use LAMMPS inside of Python it has to be compiled as shared library. This
library is then loaded by the Python interface. In this example, we use the
Make.py utility to create a Makefile with C++ exceptions, PNG, JPEG and FFMPEG
output support enabled. Finally, we also enable the MOLECULE package and compile
using the generated {auto} Makefile.
library is then loaded by the Python interface. In this example we enable the
MOLECULE package and compile LAMMPS with C++ exceptions, PNG, JPEG and FFMPEG
output support enabled.
cd $LAMMPS_DIR/src :pre
# generate custom Makefile
python Make.py -jpg -png -s ffmpeg exceptions -m mpi -a file :pre
# add packages if necessary
make yes-MOLECULE :pre
# compile shared library using Makefile
make mode=shlib auto :pre
make mpi mode=shlib LMP_INC="-DLAMMPS_PNG -DLAMMPS_JPEG -DLAMMPS_FFMPEG -DLAMMPS_EXCEPTIONS" JPG_LIB="-lpng -ljpeg" :pre
Step 2: Installing the LAMMPS Python package :h4

1
doc/src/tutorials.txt Normal file → Executable file
View File

@ -8,6 +8,7 @@ Tutorials :h1
tutorial_drude
tutorial_github
tutorial_pylammps
tutorial_bash_on_windows
body
manifolds

View File

@ -58,7 +58,7 @@ These are the sample problems and their output in the various
sub-directories:
accelerate: use of all the various accelerator packages
airebo: example for using AIREBO and AIREBO-M
airebo: polyethylene with AIREBO potential
balance: dynamic load balancing, 2d system
body: body particles, 2d system
cmap: CMAP 5-body contributions to CHARMM force field

View File

@ -17,6 +17,6 @@ fix 1 all nve
thermo 10
timestep 0.001
dump 1 all custom 10 dump.gap id fx fy fz
#dump 1 all custom 10 dump.gap id fx fy fz
run 40

View File

@ -1,7 +1,6 @@
units metal
atom_style full
boundary p p p
processors 1 1 1
timestep 0.0001 # 0.1 fs
read_data methane-box-8.data
@ -28,7 +27,7 @@ pair_modify pair lj/cut special lj/coul 0.0 0.0 0.0
# Intramolecular
# Tell QUIP to pretend this is silane (which is covered by the parameter file)
pair_coeff * * quip ip.parms.SW.xml "IP SW" 14 1
pair_coeff * * quip sw_example.xml "IP SW" 14 1
bond_style none
angle_style none

View File

@ -10,6 +10,7 @@ read_data data_sw
pair_style quip
pair_coeff * * sw_example.xml "IP SW" 14
velocity all create 10.0 355311
neighbor 0.3 bin
neigh_modify delay 10
@ -17,6 +18,6 @@ fix 1 all nve
thermo 10
timestep 0.001
dump 1 all custom 10 dump.sw id fx fy fz
#dump 1 all custom 10 dump.sw id fx fy fz
run 1
run 100

View File

@ -0,0 +1,76 @@
LAMMPS (24 Jul 2017)
using 1 OpenMP thread(s) per MPI task
# Test of GAP potential for Si system
units metal
boundary p p p
atom_style atomic
read_data data_gap
orthogonal box = (0 0 0) to (10.9685 10.9685 10.9685)
1 by 1 by 1 MPI processor grid
reading atoms ...
64 atoms
pair_style quip
pair_coeff * * gap_example.xml "Potential xml_label=GAP_2015_2_20_0_10_54_35_765" 14
neighbor 0.3 bin
neigh_modify delay 10
fix 1 all nve
thermo 10
timestep 0.001
#dump 1 all custom 10 dump.gap id fx fy fz
run 40
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.3
ghost atom cutoff = 4.3
binsize = 2.15, bins = 6 6 6
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair quip, perpetual
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 2.689 | 2.689 | 2.689 Mbytes
Step Temp E_pair E_mol TotEng Press
0 0 -10412.677 0 -10412.677 -107490.01
10 173.98393 -10414.096 0 -10412.679 -91270.969
20 417.38493 -10416.08 0 -10412.681 -42816.133
30 434.34789 -10416.217 0 -10412.68 2459.83
40 423.05899 -10416.124 0 -10412.679 22936.209
Loop time of 1.83555 on 1 procs for 40 steps with 64 atoms
Performance: 1.883 ns/day, 12.747 hours/ns, 21.792 timesteps/s
98.1% CPU use with 1 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 1.8349 | 1.8349 | 1.8349 | 0.0 | 99.96
Neigh | 0.00022817 | 0.00022817 | 0.00022817 | 0.0 | 0.01
Comm | 0.00013709 | 0.00013709 | 0.00013709 | 0.0 | 0.01
Output | 9.8228e-05 | 9.8228e-05 | 9.8228e-05 | 0.0 | 0.01
Modify | 8.6308e-05 | 8.6308e-05 | 8.6308e-05 | 0.0 | 0.00
Other | | 0.0001223 | | | 0.01
Nlocal: 64 ave 64 max 64 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 303 ave 303 max 303 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 1080 ave 1080 max 1080 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 1080
Ave neighs/atom = 16.875
Neighbor list builds = 2
Dangerous builds = 0
Total wall time: 0:00:01

View File

@ -0,0 +1,76 @@
LAMMPS (24 Jul 2017)
using 1 OpenMP thread(s) per MPI task
# Test of GAP potential for Si system
units metal
boundary p p p
atom_style atomic
read_data data_gap
orthogonal box = (0 0 0) to (10.9685 10.9685 10.9685)
1 by 2 by 2 MPI processor grid
reading atoms ...
64 atoms
pair_style quip
pair_coeff * * gap_example.xml "Potential xml_label=GAP_2015_2_20_0_10_54_35_765" 14
neighbor 0.3 bin
neigh_modify delay 10
fix 1 all nve
thermo 10
timestep 0.001
#dump 1 all custom 10 dump.gap id fx fy fz
run 40
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.3
ghost atom cutoff = 4.3
binsize = 2.15, bins = 6 6 6
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair quip, perpetual
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 2.685 | 2.779 | 3.06 Mbytes
Step Temp E_pair E_mol TotEng Press
0 0 -10412.677 0 -10412.677 -107490.01
10 173.98393 -10414.096 0 -10412.679 -91270.969
20 417.38493 -10416.08 0 -10412.681 -42816.133
30 434.34789 -10416.217 0 -10412.68 2459.83
40 423.05899 -10416.124 0 -10412.679 22936.209
Loop time of 0.837345 on 4 procs for 40 steps with 64 atoms
Performance: 4.127 ns/day, 5.815 hours/ns, 47.770 timesteps/s
96.0% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.73144 | 0.79214 | 0.83586 | 4.3 | 94.60
Neigh | 5.7936e-05 | 6.5327e-05 | 7.1049e-05 | 0.0 | 0.01
Comm | 0.00085807 | 0.044631 | 0.10532 | 18.0 | 5.33
Output | 0.00013208 | 0.00013494 | 0.00013733 | 0.0 | 0.02
Modify | 6.0558e-05 | 7.8678e-05 | 9.5129e-05 | 0.0 | 0.01
Other | | 0.0002971 | | | 0.04
Nlocal: 16 ave 18 max 14 min
Histogram: 1 0 1 0 0 0 0 1 0 1
Nghost: 174 ave 182 max 167 min
Histogram: 1 0 0 0 2 0 0 0 0 1
Neighs: 0 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 270 ave 294 max 237 min
Histogram: 1 0 0 0 1 0 0 0 1 1
Total # of neighbors = 1080
Ave neighs/atom = 16.875
Neighbor list builds = 2
Dangerous builds = 0
Total wall time: 0:00:00

View File

@ -0,0 +1,130 @@
LAMMPS (24 Jul 2017)
using 1 OpenMP thread(s) per MPI task
units metal
atom_style full
boundary p p p
timestep 0.0001 # 0.1 fs
read_data methane-box-8.data
orthogonal box = (-0.499095 -0.270629 0.131683) to (8.4109 8.63937 9.04168)
1 by 1 by 1 MPI processor grid
reading atoms ...
40 atoms
scanning bonds ...
4 = max bonds/atom
scanning angles ...
6 = max angles/atom
reading bonds ...
32 bonds
reading angles ...
48 angles
4 = max # of 1-2 neighbors
3 = max # of 1-3 neighbors
3 = max # of 1-4 neighbors
4 = max # of special neighbors
# DISCLAIMER: This potential mixes parameters from methane and silane
# potentials and is NOT intended to be a realistic representation of either
# system. It is meant to demonstrate the use of hybrid QUIP/LAMMPS potentials,
# including the use of separate 'special_bonds' settings.
pair_style hybrid/overlay lj/cut 8.0 quip
# exclusion setting for quip; cannot be exactly 1.0 1.0 1.0,
# since that would not flag 1-2, 1-3, and 1-4 pairs in lj/cut
special_bonds lj/coul 0.999999999 0.999999999 0.999999999
4 = max # of 1-2 neighbors
3 = max # of 1-3 neighbors
3 = max # of 1-4 neighbors
4 = max # of special neighbors
# Intermolecular: OPLS (JACS 118 (45), p. 11225 (1996))
# Coulomb interactions ommitted for simplicity
pair_coeff 1 1 lj/cut 0.0028619844 3.5 # CT
pair_coeff 2 2 lj/cut 0.0013009018 2.5 # HC
pair_coeff 1 2 lj/cut 0.0019295487 2.95
pair_modify shift no
# change exclusion settings for lj/cut only: exclude bonded pairs
pair_modify pair lj/cut special lj/coul 0.0 0.0 0.0
# Intramolecular
# Tell QUIP to pretend this is silane (which is covered by the parameter file)
pair_coeff * * quip sw_example.xml "IP SW" 14 1
bond_style none
angle_style none
fix 1 all nve
# Include diagnostics that allow us to compare to a pure QUIP run
compute equip all pair quip
compute evdw all pair lj/cut
compute vir all pressure NULL virial
thermo_style custom step epair ke etotal temp press c_vir c_evdw c_equip
thermo 1
# dump 1 all custom 1 dump.molecular id type x y z fx fy fz
# dump_modify 1 sort id
run 10
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 2 2 2
2 neighbor lists, perpetual/occasional/extra = 2 0 0
(1) pair lj/cut, perpetual, half/full from (2)
attributes: half, newton on
pair build: halffull/newton
stencil: none
bin: none
(2) pair quip, perpetual
attributes: full, newton on
pair build: full/bin
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 8.288 | 8.288 | 8.288 Mbytes
Step E_pair KinEng TotEng Temp Press c_vir c_evdw c_equip
0 -5.3530213 0 -5.3530213 0 518847.56 518847.56 -0.10904079 -5.2439805
1 -5.9384459 0.58384822 -5.3545977 115.81657 517370.5 516488.87 -0.10783656 -5.8306093
2 -7.669616 2.3104051 -5.3592109 458.30954 512986.36 509497.58 -0.10422283 -7.5653932
3 -10.473314 5.1069211 -5.3663924 1013.0477 505833.04 498121.43 -0.098049469 -10.375264
4 -14.234705 8.859182 -5.3755227 1757.3747 496127.44 482749.79 -0.089147485 -14.145557
5 -18.806851 13.420941 -5.3859098 2662.28 484148.76 463882.72 -0.077305196 -18.729546
6 -24.021727 18.625147 -5.3965797 3694.6259 470219.95 442095.39 -0.06194509 -23.959782
7 -29.702647 24.295529 -5.4071176 4819.446 454683.57 417996.56 -0.042859727 -29.659787
8 -35.67405 30.257258 -5.4167913 6002.0599 437887.03 392197.62 -0.019248651 -35.654801
9 -41.771047 36.345757 -5.4252893 7209.8209 420163.51 365280.27 0.0096063065 -41.780653
10 -47.845522 42.413161 -5.4323614 8413.3973 401821.91 337776.7 0.044743702 -47.890266
Loop time of 0.0537777 on 1 procs for 10 steps with 40 atoms
Performance: 1.607 ns/day, 14.938 hours/ns, 185.951 timesteps/s
90.3% CPU use with 1 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.053478 | 0.053478 | 0.053478 | 0.0 | 99.44
Bond | 1.9073e-06 | 1.9073e-06 | 1.9073e-06 | 0.0 | 0.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 7.7724e-05 | 7.7724e-05 | 7.7724e-05 | 0.0 | 0.14
Output | 0.00018263 | 0.00018263 | 0.00018263 | 0.0 | 0.34
Modify | 1.5974e-05 | 1.5974e-05 | 1.5974e-05 | 0.0 | 0.03
Other | | 2.122e-05 | | | 0.04
Nlocal: 40 ave 40 max 40 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 1175 ave 1175 max 1175 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 4768 ave 4768 max 4768 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 9536 ave 9536 max 9536 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 9536
Ave neighs/atom = 238.4
Ave special neighs/atom = 4
Neighbor list builds = 0
Dangerous builds = 0
Total wall time: 0:00:00

View File

@ -0,0 +1,130 @@
LAMMPS (24 Jul 2017)
using 1 OpenMP thread(s) per MPI task
units metal
atom_style full
boundary p p p
timestep 0.0001 # 0.1 fs
read_data methane-box-8.data
orthogonal box = (-0.499095 -0.270629 0.131683) to (8.4109 8.63937 9.04168)
1 by 2 by 2 MPI processor grid
reading atoms ...
40 atoms
scanning bonds ...
4 = max bonds/atom
scanning angles ...
6 = max angles/atom
reading bonds ...
32 bonds
reading angles ...
48 angles
4 = max # of 1-2 neighbors
3 = max # of 1-3 neighbors
3 = max # of 1-4 neighbors
4 = max # of special neighbors
# DISCLAIMER: This potential mixes parameters from methane and silane
# potentials and is NOT intended to be a realistic representation of either
# system. It is meant to demonstrate the use of hybrid QUIP/LAMMPS potentials,
# including the use of separate 'special_bonds' settings.
pair_style hybrid/overlay lj/cut 8.0 quip
# exclusion setting for quip; cannot be exactly 1.0 1.0 1.0,
# since that would not flag 1-2, 1-3, and 1-4 pairs in lj/cut
special_bonds lj/coul 0.999999999 0.999999999 0.999999999
4 = max # of 1-2 neighbors
3 = max # of 1-3 neighbors
3 = max # of 1-4 neighbors
4 = max # of special neighbors
# Intermolecular: OPLS (JACS 118 (45), p. 11225 (1996))
# Coulomb interactions ommitted for simplicity
pair_coeff 1 1 lj/cut 0.0028619844 3.5 # CT
pair_coeff 2 2 lj/cut 0.0013009018 2.5 # HC
pair_coeff 1 2 lj/cut 0.0019295487 2.95
pair_modify shift no
# change exclusion settings for lj/cut only: exclude bonded pairs
pair_modify pair lj/cut special lj/coul 0.0 0.0 0.0
# Intramolecular
# Tell QUIP to pretend this is silane (which is covered by the parameter file)
pair_coeff * * quip sw_example.xml "IP SW" 14 1
bond_style none
angle_style none
fix 1 all nve
# Include diagnostics that allow us to compare to a pure QUIP run
compute equip all pair quip
compute evdw all pair lj/cut
compute vir all pressure NULL virial
thermo_style custom step epair ke etotal temp press c_vir c_evdw c_equip
thermo 1
# dump 1 all custom 1 dump.molecular id type x y z fx fy fz
# dump_modify 1 sort id
run 10
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 2 2 2
2 neighbor lists, perpetual/occasional/extra = 2 0 0
(1) pair lj/cut, perpetual, half/full from (2)
attributes: half, newton on
pair build: halffull/newton
stencil: none
bin: none
(2) pair quip, perpetual
attributes: full, newton on
pair build: full/bin
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 8.26 | 8.386 | 8.762 Mbytes
Step E_pair KinEng TotEng Temp Press c_vir c_evdw c_equip
0 -5.3530213 0 -5.3530213 0 518847.56 518847.56 -0.10904079 -5.2439805
1 -5.9384459 0.58384822 -5.3545977 115.81657 517370.5 516488.87 -0.10783656 -5.8306093
2 -7.669616 2.3104051 -5.3592109 458.30954 512986.36 509497.58 -0.10422283 -7.5653932
3 -10.473314 5.1069211 -5.3663924 1013.0477 505833.04 498121.43 -0.098049469 -10.375264
4 -14.234705 8.859182 -5.3755227 1757.3747 496127.44 482749.79 -0.089147485 -14.145557
5 -18.806851 13.420941 -5.3859098 2662.28 484148.76 463882.72 -0.077305196 -18.729546
6 -24.021727 18.625147 -5.3965797 3694.6259 470219.95 442095.39 -0.06194509 -23.959782
7 -29.702647 24.295529 -5.4071176 4819.446 454683.57 417996.56 -0.042859727 -29.659787
8 -35.67405 30.257258 -5.4167913 6002.0599 437887.03 392197.62 -0.019248651 -35.654801
9 -41.771047 36.345757 -5.4252893 7209.8209 420163.51 365280.27 0.0096063065 -41.780653
10 -47.845522 42.413161 -5.4323614 8413.3973 401821.91 337776.7 0.044743702 -47.890266
Loop time of 0.0506847 on 4 procs for 10 steps with 40 atoms
Performance: 1.705 ns/day, 14.079 hours/ns, 197.298 timesteps/s
94.4% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.04216 | 0.045656 | 0.049349 | 1.2 | 90.08
Bond | 1.9073e-06 | 2.4438e-06 | 2.861e-06 | 0.0 | 0.00
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0.00068545 | 0.004438 | 0.0079191 | 3.9 | 8.76
Output | 0.00048304 | 0.00053334 | 0.00060964 | 0.0 | 1.05
Modify | 1.1444e-05 | 1.4424e-05 | 1.9312e-05 | 0.0 | 0.03
Other | | 4.047e-05 | | | 0.08
Nlocal: 10 ave 15 max 6 min
Histogram: 1 0 0 1 1 0 0 0 0 1
Nghost: 878 ave 948 max 812 min
Histogram: 1 0 1 0 0 0 1 0 0 1
Neighs: 1192 ave 1764 max 731 min
Histogram: 1 0 0 1 1 0 0 0 0 1
FullNghs: 2384 ave 3527 max 1439 min
Histogram: 1 0 0 1 1 0 0 0 0 1
Total # of neighbors = 9536
Ave neighs/atom = 238.4
Ave special neighs/atom = 4
Neighbor list builds = 0
Dangerous builds = 0
Total wall time: 0:00:00

View File

@ -0,0 +1,83 @@
LAMMPS (24 Jul 2017)
using 1 OpenMP thread(s) per MPI task
# Test of SW potential for Si system
units metal
boundary p p p
atom_style atomic
read_data data_sw
orthogonal box = (0 0 0) to (5.431 5.431 5.431)
1 by 1 by 1 MPI processor grid
reading atoms ...
8 atoms
pair_style quip
pair_coeff * * sw_example.xml "IP SW" 14
velocity all create 10.0 355311
neighbor 0.3 bin
neigh_modify delay 10
fix 1 all nve
thermo 10
timestep 0.001
#dump 1 all custom 10 dump.sw id fx fy fz
run 100
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.2258
ghost atom cutoff = 4.2258
binsize = 2.1129, bins = 3 3 3
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair quip, perpetual
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 2.684 | 2.684 | 2.684 Mbytes
Step Temp E_pair E_mol TotEng Press
0 10 -34.68 0 -34.670952 32.206289
10 4.5659178 -34.675073 0 -34.670942 46.253731
20 1.606683 -34.672391 0 -34.670937 44.736892
30 6.7007748 -34.677011 0 -34.670948 16.403049
40 5.682757 -34.676087 0 -34.670945 18.696408
50 2.2140716 -34.672942 0 -34.670939 37.592282
60 5.0475382 -34.675512 0 -34.670944 37.331666
70 7.0990979 -34.677369 0 -34.670946 40.533757
80 5.7306189 -34.676128 0 -34.670943 47.748813
90 5.0895648 -34.675549 0 -34.670944 38.092721
100 4.1070919 -34.674659 0 -34.670943 28.737864
Loop time of 0.384233 on 1 procs for 100 steps with 8 atoms
Performance: 22.486 ns/day, 1.067 hours/ns, 260.259 timesteps/s
94.6% CPU use with 1 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.38365 | 0.38365 | 0.38365 | 0.0 | 99.85
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0.00017333 | 0.00017333 | 0.00017333 | 0.0 | 0.05
Output | 0.00014162 | 0.00014162 | 0.00014162 | 0.0 | 0.04
Modify | 7.081e-05 | 7.081e-05 | 7.081e-05 | 0.0 | 0.02
Other | | 0.0001957 | | | 0.05
Nlocal: 8 ave 8 max 8 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 162 ave 162 max 162 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 128 ave 128 max 128 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 128
Ave neighs/atom = 16
Neighbor list builds = 0
Dangerous builds = 0
Total wall time: 0:00:00

View File

@ -0,0 +1,83 @@
LAMMPS (24 Jul 2017)
using 1 OpenMP thread(s) per MPI task
# Test of SW potential for Si system
units metal
boundary p p p
atom_style atomic
read_data data_sw
orthogonal box = (0 0 0) to (5.431 5.431 5.431)
1 by 2 by 2 MPI processor grid
reading atoms ...
8 atoms
pair_style quip
pair_coeff * * sw_example.xml "IP SW" 14
velocity all create 10.0 355311
neighbor 0.3 bin
neigh_modify delay 10
fix 1 all nve
thermo 10
timestep 0.001
#dump 1 all custom 10 dump.sw id fx fy fz
run 100
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 4.2258
ghost atom cutoff = 4.2258
binsize = 2.1129, bins = 3 3 3
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair quip, perpetual
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 2.698 | 2.698 | 2.698 Mbytes
Step Temp E_pair E_mol TotEng Press
0 10 -34.68 0 -34.670952 32.206289
10 4.5659178 -34.675073 0 -34.670942 46.253731
20 1.606683 -34.672391 0 -34.670937 44.736892
30 6.7007748 -34.677011 0 -34.670948 16.403049
40 5.682757 -34.676087 0 -34.670945 18.696408
50 2.2140716 -34.672942 0 -34.670939 37.592282
60 5.0475382 -34.675512 0 -34.670944 37.331666
70 7.0990979 -34.677369 0 -34.670946 40.533757
80 5.7306189 -34.676128 0 -34.670943 47.748813
90 5.0895648 -34.675549 0 -34.670944 38.092721
100 4.1070919 -34.674659 0 -34.670943 28.737864
Loop time of 0.423803 on 4 procs for 100 steps with 8 atoms
Performance: 20.387 ns/day, 1.177 hours/ns, 235.959 timesteps/s
90.6% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.39332 | 0.40011 | 0.40704 | 0.8 | 94.41
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0.015632 | 0.022605 | 0.029425 | 3.3 | 5.33
Output | 0.00025702 | 0.00028491 | 0.00035429 | 0.0 | 0.07
Modify | 7.3671e-05 | 8.1897e-05 | 8.9884e-05 | 0.0 | 0.02
Other | | 0.0007259 | | | 0.17
Nlocal: 2 ave 2 max 2 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Nghost: 113 ave 113 max 113 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Neighs: 0 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs: 32 ave 32 max 32 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Total # of neighbors = 128
Ave neighs/atom = 16
Neighbor list builds = 0
Dangerous builds = 0
Total wall time: 0:00:00

2
lib/.gitignore vendored
View File

@ -1 +1,3 @@
Makefile.lammps
.depend
Makefile.auto

View File

@ -4,24 +4,35 @@
# soft linked to by many of the lib/Install.py files
# used to automate the steps described in the corresponding lib/README
import sys,commands,os
from __future__ import print_function
import sys,os,subprocess
# help message
help = """
Syntax: python Install.py -m machine -e suffix
specify -m and optionally -e, order does not matter
Syntax from src dir: make lib-libname args="-m machine -e suffix"
Syntax from lib dir: python Install.py -m machine -e suffix
libname = name of lib dir (e.g. atc, h5md, meam, poems, etc)
specify -m and optionally -e, order does not matter
-m = peform a clean followed by "make -f Makefile.machine"
machine = suffix of a lib/Makefile.* file
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
does not alter existing Makefile.machine
Examples:
make lib-poems args="-m serial" # build POEMS lib with same settings as in the serial Makefile in src
make lib-colvars args="-m mpi" # build USER-COLVARS lib with same settings as in the mpi Makefile in src
make lib-meam args="-m ifort" # build MEAM lib with custom Makefile.ifort (using Intel Fortran)
"""
# print error message or help
def error(str=None):
if not str: print help
else: print "ERROR",str
if not str: print(help)
else: print("ERROR",str)
sys.exit()
# parse args
@ -38,12 +49,12 @@ while iarg < nargs:
if args[iarg] == "-m":
if iarg+2 > nargs: error()
machine = args[iarg+1]
iarg += 2
iarg += 2
elif args[iarg] == "-e":
if iarg+2 > nargs: error()
extraflag = 1
suffix = args[iarg+1]
iarg += 2
iarg += 2
else: error()
# set lib from working dir
@ -53,30 +64,38 @@ lib = os.path.basename(cwd)
# create Makefile.auto as copy of Makefile.machine
# reset EXTRAMAKE if requested
if not os.path.exists("Makefile.%s" % machine):
error("lib/%s/Makefile.%s does not exist" % (lib,machine))
lines = open("Makefile.%s" % machine,'r').readlines()
fp = open("Makefile.auto",'w')
has_extramake = False
for line in lines:
words = line.split()
if len(words) == 3 and extraflag and \
words[0] == "EXTRAMAKE" and words[1] == '=':
line = line.replace(words[2],"Makefile.lammps.%s" % suffix)
print >>fp,line,
if len(words) == 3 and words[0] == "EXTRAMAKE" and words[1] == '=':
has_extramake = True
if extraflag:
line = line.replace(words[2],"Makefile.lammps.%s" % suffix)
fp.write(line)
fp.close()
# make the library via Makefile.auto
# make the library via Makefile.auto optionally with parallel make
print "Building lib%s.a ..." % lib
cmd = "make -f Makefile.auto clean; make -f Makefile.auto"
txt = commands.getoutput(cmd)
print txt
try:
import multiprocessing
n_cpus = multiprocessing.cpu_count()
except:
n_cpus = 1
if os.path.exists("lib%s.a" % lib): print "Build was successful"
print("Building lib%s.a ..." % lib)
cmd = "make -f Makefile.auto clean; make -f Makefile.auto -j%d" % n_cpus
txt = subprocess.check_output(cmd,shell=True,stderr=subprocess.STDOUT)
print(txt.decode('UTF-8'))
if os.path.exists("lib%s.a" % lib): print("Build was successful")
else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))
if not os.path.exists("Makefile.lammps"):
print "lib/%s/Makefile.lammps was NOT created" % lib
if has_extramake and not os.path.exists("Makefile.lammps"):
print("lib/%s/Makefile.lammps was NOT created" % lib)

View File

@ -1 +1 @@
Install.py
../Install.py

View File

@ -1,3 +1,4 @@
# library build -*- makefile -*-
SHELL = /bin/sh
# which file will be copied to Makefile.lammps
@ -5,6 +6,7 @@ SHELL = /bin/sh
EXTRAMAKE = Makefile.lammps.installed
# ------ FILES ------
SRC = $(wildcard *.cpp)
INC = $(wildcard *.h)
@ -47,5 +49,9 @@ DEPENDS = $(OBJ:.o=.d)
# ------ CLEAN ------
.PHONY: clean lib
clean:
-rm *.o *.d *~ $(LIB)
sinclude $(DEPENDS)

View File

@ -1,67 +0,0 @@
# library build -*- makefile -*-
SHELL = /bin/sh
# which file will be copied to Makefile.lammps
EXTRAMAKE = Makefile.lammps.linalg
# ------ FILES ------
SRC = $(wildcard *.cpp)
INC = $(wildcard *.h)
# ------ DEFINITIONS ------
DIR = Obj_mingw32/
LIB = $(DIR)libatc.a
OBJ = $(SRC:%.cpp=$(DIR)%.o)
# ------ SETTINGS ------
# include any MPI settings needed for the ATC library to build with
# the same MPI library that LAMMPS is built with
CC = i686-w64-mingw32-g++
CCFLAGS = -I../../src -I../../src/STUBS -DMPICH_IGNORE_CXX_SEEK \
-O3 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \
-ffast-math -funroll-loops -fstrict-aliasing \
-DLAMMPS_SMALLSMALL -Wno-uninitialized
ARCHIVE = i686-w64-mingw32-ar
ARCHFLAG = -rcs
DEPFLAGS = -M
LINK = $(CC)
LINKFLAGS = -O
USRLIB =
SYSLIB =
# ------ MAKE PROCEDURE ------
default: $(DIR) $(LIB) Makefile.lammps
$(DIR):
mkdir $(DIR)
Makefile.lammps:
@cp $(EXTRAMAKE) Makefile.lammps
$(LIB): $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
@cp $(EXTRAMAKE) Makefile.lammps
# ------ COMPILE RULES ------
$(DIR)%.o:%.cpp
$(CC) $(CCFLAGS) -c $< -o $@
$(DIR)%.d:%.cpp
$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@
# ------ DEPENDENCIES ------
DEPENDS = $(OBJ:.o=.d)
# ------ CLEAN ------
clean:
-rm $(DIR)*.o $(DIR)*.d *~ $(LIB)
$(DEPENDS) : $(DIR)
sinclude $(DEPENDS)

View File

@ -1,68 +0,0 @@
# library build -*- makefile -*-
SHELL = /bin/sh
# which file will be copied to Makefile.lammps
EXTRAMAKE = Makefile.lammps.linalg
# ------ FILES ------
SRC = $(wildcard *.cpp)
INC = $(wildcard *.h)
# ------ DEFINITIONS ------
DIR = Obj_mingw32-mpi/
LIB = $(DIR)libatc.a
OBJ = $(SRC:%.cpp=$(DIR)%.o)
# ------ SETTINGS ------
# include any MPI settings needed for the ATC library to build with
# the same MPI library that LAMMPS is built with
CC = i686-w64-mingw32-g++
CCFLAGS = -I../../tools/mingw-cross/mpich2-win32/include/ \
-I../../src -DMPICH_IGNORE_CXX_SEEK \
-O3 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \
-ffast-math -funroll-loops -fstrict-aliasing \
-DLAMMPS_SMALLSMALL -Wno-uninitialized
ARCHIVE = i686-w64-mingw32-ar
ARCHFLAG = -rcs
DEPFLAGS = -M
LINK = $(CC)
LINKFLAGS = -O
USRLIB =
SYSLIB =
# ------ MAKE PROCEDURE ------
default: $(DIR) $(LIB) Makefile.lammps
$(DIR):
mkdir $(DIR)
Makefile.lammps:
@cp $(EXTRAMAKE) Makefile.lammps
$(LIB): $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
@cp $(EXTRAMAKE) Makefile.lammps
# ------ COMPILE RULES ------
$(DIR)%.o:%.cpp
$(CC) $(CCFLAGS) -c $< -o $@
$(DIR)%.d:%.cpp
$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@
# ------ DEPENDENCIES ------
DEPENDS = $(OBJ:.o=.d)
# ------ CLEAN ------
clean:
-rm $(DIR)*.o $(DIR)*.d *~ $(LIB)
$(DEPENDS) : $(DIR)
sinclude $(DEPENDS)

View File

@ -1,67 +0,0 @@
# library build -*- makefile -*-
SHELL = /bin/sh
# which file will be copied to Makefile.lammps
EXTRAMAKE = Makefile.lammps.linalg
# ------ FILES ------
SRC = $(wildcard *.cpp)
INC = $(wildcard *.h)
# ------ DEFINITIONS ------
DIR = Obj_mingw64/
LIB = $(DIR)libatc.a
OBJ = $(SRC:%.cpp=$(DIR)%.o)
# ------ SETTINGS ------
# include any MPI settings needed for the ATC library to build with
# the same MPI library that LAMMPS is built with
CC = x86_64-w64-mingw32-g++
CCFLAGS = -I../../src -I../../src/STUBS -DMPICH_IGNORE_CXX_SEEK \
-O3 -march=core2 -mtune=core2 -mpc64 -msse2 \
-ffast-math -funroll-loops -fstrict-aliasing \
-DLAMMPS_SMALLBIG -Wno-uninitialized
ARCHIVE = x86_64-w64-mingw32-ar
ARCHFLAG = -rcs
DEPFLAGS = -M
LINK = $(CC)
LINKFLAGS = -O
USRLIB =
SYSLIB =
# ------ MAKE PROCEDURE ------
default: $(DIR) $(LIB) Makefile.lammps
$(DIR):
mkdir $(DIR)
Makefile.lammps:
@cp $(EXTRAMAKE) Makefile.lammps
$(LIB): $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
@cp $(EXTRAMAKE) Makefile.lammps
# ------ COMPILE RULES ------
$(DIR)%.o:%.cpp
$(CC) $(CCFLAGS) -c $< -o $@
$(DIR)%.d:%.cpp
$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@
# ------ DEPENDENCIES ------
DEPENDS = $(OBJ:.o=.d)
# ------ CLEAN ------
clean:
-rm $(DIR)*.o $(DIR)*.d *~ $(LIB)
$(DEPENDS) : $(DIR)
sinclude $(DEPENDS)

View File

@ -1,68 +0,0 @@
# library build -*- makefile -*-
SHELL = /bin/sh
# which file will be copied to Makefile.lammps
EXTRAMAKE = Makefile.lammps.linalg
# ------ FILES ------
SRC = $(wildcard *.cpp)
INC = $(wildcard *.h)
# ------ DEFINITIONS ------
DIR = Obj_mingw64-mpi/
LIB = $(DIR)libatc.a
OBJ = $(SRC:%.cpp=$(DIR)%.o)
# ------ SETTINGS ------
# include any MPI settings needed for the ATC library to build with
# the same MPI library that LAMMPS is built with
CC = x86_64-w64-mingw32-g++
CCFLAGS = -I../../tools/mingw-cross/mpich2-win64/include/ \
-I../../src -DMPICH_IGNORE_CXX_SEEK \
-O3 -march=core2 -mtune=core2 -mpc64 -msse2 \
-ffast-math -funroll-loops -fstrict-aliasing \
-DLAMMPS_SMALLBIG -Wno-uninitialized
ARCHIVE = x86_64-w64-mingw32-ar
ARCHFLAG = -rcs
DEPFLAGS = -M
LINK = $(CC)
LINKFLAGS = -O
USRLIB =
SYSLIB =
# ------ MAKE PROCEDURE ------
default: $(DIR) $(LIB) Makefile.lammps
$(DIR):
mkdir $(DIR)
Makefile.lammps:
@cp $(EXTRAMAKE) Makefile.lammps
$(LIB): $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
@cp $(EXTRAMAKE) Makefile.lammps
# ------ COMPILE RULES ------
$(DIR)%.o:%.cpp
$(CC) $(CCFLAGS) -c $< -o $@
$(DIR)%.d:%.cpp
$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@
# ------ DEPENDENCIES ------
DEPENDS = $(OBJ:.o=.d)
# ------ CLEAN ------
clean:
-rm $(DIR)*.o $(DIR)*.d *~ $(LIB)
$(DEPENDS) : $(DIR)
sinclude $(DEPENDS)

55
lib/atc/Makefile.mpi Normal file
View File

@ -0,0 +1,55 @@
# library build -*- makefile -*-
SHELL = /bin/sh
# which file will be copied to Makefile.lammps
EXTRAMAKE = Makefile.lammps.linalg
# ------ FILES ------
SRC = $(wildcard *.cpp)
INC = $(wildcard *.h)
# ------ DEFINITIONS ------
LIB = libatc.a
OBJ = $(SRC:.cpp=.o)
default: lib
# ------ SETTINGS ------
.PHONY: clean lib depend
# include any MPI settings needed for the ATC library to build with
# must be the same MPI library that LAMMPS is built with
CC = mpicxx
CCFLAGS = -O3 -Wall -g -fPIC
CPPFLAGS = -I../../src -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1
ARCHIVE = ar
ARCHFLAG = -rc
# ------ MAKE PROCEDURE ------
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
@cp $(EXTRAMAKE) Makefile.lammps
# ------ COMPILE RULES ------
%.o:%.cpp
$(CC) $(CPPFLAGS) $(CCFLAGS) -c $<
# ------ DEPENDENCIES ------
depend .depend : fastdep.exe $(SRC)
@./fastdep.exe $(INCFLAGS) -- $^ > .depend || exit 1
fastdep.exe: ../../src/DEPEND/fastdep.c
@cc -O -o $@ $<
# ------ CLEAN ------
clean:
-rm -f *.o *~ .depend $(LIB) fastdep.exe
sinclude $(DEPENDS)

View File

@ -1,39 +0,0 @@
# library build -*- makefile -*-
SHELL = /bin/sh
# which file will be copied to Makefile.lammps
EXTRAMAKE = Makefile.lammps.installed
# ------ FILES ------
SRC = $(wildcard *.cpp)
INC = $(wildcard *.h)
# ------ DEFINITIONS ------
LIB = libatc.a
OBJ = $(SRC:.cpp=.o)
# ------ SETTINGS ------
# include any MPI settings needed for the ATC library to build with
# must be the same MPI library that LAMMPS is built with
CC = mpic++
CCFLAGS = -O3 -Wall -g -I../../src -fPIC -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1
ARCHIVE = ar
ARCHFLAG = -rc
DEPFLAGS = -M
LINK = $(CC)
LINKFLAGS = -O
# ------ MAKE PROCEDURE ------
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
@cp $(EXTRAMAKE) Makefile.lammps
# ------ COMPILE RULES ------
%.o:%.cpp
$(CC) $(CCFLAGS) -c $<
%.d:%.cpp
$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@
# ------ DEPENDENCIES ------
DEPENDS = $(OBJ:.o=.d)
# ------ CLEAN ------
clean:
-rm *.o *.d *~ $(LIB)
sinclude $(DEPENDS)

1
lib/atc/Makefile.mpic++ Symbolic link
View File

@ -0,0 +1 @@
Makefile.mpi

View File

@ -14,18 +14,20 @@ INC = $(wildcard *.h)
LIB = libatc.a
OBJ = $(SRC:.cpp=.o)
default: lib
# ------ SETTINGS ------
.PHONY: clean lib depend
# include any MPI settings needed for the ATC library to build with
# must be the same MPI library that LAMMPS is built with
CC = g++
CCFLAGS = -O -g -fPIC -I../../src -I../../src/STUBS
CCFLAGS = -O3 -g -fPIC
CPPFLAGS = -I../../src -I../../src/STUBS
ARCHIVE = ar
ARCHFLAG = -rc
DEPFLAGS = -M
LINK = $(CC)
LINKFLAGS = -O
# ------ MAKE PROCEDURE ------
lib: $(OBJ)
@ -35,17 +37,19 @@ lib: $(OBJ)
# ------ COMPILE RULES ------
%.o:%.cpp
$(CC) $(CCFLAGS) -c $<
%.d:%.cpp
$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@
$(CC) $(CPPFLAGS) $(CCFLAGS) -c $<
# ------ DEPENDENCIES ------
DEPENDS = $(OBJ:.o=.d)
depend .depend : fastdep.exe $(SRC)
@./fastdep.exe $(INCFLAGS) -- $^ > .depend || exit 1
fastdep.exe: ../../src/DEPEND/fastdep.c
@cc -O -o $@ $<
# ------ CLEAN ------
clean:
-rm *.o *.d *~ $(LIB)
-rm -f *.o *~ .depend $(LIB) fastdep.exe
sinclude $(DEPENDS)
sinclude .depend

View File

@ -1 +1 @@
Install.py
../Install.py

View File

@ -1,13 +0,0 @@
# -*- makefile -*- wrapper for non-MPI libraries
SHELL=/bin/sh
all:
$(MAKE) $(MFLAGS) mingw32-cross
rm -f Obj_mingw32-mpi
ln -s Obj_mingw32 Obj_mingw32-mpi
clean:
$(MAKE) $(MFLAGS) clean-mingw32-cross
rm -f Obj_mingw32-mpi

View File

@ -1,13 +0,0 @@
# -*- makefile -*- wrapper for non-MPI libraries
SHELL=/bin/sh
all:
$(MAKE) $(MFLAGS) mingw64-cross
rm -f Obj_mingw64-mpi
ln -s Obj_mingw64 Obj_mingw64-mpi
clean:
$(MAKE) $(MFLAGS) clean-mingw64-cross
rm -f Obj_mingw64-mpi

View File

@ -1,4 +1,3 @@
# library build -*- makefile -*-
SHELL = /bin/sh
# which file will be copied to Makefile.lammps
@ -7,9 +6,10 @@ EXTRAMAKE = Makefile.lammps.linalg
# ------ FILES ------
SRC = logexc.cpp wpmd.cpp wpmd_split.cpp
vpath %.cpp ivutils/src
vpath %.cpp systems/interact/TCP
SRC = \
ivutils/src/logexc.cpp \
systems/interact/TCP/wpmd.cpp \
systems/interact/TCP/wpmd_split.cpp
INC = \
cerf.h \
@ -27,21 +27,21 @@ INC = \
wpmd_split.h
# ------ DEFINITIONS ------
DIR = Obj_mingw64/
LIB = $(DIR)libawpmd.a
OBJ = $(SRC:%.cpp=$(DIR)%.o)
LIB = libawpmd.a
OBJ = $(SRC:.cpp=.o)
# ------ SETTINGS ------
# include any MPI settings needed for the ATC library to build with
# the same MPI library that LAMMPS is built with
CC = x86_64-w64-mingw32-g++
CCFLAGS = -O3 -march=core2 -mtune=core2 -mpc64 -msse2 \
-ffast-math -funroll-loops -fstrict-aliasing \
-Wall -W -Wno-uninitialized -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include
ARCHIVE = x86_64-w64-mingw32-ar
ARCHFLAG = -rscv
CC = mpicxx
CCFLAGS = -O3 -fPIC -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include \
-DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1
ARCHIVE = ar
ARCHFLAG = -rc
DEPFLAGS = -M
#LINK =
#LINKFLAGS =
@ -50,23 +50,15 @@ SYSLIB =
# ------ MAKE PROCEDURE ------
default: $(DIR) $(LIB) Makefile.lammps
$(DIR):
mkdir $(DIR)
Makefile.lammps:
@cp $(EXTRAMAKE) Makefile.lammps
$(LIB): $(OBJ)
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
@cp $(EXTRAMAKE) Makefile.lammps
# ------ COMPILE RULES ------
$(DIR)%.o:%.cpp
%.o:%.cpp
$(CC) $(CCFLAGS) -c $< -o $@
$(DIR)%.d:%.cpp
%.d:%.cpp
$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@
# ------ DEPENDENCIES ------
@ -76,4 +68,4 @@ DEPENDS = $(OBJ:.o=.d)
# ------ CLEAN ------
clean:
-rm *.d *~ $(OBJ) $(LIB)
-rm -f *.d *~ $(OBJ) $(LIB)

View File

@ -36,8 +36,10 @@ OBJ = $(SRC:.cpp=.o)
# include any MPI settings needed for the ATC library to build with
# the same MPI library that LAMMPS is built with
CC = mpic++
CCFLAGS = -O -fPIC -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include
CC = mpicxx
CCFLAGS = -O3 -fPIC -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include \
-DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1
ARCHIVE = ar
ARCHFLAG = -rc
DEPFLAGS = -M
@ -66,4 +68,4 @@ DEPENDS = $(OBJ:.o=.d)
# ------ CLEAN ------
clean:
-rm *.d *~ $(OBJ) $(LIB)
-rm -f *.d *~ $(OBJ) $(LIB)

View File

@ -1,4 +1,3 @@
# library build -*- makefile -*-
SHELL = /bin/sh
# which file will be copied to Makefile.lammps
@ -7,9 +6,10 @@ EXTRAMAKE = Makefile.lammps.linalg
# ------ FILES ------
SRC = logexc.cpp wpmd.cpp wpmd_split.cpp
vpath %.cpp ivutils/src
vpath %.cpp systems/interact/TCP
SRC = \
ivutils/src/logexc.cpp \
systems/interact/TCP/wpmd.cpp \
systems/interact/TCP/wpmd_split.cpp
INC = \
cerf.h \
@ -27,22 +27,21 @@ INC = \
wpmd_split.h
# ------ DEFINITIONS ------
DIR = Obj_mingw32/
LIB = $(DIR)libawpmd.a
OBJ = $(SRC:%.cpp=$(DIR)%.o)
LIB = libawpmd.a
OBJ = $(SRC:.cpp=.o)
# ------ SETTINGS ------
# include any MPI settings needed for the ATC library to build with
# the same MPI library that LAMMPS is built with
CC = i686-w64-mingw32-g++
CCFLAGS = -O2 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \
-finline-functions \
-ffast-math -funroll-loops -fstrict-aliasing \
-Wall -W -Wno-uninitialized -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include
ARCHIVE = i686-w64-mingw32-ar
ARCHFLAG = -rscv
CC = g++
CCFLAGS = -O3 -fPIC -Isystems/interact/TCP/ -Isystems/interact -Iivutils/include \
-I../../src/STUBS
ARCHIVE = ar
ARCHFLAG = -rc
DEPFLAGS = -M
#LINK =
#LINKFLAGS =
@ -51,23 +50,15 @@ SYSLIB =
# ------ MAKE PROCEDURE ------
default: $(DIR) $(LIB) Makefile.lammps
$(DIR):
mkdir $(DIR)
Makefile.lammps:
@cp $(EXTRAMAKE) Makefile.lammps
$(LIB): $(OBJ)
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
@cp $(EXTRAMAKE) Makefile.lammps
# ------ COMPILE RULES ------
$(DIR)%.o:%.cpp
%.o:%.cpp
$(CC) $(CCFLAGS) -c $< -o $@
$(DIR)%.d:%.cpp
%.d:%.cpp
$(CC) $(CCFLAGS) $(DEPFLAGS) $< > $@
# ------ DEPENDENCIES ------
@ -77,4 +68,4 @@ DEPENDS = $(OBJ:.o=.d)
# ------ CLEAN ------
clean:
-rm *.d *~ $(OBJ) $(LIB)
-rm -f *.d *~ $(OBJ) $(LIB)

View File

@ -13,7 +13,7 @@ Syntax from lib/colvars dir: python Install.py -m machine -e suffix
specify -m and optionally -e, order does not matter
-m = peform a clean followed by "make -f Makefile.machine"
-m = delete all existing objects, followed by "make -f Makefile.machine"
machine = suffix of a lib/colvars/Makefile.* or of a
src/MAKE/MACHINES/Makefile.* file
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
@ -21,14 +21,14 @@ specify -m and optionally -e, order does not matter
Examples:
make lib-colvars args="-m g++" # build COLVARS lib with GNU g++ compiler
make lib-colvars args="-m mpi" # build COLVARS lib with default mpi compiler wrapper
"""
# print error message or help
def error(str=None):
if not str: print(help)
else: print("ERROR"),str
else: print("ERROR",str)
sys.exit()
# parse args
@ -122,7 +122,7 @@ for line in lines:
fp.write(line)
fp.close()
# make the library via Makefile.auto
# make the library via Makefile.auto optionally with parallel make
try:
import multiprocessing
@ -132,9 +132,9 @@ except:
print("Building lib%s.a ..." % lib)
cmd = ["make -f Makefile.auto clean"]
print(subprocess.check_output(cmd, shell=True).decode())
print(subprocess.check_output(cmd, shell=True).decode('UTF-8'))
cmd = ["make -f Makefile.auto -j%d" % n_cpus]
print(subprocess.check_output(cmd, shell=True).decode())
print(subprocess.check_output(cmd, shell=True).decode('UTF-8'))
if os.path.exists("lib%s.a" % lib): print("Build was successful")
else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))

View File

@ -1,31 +0,0 @@
# -*- makefile -*- to build Colvars module with MinGW 32-bit
EXTRAMAKE = Makefile.lammps.empty
COLVARS_LIB = libcolvars.a
COLVARS_OBJ_DIR = Obj_mingw64/
CXX = i686-w64-mingw32-g++
CXXFLAGS = -O2 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \
-fno-rtti -fno-exceptions -finline-functions \
-ffast-math -funroll-loops -fstrict-aliasing \
-Wall -W -Wno-uninitialized
AR = i686-w64-mingw32-ar
ARFLAGS = -rscv
SHELL = /bin/sh
.PHONY: default clean
default: $(COLVARS_OBJ_DIR) $(COLVARS_LIB) Makefile.lammps
include Makefile.common
$(COLVARS_OBJ_DIR):
mkdir $(COLVARS_OBJ_DIR)
clean:
-rm -f $(COLVARS_OBJS) $(COLVARS_LIB)
-rmdir $(COLVARS_OBJ_DIR)
Makefile.lammps:
-cp $(EXTRAMAKE) Makefile.lammps

View File

@ -1,13 +0,0 @@
# -*- makefile -*- wrapper for non-MPI libraries
SHELL=/bin/sh
all:
$(MAKE) $(MFLAGS) mingw32-cross
-rm -f Obj_mingw32-mpi
ln -s Obj_mingw32 Obj_mingw32-mpi
clean:
$(MAKE) $(MFLAGS) clean-mingw32-cross
-rm -f Obj_mingw32-mpi

View File

@ -1,31 +0,0 @@
# -*- makefile -*- to build Colvars module with MinGW 32-bit
EXTRAMAKE = Makefile.lammps.empty
COLVARS_LIB = libcolvars.a
COLVARS_OBJ_DIR = Obj_mingw32/
CXX = x86_64-w64-mingw32-g++
CXXFLAGS = -O2 -march=core2 -mtune=core2 -mpc64 -msse2 \
-fno-rtti -fno-exceptions -finline-functions \
-ffast-math -funroll-loops -fstrict-aliasing \
-Wall -W -Wno-uninitialized
AR = x86_64-w64-mingw32-ar
ARFLAGS = -rscv
SHELL = /bin/sh
.PHONY: default clean
default: $(COLVARS_OBJ_DIR) $(COLVARS_LIB) Makefile.lammps
include Makefile.common
$(COLVARS_OBJ_DIR):
mkdir $(COLVARS_OBJ_DIR)
clean:
-rm -f $(COLVARS_OBJS) $(COLVARS_LIB)
-rmdir $(COLVARS_OBJ_DIR)
Makefile.lammps:
-cp $(EXTRAMAKE) Makefile.lammps

View File

@ -1,13 +0,0 @@
# -*- makefile -*- wrapper for non-MPI libraries
SHELL=/bin/sh
all:
$(MAKE) $(MFLAGS) mingw64-cross
-rm -f Obj_mingw64-mpi
ln -s Obj_mingw64 Obj_mingw64-mpi
clean:
$(MAKE) $(MFLAGS) clean-mingw64-cross
-rm -f Obj_mingw64-mpi

25
lib/colvars/Makefile.mpi Normal file
View File

@ -0,0 +1,25 @@
# -*- makefile -*- to build Colvars module with default MPI compiler wrapper
EXTRAMAKE = Makefile.lammps.empty
COLVARS_LIB = libcolvars.a
COLVARS_OBJ_DIR =
CXX = mpicxx
CXXFLAGS = -O2 -g -Wall -fPIC -funroll-loops
AR = ar
ARFLAGS = -rscv
SHELL = /bin/sh
.PHONY: default clean
default: $(COLVARS_LIB) Makefile.lammps
include Makefile.common
clean:
-rm -f $(COLVARS_OBJS) $(COLVARS_LIB)
Makefile.lammps:
-cp $(EXTRAMAKE) Makefile.lammps

View File

@ -0,0 +1,25 @@
# -*- makefile -*- to build Colvars module with GNU compiler
EXTRAMAKE = Makefile.lammps.empty
COLVARS_LIB = libcolvars.a
COLVARS_OBJ_DIR =
CXX = g++
CXXFLAGS = -O2 -g -Wall -fPIC -funroll-loops
AR = ar
ARFLAGS = -rscv
SHELL = /bin/sh
.PHONY: default clean
default: $(COLVARS_LIB) Makefile.lammps
include Makefile.common
clean:
-rm -f $(COLVARS_OBJS) $(COLVARS_LIB)
Makefile.lammps:
-cp $(EXTRAMAKE) Makefile.lammps

10
lib/gpu/.gitignore vendored
View File

@ -1,4 +1,6 @@
obj
obj_ocl
ocl_get_devices
nvc_get_devices
/obj
/obj_ocl
/ocl_get_devices
/nvc_get_devices
/*.cubin
/*_cubin.h

View File

@ -3,44 +3,57 @@
# Install.py tool to build the GPU library
# used to automate the steps described in the README file in this dir
import sys,os,re,commands
from __future__ import print_function
import sys,os,subprocess
# help message
help = """
Syntax: python Install.py -i isuffix -h hdir -a arch -p precision -e esuffix -m -o osuffix
specify one or more options, order does not matter
copies an existing Makefile.isuffix in lib/gpu to Makefile.auto
optionally edits these variables in Makefile.auto:
CUDA_HOME, CUDA_ARCH, CUDA_PRECISION, EXTRAMAKE
optionally uses Makefile.auto to build the GPU library -> libgpu.a
and to copy a Makefile.lammps.esuffix -> Makefile.lammps
optionally copies Makefile.auto to a new Makefile.osuffix
Syntax from src dir: make lib-gpu args="-m machine -h hdir -a arch -p precision -e esuffix -m -o osuffix"
Syntax from lib dir: python Install.py -m machine -h hdir -a arch -p precision -e esuffix -m -o osuffix
-i = use Makefile.isuffix as starting point, copy to Makefile.auto
default isuffix = linux
specify one or more options, order does not matter
copies an existing Makefile.machine in lib/gpu to Makefile.auto
optionally edits these variables in Makefile.auto:
CUDA_HOME, CUDA_ARCH, CUDA_PRECISION, EXTRAMAKE
optionally uses Makefile.auto to build the GPU library -> libgpu.a
and to copy a Makefile.lammps.esuffix -> Makefile.lammps
optionally copies Makefile.auto to a new Makefile.osuffix
-m = use Makefile.machine as starting point, copy to Makefile.auto
default machine = linux
-h = set CUDA_HOME variable in Makefile.auto to hdir
hdir = path to NVIDIA Cuda software, e.g. /usr/local/cuda
-a = set CUDA_ARCH variable in Makefile.auto to arch
use arch = ?? for K40 (Tesla)
use arch = 37 for dual K80 (Tesla)
use arch = 60 for P100 (Pascal)
use arch = 20 for Tesla C2050/C2070 (Fermi) (deprecated as of CUDA 8.0)
or GeForce GTX 580 or similar
use arch = 30 for Tesla K10 (Kepler)
use arch = 35 for Tesla K40 (Kepler) or GeForce GTX Titan or similar
use arch = 37 for Tesla dual K80 (Kepler)
use arch = 60 for Tesla P100 (Pascal)
-p = set CUDA_PRECISION variable in Makefile.auto to precision
use precision = double or mixed or single
-e = set EXTRAMAKE variable in Makefile.auto to Makefile.lammps.esuffix
-m = make the GPU library using Makefile.auto
-b = make the GPU library using Makefile.auto
first performs a "make clean"
produces libgpu.a if successful
then produces libgpu.a if successful
also copies EXTRAMAKE file -> Makefile.lammps
-e can set which Makefile.lammps.esuffix file is copied
-o = copy final Makefile.auto to Makefile.osuffix
Examples:
make lib-gpu args="-b" # build GPU lib with default Makefile.linux
make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
make lib-gpu args="-m mpi -a 35 -p single -o mpi.mixed -b" # create new Makefile.mpi.mixed, also build GPU lib with these settings
"""
# print error message or help
def error(str=None):
if not str: print help
else: print "ERROR",str
if not str: print(help)
else: print("ERROR",str)
sys.exit()
# parse args
@ -56,7 +69,7 @@ outflag = 0
iarg = 0
while iarg < nargs:
if args[iarg] == "-i":
if args[iarg] == "-m":
if iarg+2 > nargs: error()
isuffix = args[iarg+1]
iarg += 2
@ -80,7 +93,7 @@ while iarg < nargs:
eflag = 1
lmpsuffix = args[iarg+1]
iarg += 2
elif args[iarg] == "-m":
elif args[iarg] == "-b":
makeflag = 1
iarg += 1
elif args[iarg] == "-o":
@ -108,9 +121,9 @@ fp = open("Makefile.auto",'w')
for line in lines:
words = line.split()
if len(words) != 3:
print >>fp,line,
fp.write(line)
continue
if hflag and words[0] == "CUDA_HOME" and words[1] == '=':
line = line.replace(words[2],hdir)
if aflag and words[0] == "CUDA_ARCH" and words[1] == '=':
@ -119,20 +132,20 @@ for line in lines:
line = line.replace(words[2],precstr)
if eflag and words[0] == "EXTRAMAKE" and words[1] == '=':
line = line.replace(words[2],"Makefile.lammps.%s" % lmpsuffix)
print >>fp,line,
fp.write(line)
fp.close()
# perform make
# make operations copies EXTRAMAKE file to Makefile.lammps
if makeflag:
print "Building libgpu.a ..."
print("Building libgpu.a ...")
cmd = "rm -f libgpu.a"
commands.getoutput(cmd)
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
cmd = "make -f Makefile.auto clean; make -f Makefile.auto"
commands.getoutput(cmd)
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
print(txt.decode('UTF-8'))
if not os.path.exists("libgpu.a"):
error("Build of lib/gpu/libgpu.a was NOT successful")
if not os.path.exists("Makefile.lammps"):
@ -141,6 +154,6 @@ if makeflag:
# copy new Makefile.auto to Makefile.osuffix
if outflag:
print "Creating new Makefile.%s" % osuffix
print("Creating new Makefile.%s" % osuffix)
cmd = "cp Makefile.auto Makefile.%s" % osuffix
commands.getoutput(cmd)
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)

View File

@ -37,7 +37,7 @@ CUDA_INCLUDE = -I$(CUDA_HOME)/include
CUDA_LIB = -L$(CUDA_HOME)/lib64
CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math $(LMP_INC)
CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC
CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC
CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias
BIN_DIR = ./

View File

@ -1,17 +0,0 @@
CUDA_HOME = ../../tools/mingw-cross/OpenCL
OCL_CPP = i686-w64-mingw32-g++ -O2 -march=i686 -mtune=generic -mfpmath=387 \
-mpc64 -DMPI_GERYON -DUCL_NO_EXIT -I../../src/STUBS \
-I$(CUDA_HOME)/include
OCL_LINK = -static -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw32 -Wl,-Bdynamic,-lOpenCL,-Bstatic -L../../src/STUBS -lmpi_mingw32
OCL_PREC = -D_SINGLE_DOUBLE
OCL_TUNE = -DFERMI_OCL
EXTRAMAKE = Makefile.lammps.mingw-cross
BIN_DIR = Obj_mingw32
OBJ_DIR = Obj_mingw32
LIB_DIR = Obj_mingw32
AR = i686-w64-mingw32-ar
BSH = /bin/sh
include Opencl.makefile

View File

@ -1,19 +0,0 @@
CUDA_HOME = ../../tools/mingw-cross/OpenCL
OCL_CPP = i686-w64-mingw32-g++ -O2 -march=i686 -mtune=generic -mfpmath=387 \
-mpc64 -DMPI_GERYON -DUCL_NO_EXIT -I$(CUDA_HOME)/include \
-I../../tools/mingw-cross/mpich2-win32/include/ \
-DMPICH_IGNORE_CXX_SEEK
OCL_LINK = -static -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw32 -Wl,-Bdynamic,-lOpenCL,-Bstatic \
-L../../tools/mingw-cross/mpich2-win32/lib -lmpi
OCL_PREC = -D_SINGLE_DOUBLE
OCL_TUNE = -DFERMI_OCL
EXTRAMAKE = Makefile.lammps.mingw-cross
BIN_DIR = Obj_mingw32-mpi
OBJ_DIR = Obj_mingw32-mpi
LIB_DIR = Obj_mingw32-mpi
AR = i686-w64-mingw32-ar
BSH = /bin/sh
include Opencl.makefile

View File

@ -1,18 +0,0 @@
CUDA_HOME = ../../tools/mingw-cross/OpenCL
OCL_CPP = x86_64-w64-mingw32-g++ -O3 -march=core2 -mtune=core2 -mpc64 \
-msse2 -DMPI_GERYON -DUCL_NO_EXIT -I../../src/STUBS \
-I$(CUDA_HOME)/include
OCL_LINK = -static -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw64 -Wl,-Bdynamic,-lOpenCL,-Bstatic \
-L../../src/STUBS -lmpi_mingw64
OCL_PREC = -D_SINGLE_DOUBLE
OCL_TUNE = -DFERMI_OCL
EXTRAMAKE = Makefile.lammps.mingw-cross
BIN_DIR = Obj_mingw64
OBJ_DIR = Obj_mingw64
LIB_DIR = Obj_mingw64
AR = x86_64-w64-mingw32-ar
BSH = /bin/sh
include Opencl.makefile

View File

@ -1,20 +0,0 @@
CUDA_HOME = ../../tools/mingw-cross/OpenCL
OCL_CPP = x86_64-w64-mingw32-g++ -O3 -march=core2 -mtune=core2 -mpc64 \
-msse2 -DMPI_GERYON -DUCL_NO_EXIT -I$(CUDA_HOME)/include \
-I../../tools/mingw-cross/mpich2-win64/include/ \
-DMPICH_IGNORE_CXX_SEEK
OCL_LINK = -static -Wl,--enable-stdcall-fixup -L$(CUDA_HOME)/../Obj_mingw64 -Wl,-Bdynamic,-lOpenCL,-Bstatic \
-L../../tools/mingw-cross/mpich2-win64/lib -lmpi
OCL_PREC = -D_SINGLE_DOUBLE
OCL_TUNE = -DFERMI_OCL
EXTRAMAKE = Makefile.lammps.mingw-cross
BIN_DIR = Obj_mingw64-mpi
OBJ_DIR = Obj_mingw64-mpi
LIB_DIR = Obj_mingw64-mpi
AR = x86_64-w64-mingw32-ar
BSH = /bin/sh
include Opencl.makefile

1
lib/gpu/Makefile.mpi Symbolic link
View File

@ -0,0 +1 @@
Makefile.linux

View File

@ -1,5 +1,5 @@
# /* ----------------------------------------------------------------------
# Generic Makefile for CUDA using MPI STUBS library
# Generic Linux Makefile for CUDA
# - Change CUDA_ARCH for your GPU
# ------------------------------------------------------------------------- */
@ -7,23 +7,38 @@
EXTRAMAKE = Makefile.lammps.standard
CUDA_HOME = $(HOME)/cuda
ifeq ($(CUDA_HOME),)
CUDA_HOME = /usr/local/cuda
endif
NVCC = nvcc
# Tesla CUDA
CUDA_ARCH = -arch=sm_20
CUDA_ARCH = -arch=sm_21
# newer CUDA
#CUDA_ARCH = -arch=sm_13
# older CUDA
#CUDA_ARCH = -arch=sm_10 -DCUDA_PRE_THREE
CUDA_ARCH = -arch=sm_35
# this setting should match LAMMPS Makefile
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
LMP_INC = -DLAMMPS_SMALLBIG
# precision for GPU calculations
# -D_SINGLE_SINGLE # Single precision for all calculations
# -D_DOUBLE_DOUBLE # Double precision for all calculations
# -D_SINGLE_DOUBLE # Accumulation of forces, etc. in double
CUDA_PRECISION = -D_SINGLE_DOUBLE
CUDA_INCLUDE = -I$(CUDA_HOME)/include
CUDA_LIB = -L$(CUDA_HOME)/lib64 -L../../src/STUBS -lmpi
CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math
CUDR_CPP = g++ -DMPI_GERYON -DUCL_NO_EXIT -I../../src/STUBS
CUDR_OPTS = -O2
CUDA_INCLUDE = -I$(CUDA_HOME)/include
CUDA_LIB = -L$(CUDA_HOME)/lib64 -L../../src/STUBS -lmpi_stubs
CUDA_OPTS = -DUNIX -O3 -Xptxas -v --use_fast_math $(LMP_INC)
CUDR_CPP = g++ -DMPI_GERYON -DUCL_NO_EXIT -fPIC -I../../src/STUBS
CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias
BIN_DIR = ./
OBJ_DIR = ./
@ -31,5 +46,7 @@ LIB_DIR = ./
AR = ar
BSH = /bin/sh
CUDPP_OPT = -DUSE_CUDPP -Icudpp_mini
include Nvidia.makefile

View File

@ -1 +1 @@
Install.py
../Install.py

View File

@ -9,12 +9,14 @@ HDF5_PATH=/usr
INC=-I include
AR=ar
ARFLAGS=rc
LIB=libch5md.a
# need to build two libraries to not break compatibility and to support Install.py
LIB=libh5md.a libch5md.a
all: lib Makefile.lammps
build:
mkdir -p build
build/ch5md.o: src/ch5md.c | build
$(CC) $(INC) $(CFLAGS) -c $< -o $@
@ -23,8 +25,11 @@ Makefile.lammps:
.PHONY: all lib clean
$(LIB): build/ch5md.o
$(AR) $(ARFLAGS) $(LIB) build/ch5md.o
libch5md.a : build/ch5md.o
$(AR) $(ARFLAGS) $@ build/ch5md.o
libh5md.a : build/ch5md.o
$(AR) $(ARFLAGS) $@ build/ch5md.o
lib: $(LIB)

1
lib/h5md/Makefile.mpi Symbolic link
View File

@ -0,0 +1 @@
Makefile.h5cc

1
lib/h5md/Makefile.serial Symbolic link
View File

@ -0,0 +1 @@
Makefile.h5cc

1
lib/kim/.gitignore vendored
View File

@ -1,2 +1,3 @@
/Makefile.KIM_DIR
/Makefile.KIM_Config
/installed-kim-api-*

View File

@ -1,150 +1,301 @@
#!/usr/bin/env python
# install.py tool to setup the kim-api library
# install.py tool to download, compile, and setup the kim-api library
# used to automate the steps described in the README file in this dir
import sys,os,re,urllib,commands
from __future__ import print_function
import sys,os,re,subprocess
help = """
Syntax: install.py -v version -c kim-dir -b kim-model-name -a kim-name
specify one or more options, order does not matter
-v = version of kim-api to download and work with
default = kim-api-v1.8.2 (current as of June 2017)
-c = create Makefile.KIM_DIR within lammps lib/kim to configure lammps
for use with the kim-api library installed at "kim-dir" (absolute
path). default = this dir
-b = build kim-api and kim model where kim-model-name can be a specific
openkim.org model name (such as
"EAM_Dynamo_Ackland_W__MO_141627196590_002") or the keyword
"OpenKIM" to install all compatible models from the openkim.org
site.
-a = add kim-name openkim.org item (model driver or model) to existing
kim-api instalation.
Syntax from src dir: make lib-kim args="-b -v version -a kim-name"
or: make lib-kim args="-b -a everything"
or: make lib-kim args="-n -a kim-name"
or: make lib-kim args="-p /usr/local/open-kim -a kim-name"
Syntax from lib dir: python Install.py -b -v version -a kim-name
or: python Install.py -b -a everything
or: python Install.py -n -a kim-name
or: python Install.py -p /usr/local/open-kim -a kim-name
specify one or more options, order does not matter
-v = version of KIM API library to use
default = kim-api-v1.8.2 (current as of June 2017)
-b = download and build base KIM API library with example Models
this will delete any previous installation in the current folder
-n = do NOT download and build base KIM API library.
Use an existing installation
-p = specify location of KIM API installation (implies -n)
-a = add single KIM model or model driver with kim-name
to existing KIM API lib (see example below).
If kim-name = everything, then rebuild KIM API library with
*all* available OpenKIM Models (make take a long time).
-vv = be more verbose about what is happening while the script runs
Examples:
make lib-kim args="-b" # install KIM API lib with only example models
make lib-kim args="-a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # Ditto plus one model
make lib-kim args="-b -a everything" # install KIM API lib with all models
make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # only add one model or model driver
See the list of KIM model drivers here:
https://openkim.org/kim-items/model-drivers/alphabetical
See the list of all KIM models here:
https://openkim.org/kim-items/models/by-model-drivers
See the list of example KIM models included by default here:
https://openkim.org/kim-api
in the "What is in the KIM API source package?" section
"""
def error():
print help
def error(str=None):
if not str: print(help)
else: print("ERROR",str)
sys.exit()
# expand to full path name
# process leading '~' or relative path
def fullpath(path):
return os.path.abspath(os.path.expanduser(path))
def which(program):
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
if fpath:
if is_exe(program):
return program
else:
for path in os.environ["PATH"].split(os.pathsep):
path = path.strip('"')
exe_file = os.path.join(path, program)
if is_exe(exe_file):
return exe_file
return None
def geturl(url,fname):
if which('curl') != None:
cmd = 'curl -L -o "%s" %s' % (fname,url)
elif which('wget') != None:
cmd = 'wget -O "%s" %s' % (fname,url)
else: error("cannot find 'wget' or 'curl' to download source code")
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
return txt
# parse args
args = sys.argv
args = sys.argv[1:]
nargs = len(args)
if nargs == 0: error()
thisdir = os.environ['PWD']
dir = thisdir
version = "kim-api-v1.8.2"
dirflag = 0
buildflag = 0
addflag = 0
buildflag = False
everythingflag = False
addflag = False
verboseflag = False
pathflag = False
iarg = 1
iarg = 0
while iarg < len(args):
if args[iarg] == "-v":
if iarg+2 > len(args): error()
version = args[iarg+1]
iarg += 2
elif args[iarg] == "-c":
dirflag = 1
if iarg+2 > len(args): error()
dir = args[iarg+1]
iarg += 2
elif args[iarg] == "-b":
buildflag = 1
buildflag = True
iarg += 1
elif args[iarg] == "-n":
buildflag = False
iarg += 1
elif args[iarg] == "-p":
if iarg+2 > len(args): error()
modelname = args[iarg+1]
kimdir = fullpath(args[iarg+1])
pathflag = True
buildflag = False
iarg += 2
elif args[iarg] == "-a":
addflag = 1
addflag = True
if iarg+2 > len(args): error()
addmodelname = args[iarg+1]
if addmodelname == "everything":
buildflag = True
everythingflag = True
addflag = False
iarg += 2
elif args[iarg] == "-vv":
verboseflag = True
iarg += 1
else: error()
thisdir = os.path.abspath(thisdir)
dir = os.path.abspath(dir)
url = "https://s3.openkim.org/kim-api/%s.tgz" % version
# download and unpack tarball
# set KIM API directory
if pathflag:
if not os.path.isdir(kimdir):
print("\nkim-api is not installed at %s" % kimdir)
error()
if not os.path.isfile("%s/Makefile.KIM_DIR" % thisdir):
open("%s/Makefile.KIM_DIR" % thisdir, 'w').write("KIM_INSTALL_DIR=%s" % dir)
open("%s/Makefile.KIM_Config" % thisdir, 'w').write("include %s/lib/kim-api/Makefile.KIM_Config" % dir)
print "Created %s/Makefile.KIM_DIR : using %s" % (thisdir,dir)
# configure LAMMPS to use existing kim-api installation
with open("%s/Makefile.KIM_DIR" % thisdir, 'w') as mkfile:
mkfile.write("KIM_INSTALL_DIR=%s\n\n" % kimdir)
mkfile.write(".DUMMY: print_dir\n\n")
mkfile.write("print_dir:\n")
mkfile.write(" @printf $(KIM_INSTALL_DIR)\n")
with open("%s/Makefile.KIM_Config" % thisdir, 'w') as cfgfile:
cfgfile.write("include %s/lib/kim-api/Makefile.KIM_Config" % kimdir)
print("Created %s/Makefile.KIM_DIR\n using %s" % (thisdir,kimdir))
else:
if dirflag == 1:
open("%s/Makefile.KIM_DIR" % thisdir, 'w').write("KIM_INSTALL_DIR=%s" % dir)
open("%s/Makefile.KIM_Config" % thisdir, 'w').write("include %s/lib/kim-api/Makefile.KIM_Config" % dir)
print "Updated %s/Makefile.KIM_DIR : using %s" % (thisdir,dir)
kimdir = os.path.join(os.path.abspath(thisdir), "installed-" + version)
# download KIM tarball, unpack, build KIM
if buildflag:
if buildflag == 1:
# download kim-api
print "Downloading kim-api tarball ..."
urllib.urlretrieve(url,"%s/%s.tgz" % (thisdir,version))
print "Unpacking kim-api tarball ..."
cmd = "cd %s; rm -rf %s; tar zxvf %s.tgz" % (thisdir,version,version)
txt = commands.getstatusoutput(cmd)
if txt[0] != 0: error()
# check to see if an installed kim-api already exists and wipe it out.
if os.path.isdir(kimdir):
print("kim-api is already installed at %s.\nRemoving it for re-install" % kimdir)
cmd = 'rm -rf "%s"' % kimdir
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
# configure LAMMPS to use kim-api to be installed
with open("%s/Makefile.KIM_DIR" % thisdir, 'w') as mkfile:
mkfile.write("KIM_INSTALL_DIR=%s\n\n" % kimdir)
mkfile.write(".DUMMY: print_dir\n\n")
mkfile.write("print_dir:\n")
mkfile.write(" @printf $(KIM_INSTALL_DIR)\n")
with open("%s/Makefile.KIM_Config" % thisdir, 'w') as cfgfile:
cfgfile.write("include %s/lib/kim-api/Makefile.KIM_Config" % kimdir)
print("Created %s/Makefile.KIM_DIR\n using %s" % (thisdir,kimdir))
# download entire kim-api tarball
print("Downloading kim-api tarball ...")
geturl(url,"%s/%s.tgz" % (thisdir,version))
print("Unpacking kim-api tarball ...")
cmd = 'cd "%s"; rm -rf "%s"; tar -xzvf %s.tgz' % (thisdir,version,version)
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
# configure kim-api
print "Configuring kim-api ..."
cmd = "cd %s/%s; ./configure --prefix='%s'" % (thisdir,version,dir)
txt = commands.getstatusoutput(cmd)
print txt[1]
if txt[0] != 0: error()
print("Configuring kim-api ...")
cmd = 'cd "%s/%s"; ./configure --prefix="%s"' % (thisdir,version,kimdir)
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
# build kim-api
print "Configuring model : %s" % modelname
cmd = "cd %s/%s; make add-%s" % (thisdir,version,modelname)
txt = commands.getstatusoutput(cmd)
print txt[1]
if txt[0] != 0: error()
#
print "Building kim-api ..."
cmd = "cd %s/%s; make" % (thisdir,version)
txt = commands.getstatusoutput(cmd)
print txt[1]
if txt[0] != 0: error()
print("Configuring example Models")
cmd = 'cd "%s/%s"; make add-examples' % (thisdir,version)
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
if verboseflag: print (txt.decode("UTF-8"))
if everythingflag:
print("Configuring all OpenKIM models, this will take a while ...")
cmd = 'cd "%s/%s"; make add-OpenKIM' % (thisdir,version)
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
if verboseflag: print(txt.decode("UTF-8"))
print("Building kim-api ...")
cmd = 'cd "%s/%s"; make' % (thisdir,version)
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
if verboseflag: print(txt.decode("UTF-8"))
# install kim-api
print "Installing kim-api ..."
cmd = "cd %s/%s; make install" % (thisdir,version)
txt = commands.getstatusoutput(cmd)
print txt[1]
if txt[0] != 0: error()
#
cmd = "cd %s/%s; make install-set-default-to-v1" %(thisdir,version)
txt = commands.getstatusoutput(cmd)
print txt[1]
if txt[0] != 0: error()
print("Installing kim-api ...")
cmd = 'cd "%s/%s"; make install' % (thisdir,version)
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
if verboseflag: print(txt.decode("UTF-8"))
cmd = 'cd "%s/%s"; make install-set-default-to-v1' %(thisdir,version)
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
if verboseflag: print(txt.decode("UTF-8"))
# remove source files
print "Removing kim-api source and build files ..."
cmd = "cd %s; rm -rf %s; rm -rf %s.tgz" % (thisdir,version,version)
txt = commands.getstatusoutput(cmd)
print txt[1]
if txt[0] != 0: error()
if addflag == 1:
# download model
print("Removing kim-api source and build files ...")
cmd = 'cd "%s"; rm -rf %s; rm -rf %s.tgz' % (thisdir,version,version)
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
# add a single model (and possibly its driver) to existing KIM installation
if addflag:
if not os.path.isdir(kimdir):
print("\nkim-api is not installed")
error()
# download single model
print("Downloading tarball for %s..." % addmodelname)
url = "https://openkim.org/download/%s.tgz" % addmodelname
print "Downloading item tarball ..."
urllib.urlretrieve(url,"%s/%s.tgz" % (thisdir,addmodelname))
print "Unpacking item tarball ..."
cmd = "cd %s; tar zxvf %s.tgz" % (thisdir,addmodelname)
txt = commands.getstatusoutput(cmd)
if txt[0] != 0: error()
#
print "Building item ..."
cmd = "cd %s/%s; make; make install" %(thisdir,addmodelname)
txt = commands.getstatusoutput(cmd)
print txt[1]
if txt[0] != 0: error()
#
print "Removing kim item source and build files ..."
cmd = "cd %s; rm -rf %s; rm -rf %s.tgz" %(thisdir,addmodelname,addmodelname)
txt = commands.getstatusoutput(cmd)
print txt[1]
if txt[0] != 0: error()
geturl(url,"%s/%s.tgz" % (thisdir,addmodelname))
print("Unpacking item tarball ...")
cmd = 'cd "%s"; tar -xzvf %s.tgz' % (thisdir,addmodelname)
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
print("Building item ...")
cmd = 'cd "%s/%s"; make; make install' %(thisdir,addmodelname)
try:
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError as e:
# Error: but first, check to see if it needs a driver
firstRunOutput = e.output.decode("UTF-8")
cmd = 'cd "%s/%s"; make kim-item-type' % (thisdir,addmodelname)
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
txt = txt.decode("UTF-8")
if txt == "ParameterizedModel":
# Get and install driver
cmd = 'cd "%s/%s"; make model-driver-name' % (thisdir,addmodelname)
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
adddrivername = txt.decode("UTF-8").strip()
print("First installing model driver: %s..." % adddrivername)
cmd = 'cd "%s"; python Install.py -n -a %s' % (thisdir,adddrivername)
try:
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError as e:
print(e.output)
sys.exit()
if verboseflag: print(txt.decode("UTF-8"))
# now install the model that needed the driver
print("Now installing model : %s" % addmodelname)
cmd = 'cd "%s"; python Install.py -n -a %s' % (thisdir,addmodelname)
try:
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError as e:
print(e.output)
sys.exit()
print(txt.decode("UTF-8"))
sys.exit()
else:
print(firstRunOutput)
print("Error, unable to build and install OpenKIM item: %s" \
% addmodelname)
sys.exit()
# success the first time
if verboseflag: print(txt.decode("UTF-8"))
print("Removing kim item source and build files ...")
cmd = 'cd "%s"; rm -rf %s; rm -rf %s.tgz' %(thisdir,addmodelname,addmodelname)
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)

View File

@ -8,14 +8,16 @@ James Sethna (Cornell U). Ryan Elliott is the main developer for the
KIM API and he also maintains the code that implements the pair_style
kim command.
To download, build, and install the KIM API on your system, follow
these steps. You can use the install.py script to automate these steps.
You can type "make lib-kim" from the src directory to see help on
how to download and build this library via make commands, or you can
do the same thing by typing "python Install.py" from within this
directory, or you can do it manually by following the instructions
below.
-----------------
Instructions:
1. Configure lammps for use with the kim-api library installed in this directory
$ printf "KIM_INSTALL_DIR=${PWD}\n" > ./Makefile.KIM_DIR
@ -65,7 +67,7 @@ $ rm -rf EAM_Johnson_NearestNeighbor_Cu__MO_887933271505_001.tgz
When these steps are complete you can build LAMMPS with the KIM
package installed:
$ cd ../../src
$ cd lammpos/src
$ make yes-kim
$ make g++ (or whatever target you wish)

View File

@ -1,52 +0,0 @@
#!/usr/bin/env python
# install.py tool to do build of the linear algebra library
# used to automate the steps described in the README file in this dir
import sys,commands,os
# help message
help = """
Syntax: python Install.py -m machine
-m = peform a clean followed by "make -f Makefile.machine"
machine = suffix of a lib/Makefile.* file
"""
# print error message or help
def error(str=None):
if not str: print help
else: print "ERROR",str
sys.exit()
# parse args
args = sys.argv[1:]
nargs = len(args)
if nargs == 0: error()
machine = None
iarg = 0
while iarg < nargs:
if args[iarg] == "-m":
if iarg+2 > nargs: error()
machine = args[iarg+1]
iarg += 2
else: error()
# set lib from working dir
cwd = os.getcwd()
lib = os.path.basename(cwd)
# make the library
print "Building lib%s.a ..." % lib
cmd = "make -f Makefile.%s clean; make -f Makefile.%s" % (machine,machine)
txt = commands.getoutput(cmd)
print txt
if os.path.exists("lib%s.a" % lib): print "Build was successful"
else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))

1
lib/linalg/Install.py Symbolic link
View File

@ -0,0 +1 @@
../Install.py

View File

@ -18,10 +18,8 @@ OBJ = $(SRC:.f=.o)
# ------ SETTINGS ------
FC = gfortran
FFLAGS = -O3 -fPIC -march=native -mpc64 \
-ffast-math -funroll-loops -fstrict-aliasing -Wall -W -Wno-uninitialized -fno-second-underscore
FFLAGS0 = -O0 -fPIC -march=native -mpc64 \
-Wall -W -Wno-uninitialized -fno-second-underscore
FFLAGS = -O3 -fPIC -ffast-math -fstrict-aliasing -fno-second-underscore
FFLAGS0 = -O0 -fPIC -fno-second-underscore
ARCHIVE = ar
AR = ar
ARCHFLAG = -rcs
@ -47,7 +45,7 @@ dlamch.o: dlamch.f
# ------ CLEAN ------
clean:
-rm *.o *.mod *~ $(LIB)
-rm -f *.o *.mod *~ $(LIB)
tar:
-tar -czvf ../linalg.tar.gz $(FILES)

View File

@ -1,67 +0,0 @@
# -*- makefile -*-
# *_________________________________________________________________________*
# * Minimal BLAS/LAPACK Library for use by other LAMMPS packages
SHELL = /bin/sh
# ------ FILES ------
SRC = $(wildcard *.f)
FILES = $(SRC) Makefile.* README
# ------ DEFINITIONS ------
DIR = Obj_mingw32/
LIB = $(DIR)liblinalg.a
OBJ = $(SRC:%.f=$(DIR)%.o)
# ------ SETTINGS ------
FC = i686-w64-mingw32-gfortran
FFLAGS = -O3 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \
-ffast-math -funroll-loops -fstrict-aliasing -Wall -W \
-Wno-uninitialized -fno-second-underscore
FFLAGS0 = -O0 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \
-Wall -W -Wno-uninitialized -fno-second-underscore
ARCHIVE = i686-w64-mingw32-ar
AR = i686-w64-mingw32-ar
ARCHFLAG = -rcs
USRLIB =
SYSLIB =
.PHONY: default clean tar
.SUFFIXES:
.SUFFIXES: .F .f .o
# ------ MAKE PROCEDURE ------
default: $(DIR) $(LIB)
$(LIB): $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
$(DIR):
mkdir $(DIR)
# ------ COMPILE RULES ------
$(DIR)%.o:%.F
$(F90) $(F90FLAGS) -c $< -o $@
$(DIR)%.o:%.f
$(FC) $(FFLAGS) -c $< -o $@
$(DIR)dlamch.o: dlamch.f
$(FC) $(FFLAGS0) -c $< -o $@
# ------ CLEAN ------
clean:
-rm $(DIR)*.o $(DIR)*.mod *~ $(LIB)
-rmdir $(DIR)
tar:
-tar -czvf ../linalg.tar.gz $(FILES)

View File

@ -1,13 +0,0 @@
# -*- makefile -*- wrapper for non-MPI libraries
SHELL=/bin/sh
all:
$(MAKE) $(MFLAGS) mingw32-cross
-rm -f Obj_mingw32-mpi
ln -s Obj_mingw32 Obj_mingw32-mpi
clean:
$(MAKE) $(MFLAGS) clean-mingw32-cross
-rm -f Obj_mingw32-mpi

View File

@ -1,67 +0,0 @@
# -*- makefile -*-
# *_________________________________________________________________________*
# * Minimal BLAS/LAPACK Library for use by other LAMMPS packages
SHELL = /bin/sh
# ------ FILES ------
SRC = $(wildcard *.f)
FILES = $(SRC) Makefile.* README
# ------ DEFINITIONS ------
DIR = Obj_mingw64/
LIB = $(DIR)liblinalg.a
OBJ = $(SRC:%.f=$(DIR)%.o)
# ------ SETTINGS ------
FC = x86_64-w64-mingw32-gfortran
FFLAGS = -O3 -march=core2 -mtune=generic -msse2 -mpc64 \
-ffast-math -funroll-loops -fstrict-aliasing -Wall -W \
-Wno-uninitialized -fno-second-underscore
FFLAGS0 = -O0 -march=core2 -mtune=generic -msse2 -mpc64 \
-Wall -W -Wno-uninitialized -fno-second-underscore
ARCHIVE = x86_64-w64-mingw32-ar
AR = x86_64-w64-mingw32-ar
ARCHFLAG = -rcs
USRLIB =
SYSLIB =
.PHONY: default clean tar
.SUFFIXES:
.SUFFIXES: .F .f .o
# ------ MAKE PROCEDURE ------
default: $(DIR) $(LIB)
$(LIB): $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
$(DIR):
mkdir $(DIR)
# ------ COMPILE RULES ------
$(DIR)%.o:%.F
$(F90) $(F90FLAGS) -c $< -o $@
$(DIR)%.o:%.f
$(FC) $(FFLAGS) -c $< -o $@
$(DIR)dlamch.o: dlamch.f
$(FC) $(FFLAGS0) -c $< -o $@
# ------ CLEAN ------
clean:
-rm $(DIR)*.o $(DIR)*.mod *~ $(LIB)
-rmdir $(DIR)
tar:
-tar -czvf ../linalg.tar.gz $(FILES)

View File

@ -1,13 +0,0 @@
# -*- makefile -*- wrapper for non-MPI libraries
SHELL=/bin/sh
all:
$(MAKE) $(MFLAGS) mingw64-cross
-rm -f Obj_mingw64-mpi
ln -s Obj_mingw64 Obj_mingw64-mpi
clean:
$(MAKE) $(MFLAGS) clean-mingw64-cross
-rm -f Obj_mingw64-mpi

52
lib/linalg/Makefile.mpi Normal file
View File

@ -0,0 +1,52 @@
# -*- makefile -*-
# *_________________________________________________________________________*
# * Minimal BLAS/LAPACK Library for use by other LAMMPS packages
SHELL = /bin/sh
# ------ FILES ------
SRC = $(wildcard *.f)
FILES = $(SRC) Makefile.* README
# ------ DEFINITIONS ------
LIB = liblinalg.a
OBJ = $(SRC:.f=.o)
# ------ SETTINGS ------
FC = mpifort
FFLAGS = -O3 -fPIC
FFLAGS0 = -O0 -fPIC
ARCHIVE = ar
AR = ar
ARCHFLAG = -rcs
USRLIB =
SYSLIB =
# ------ MAKE PROCEDURE ------
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
# ------ COMPILE RULES ------
%.o:%.F
$(F90) $(F90FLAGS) -c $<
%.o:%.f
$(FC) $(FFLAGS) -c $<
dlamch.o: dlamch.f
$(FC) $(FFLAGS0) -c $<
# ------ CLEAN ------
clean:
-rm -f *.o *.mod *~ $(LIB)
tar:
-tar -czvf ../linalg.tar.gz $(FILES)

1
lib/linalg/Makefile.serial Symbolic link
View File

@ -0,0 +1 @@
Makefile.gfortran

View File

@ -1 +1 @@
Install.py
../Install.py

View File

@ -1,5 +1,5 @@
# Settings that the LAMMPS build will import when this package library is used
colvars_SYSINC =
colvars_SYSLIB =
colvars_SYSPATH =
meam_SYSINC =
meam_SYSLIB =
meam_SYSPATH =

View File

@ -1,69 +0,0 @@
# * -*- makefile -*-
# *_________________________________________________________________________*
# * MEAM: MODEFIED EMBEDDED ATOM METHOD *
# * DESCRIPTION: SEE READ-ME *
# * FILE NAME: Makefile *
# * AUTHORS: Greg Wagner, Sandia National Laboratories *
# * CONTACT: gjwagne@sandia.gov *
# *_________________________________________________________________________*/
SHELL = /bin/sh
# which file will be copied to Makefile.lammps
EXTRAMAKE = Makefile.lammps.gfortran
# ------ FILES ------
SRC = meam_data.F meam_setup_done.F meam_setup_global.F meam_setup_param.F meam_dens_init.F meam_dens_final.F meam_force.F meam_cleanup.F
FILES = $(SRC) Makefile
# ------ DEFINITIONS ------
DIR = Obj_mingw32/
LIB = $(DIR)libmeam.a
OBJ = $(SRC:%.F=$(DIR)%.o) $(DIR)fm_exp.o
# ------ SETTINGS ------
F90 = i686-w64-mingw32-gfortran
F90FLAGS = -O3 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \
-ffast-math -funroll-loops -fstrict-aliasing -J$(DIR) \
-Wall -W -Wno-uninitialized -fno-second-underscore
#F90FLAGS = -O
ARCHIVE = i686-w64-mingw32-ar
ARCHFLAG = -rcs
LINK = i686-w64-mingw32-g++
LINKFLAGS = -O
USRLIB =
SYSLIB =
# ------ MAKE PROCEDURE ------
default: $(DIR) $(LIB)
$(DIR):
-mkdir $(DIR)
$(LIB): $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
@cp $(EXTRAMAKE) Makefile.lammps
# ------ COMPILE RULES ------
$(DIR)%.o:%.F
$(F90) $(F90FLAGS) -c $< -o $@
$(DIR)%.o:%.c
$(F90) $(F90FLAGS) -c $< -o $@
include .depend
# ------ CLEAN ------
clean:
-rm $(DIR)*.o $(DIR)*.mod *~ $(LIB)
-rmdir $(DIR)
tar:
-tar -cvf ../MEAM.tar $(FILES)

View File

@ -1,13 +0,0 @@
# -*- makefile -*- wrapper for non-MPI libraries
SHELL=/bin/sh
all:
$(MAKE) $(MFLAGS) mingw32-cross
-rm -f Obj_mingw32-mpi
ln -s Obj_mingw32 Obj_mingw32-mpi
clean:
$(MAKE) $(MFLAGS) clean-mingw32-cross
-rm -f Obj_mingw32-mpi

View File

@ -1,13 +0,0 @@
# -*- makefile -*- wrapper for non-MPI libraries
SHELL=/bin/sh
all:
$(MAKE) $(MFLAGS) mingw64-cross
-rm -f Obj_mingw64-mpi
ln -s Obj_mingw64 Obj_mingw64-mpi
clean:
$(MAKE) $(MFLAGS) clean-mingw64-cross
-rm -f Obj_mingw64-mpi

View File

@ -1,4 +1,4 @@
# * -*- makefile -*-
# *
# *_________________________________________________________________________*
# * MEAM: MODEFIED EMBEDDED ATOM METHOD *
# * DESCRIPTION: SEE READ-ME *
@ -11,7 +11,7 @@ SHELL = /bin/sh
# which file will be copied to Makefile.lammps
EXTRAMAKE = Makefile.lammps.gfortran
EXTRAMAKE = Makefile.lammps.empty
# ------ FILES ------
@ -21,49 +21,41 @@ FILES = $(SRC) Makefile
# ------ DEFINITIONS ------
DIR = Obj_mingw64/
LIB = $(DIR)libmeam.a
OBJ = $(SRC:%.F=$(DIR)%.o) $(DIR)fm_exp.o
LIB = libmeam.a
OBJ = $(SRC:.F=.o) fm_exp.o
# ------ SETTINGS ------
F90 = x86_64-w64-mingw32-gfortran
F90FLAGS = -O3 -march=core2 -mtune=core2 -msse2 -mpc64 \
-ffast-math -funroll-loops -fstrict-aliasing -J$(DIR) \
-Wall -W -Wno-uninitialized -fno-second-underscore
F90 = mpifort
CC = mpicc
F90FLAGS = -O3 -fPIC
#F90FLAGS = -O
ARCHIVE = x86_64-w64-mingw32-ar
ARCHFLAG = -rcs
LINK = x86_64-w64-mingw32-g++
ARCHIVE = ar
ARCHFLAG = -rc
LINK = mpicxx
LINKFLAGS = -O
USRLIB =
SYSLIB =
# ------ MAKE PROCEDURE ------
default: $(DIR) $(LIB)
$(DIR):
-mkdir $(DIR)
$(LIB): $(OBJ)
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ)
@cp $(EXTRAMAKE) Makefile.lammps
# ------ COMPILE RULES ------
$(DIR)%.o:%.F
$(F90) $(F90FLAGS) -c $< -o $@
%.o:%.F
$(F90) $(F90FLAGS) -c $<
$(DIR)%.o:%.c
$(F90) $(F90FLAGS) -c $< -o $@
%.o:%.c
$(CC) $(F90FLAGS) -c $<
include .depend
# ------ CLEAN ------
clean:
-rm $(DIR)*.o $(DIR)*.mod *~ $(LIB)
-rmdir $(DIR)
-rm *.o *.mod *~ $(LIB)
tar:
-tar -cvf ../MEAM.tar $(FILES)

1
lib/meam/Makefile.serial Symbolic link
View File

@ -0,0 +1 @@
Makefile.gfortran

Some files were not shown because too many files have changed in this diff Show More