Merge branch 'master' into report-uninstalled-pkg-style

# Conflicts:
#	cmake/CMakeLists.txt
This commit is contained in:
Axel Kohlmeyer 2019-04-08 17:16:30 -04:00
commit db74f14f33
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
29 changed files with 543 additions and 99 deletions

View File

@ -314,10 +314,15 @@ pkg_depends(USER-LB MPI)
pkg_depends(USER-PHONON KSPACE)
pkg_depends(USER-SCAFACOS MPI)
include(CheckIncludeFileCXX)
find_package(OpenMP QUIET)
option(BUILD_OMP "Build with OpenMP support" ${OpenMP_FOUND})
if(BUILD_OMP)
find_package(OpenMP REQUIRED)
check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE)
if(NOT HAVE_OMP_H_INCLUDE)
message(FATAL_ERROR "Cannot find required 'omp.h' header file")
endif()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
@ -436,7 +441,13 @@ else()
endif()
if(PKG_VORONOI)
option(DOWNLOAD_VORO "Download and compile the Voro++ library instead of using an already installed one" OFF)
find_package(VORO)
if(VORO_FOUND)
set(DOWNLOAD_VORO_DEFAULT OFF)
else()
set(DOWNLOAD_VORO_DEFAULT ON)
endif()
option(DOWNLOAD_VORO "Download and compile the Voro++ library instead of using an already installed one" ${DOWNLOAD_VORO_DEFAULT})
if(DOWNLOAD_VORO)
message(STATUS "Voro++ download requested - we will build our own")
include(ExternalProject)
@ -469,7 +480,13 @@ if(PKG_VORONOI)
endif()
if(PKG_LATTE)
option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" OFF)
find_package(LATTE)
if(LATTE_FOUND)
set(DOWNLOAD_LATTE_DEFAULT OFF)
else()
set(DOWNLOAD_LATTE_DEFAULT ON)
endif()
option(DOWNLOAD_LATTE "Download the LATTE library instead of using an already installed one" ${DOWNLOAD_LATTE_DEFAULT})
if(DOWNLOAD_LATTE)
if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR
message(FATAL_ERROR "For downlading LATTE you need at least cmake-3.7")
@ -480,7 +497,7 @@ if(PKG_LATTE)
URL https://github.com/lanl/LATTE/archive/v1.2.1.tar.gz
URL_MD5 85ac414fdada2d04619c8f936344df14
SOURCE_SUBDIR cmake
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> ${CMAKE_REQUEST_PIC} -DBLAS_LIBRARIES=${BLAS_LIBRARIES} -DLAPACK_LIBRARIES=${LAPACK_LIBRARIES}
)
ExternalProject_get_property(latte_build INSTALL_DIR)
set(LATTE_LIBRARIES ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/liblatte.a)
@ -496,7 +513,15 @@ endif()
if(PKG_USER-SCAFACOS)
find_package(GSL REQUIRED)
option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" OFF)
find_package(PkgConfig QUIET)
set(DOWNLOAD_SCAFACOS_DEFAULT ON)
if(PKG_CONFIG_FOUND)
pkg_check_modules(SCAFACOS QUIET scafacos)
if(SCAFACOS_FOUND)
set(DOWNLOAD_SCAFACOS_DEFAULT OFF)
endif()
endif()
option(DOWNLOAD_SCAFACOS "Download ScaFaCoS library instead of using an already installed one" ${DOWNLOAD_SCAFACOS_DEFAULT})
if(DOWNLOAD_SCAFACOS)
message(STATUS "ScaFaCoS download requested - we will build our own")
include(ExternalProject)
@ -536,8 +561,8 @@ if(PKG_USER-SCAFACOS)
list(APPEND LAMMPS_LINK_LIBS ${MPI_Fortran_LIBRARIES})
list(APPEND LAMMPS_LINK_LIBS ${MPI_C_LIBRARIES})
else()
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(SCAFACOS scafacos REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SCAFACOS REQUIRED scafacos)
list(APPEND LAMMPS_LINK_LIBS ${SCAFACOS_LDFLAGS})
endif()
include_directories(${SCAFACOS_INCLUDE_DIRS})
@ -551,7 +576,16 @@ if(PKG_USER-PLUMED)
validate_option(PLUMED_MODE PLUMED_MODE_VALUES)
string(TOUPPER ${PLUMED_MODE} PLUMED_MODE)
option(DOWNLOAD_PLUMED "Download Plumed package instead of using an already installed one" OFF)
find_package(PkgConfig QUIET)
set(DOWNLOAD_PLUMED_DEFAULT ON)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PLUMED QUIET plumed)
if(PLUMED_FOUND)
set(DOWNLOAD_PLUMED_DEFAULT OFF)
endif()
endif()
option(DOWNLOAD_PLUMED "Download Plumed package instead of using an already installed one" ${DOWNLOAD_PLUMED_DEFAULT})
if(DOWNLOAD_PLUMED)
if(BUILD_MPI)
set(PLUMED_CONFIG_MPI "--enable-mpi")
@ -596,7 +630,7 @@ if(PKG_USER-PLUMED)
set(PLUMED_INCLUDE_DIRS "${PLUMED_INSTALL_DIR}/include")
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(PLUMED plumed REQUIRED)
pkg_check_modules(PLUMED REQUIRED plumed)
if(PLUMED_MODE STREQUAL "STATIC")
add_definitions(-D__PLUMED_WRAPPER_CXX=1)
include(${PLUMED_LIBDIR}/plumed/src/lib/Plumed.cmake.static)
@ -630,7 +664,13 @@ if(PKG_USER-NETCDF)
endif()
if(PKG_USER-SMD)
option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" OFF)
find_package(Eigen3 NO_MODULE)
if(EIGEN3_FOUND)
set(DOWNLOAD_EIGEN3_DEFAULT OFF)
else()
set(DOWNLOAD_EIGEN3_DEFAULT ON)
endif()
option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" ${DOWNLOAD_EIGEN3_DEFAULT})
if(DOWNLOAD_EIGEN3)
message(STATUS "Eigen3 download requested - we will build our own")
include(ExternalProject)
@ -678,7 +718,13 @@ if(PKG_KIM)
list(APPEND LAMMPS_LINK_LIBS ${CURL_LIBRARIES})
add_definitions(-DLMP_KIM_CURL)
endif()
option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" OFF)
find_package(KIM-API QUIET)
if(KIM-API_FOUND)
set(DOWNLOAD_KIM_DEFAULT OFF)
else()
set(DOWNLOAD_KIM_DEFAULT ON)
endif()
option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" ${DOWNLOAD_KIM_DEFAULT})
if(DOWNLOAD_KIM)
message(STATUS "KIM-API download requested - we will build our own")
enable_language(C)
@ -699,10 +745,7 @@ if(PKG_KIM)
set(KIM-API_LDFLAGS ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libkim-api${CMAKE_SHARED_LIBRARY_SUFFIX})
list(APPEND LAMMPS_DEPS kim_build)
else()
find_package(KIM-API)
if(NOT KIM-API_FOUND)
message(FATAL_ERROR "KIM-API not found, help CMake to find it by setting PKG_CONFIG_PATH, or set DOWNLOAD_KIM=ON to download it")
endif()
find_package(KIM-API REQUIRED)
endif()
list(APPEND LAMMPS_LINK_LIBS "${KIM-API_LDFLAGS}")
include_directories(${KIM-API_INCLUDE_DIRS})
@ -740,7 +783,13 @@ endif()
if(PKG_MSCG)
find_package(GSL REQUIRED)
option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" OFF)
find_package(MSCG QUIET)
if(MSGC_FOUND)
set(DOWNLOAD_MSCG_DEFAULT OFF)
else()
set(DOWNLOAD_MSCG_DEFAULT ON)
endif()
option(DOWNLOAD_MSCG "Download MSCG library instead of using an already installed one)" ${DOWNLOAD_MSCG_DEFAULT})
if(DOWNLOAD_MSCG)
if (CMAKE_VERSION VERSION_LESS "3.7") # due to SOURCE_SUBDIR
message(FATAL_ERROR "For downlading MSCG you need at least cmake-3.7")
@ -789,7 +838,6 @@ endif()
########################################################################
# Basic system tests (standard libraries, headers, functions, types) #
########################################################################
include(CheckIncludeFileCXX)
foreach(HEADER cmath)
check_include_file_cxx(${HEADER} FOUND_${HEADER})
if(NOT FOUND_${HEADER})
@ -1444,6 +1492,15 @@ if(BUILD_EXE)
if(ENABLE_TESTING)
add_test(ShowHelp ${LAMMPS_BINARY} -help)
endif()
enable_language(C)
get_filename_component(MSI2LMP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../tools/msi2lmp/src ABSOLUTE)
file(GLOB MSI2LMP_SOURCES ${MSI2LMP_SOURCE_DIR}/[^.]*.c)
add_executable(msi2lmp ${MSI2LMP_SOURCES})
target_link_libraries(msi2lmp m)
install(TARGETS msi2lmp DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${LAMMPS_DOC_DIR}/msi2lmp.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif()
###############################################################################
@ -1507,11 +1564,14 @@ if(BUILD_DOC)
endif()
###############################################################################
# Install potential files in data directory
# Install potential and force field files in data directory
###############################################################################
set(LAMMPS_POTENTIALS_DIR ${CMAKE_INSTALL_FULL_DATADIR}/lammps/potentials)
install(DIRECTORY ${LAMMPS_SOURCE_DIR}/../potentials/ DESTINATION ${LAMMPS_POTENTIALS_DIR})
set(LAMMPS_FRC_FILES_DIR ${CMAKE_INSTALL_FULL_DATADIR}/lammps/frc_files)
install(DIRECTORY ${LAMMPS_SOURCE_DIR}/../tools/msi2lmp/frc_files/ DESTINATION ${LAMMPS_FRC_FILES_DIR})
configure_file(etc/profile.d/lammps.sh.in ${CMAKE_BINARY_DIR}/etc/profile.d/lammps.sh @ONLY)
configure_file(etc/profile.d/lammps.csh.in ${CMAKE_BINARY_DIR}/etc/profile.d/lammps.csh @ONLY)
install(

View File

@ -36,14 +36,23 @@
# KIM-API-CMAKE_CXX_COMPILER
# KIM-API-CMAKE_Fortran_COMPILER
#
find_package(PkgConfig REQUIRED)
if(KIM-API_FIND_QUIETLY)
set(REQ_OR_QUI "QUIET")
else()
set(REQ_OR_QUI "REQUIRED")
endif()
find_package(PkgConfig ${REQ_OR_QUI})
include(FindPackageHandleStandardArgs)
pkg_check_modules(KIM-API REQUIRED libkim-api>=2.0)
pkg_check_modules(KIM-API ${REQ_OR_QUI} libkim-api>=2.0)
pkg_get_variable(KIM-API-V2-CMAKE_C_COMPILER libkim-api CMAKE_C_COMPILER)
pkg_get_variable(KIM-API-V2-CMAKE_CXX_COMPILER libkim-api CMAKE_CXX_COMPILER)
pkg_get_variable(KIM-API-V2_CMAKE_Fortran_COMPILER libkim-api CMAKE_Fortran_COMPILER)
if(KIM-API_FOUND)
pkg_get_variable(KIM-API-CMAKE_C_COMPILER libkim-api CMAKE_C_COMPILER)
pkg_get_variable(KIM-API-CMAKE_CXX_COMPILER libkim-api CMAKE_CXX_COMPILER)
pkg_get_variable(KIM-API_CMAKE_Fortran_COMPILER libkim-api CMAKE_Fortran_COMPILER)
endif()
# handle the QUIETLY and REQUIRED arguments and set KIM-API_FOUND to TRUE
# if all listed variables are TRUE

View File

@ -1,2 +1,4 @@
# set environment for LAMMPS executables to find potential files
# set environment for LAMMPS and msi2lmp executables
# to find potential and force field files
if ( "$?LAMMPS_POTENTIALS" == 0 ) setenv LAMMPS_POTENTIALS @LAMMPS_POTENTIALS_DIR@
if ( "$?MSI2LMP_LIBRARY" == 0 ) setenv MSI2LMP_LIBRARY @LAMMPS_FRC_FILES_DIR@

View File

@ -1,2 +1,5 @@
# set environment for LAMMPS executables to find potential files
export LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS-@LAMMPS_POTENTIALS_DIR@}
# set environment for LAMMPS and msi2lmp executables
# to find potential and force field files
LAMMPS_POTENTIALS=${LAMMPS_POTENTIALS-@LAMMPS_POTENTIALS_DIR@}
MSI2LMP_LIBRARY=${MSI2LMP_LIBRARY-@LAMMPS_FRC_FILES_DIR@}
export LAMMPS_POTENTIALS MSI2LMP_LIBRARY

17
cmake/presets/clang.cmake Normal file
View File

@ -0,0 +1,17 @@
# preset that will enable clang/clang++ with support for MPI and OpenMP (on Linux boxes)
set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE)
set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -g -O2 -DNDEBG" CACHE STRING "" FORCE)
set(MPI_CXX "clang++" CACHE STRING "" FORCE)
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
unset(HAVE_OMP_H_INCLUDE CACHE)
set(OpenMP_C "clang" CACHE STRING "" FORCE)
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
set(OpenMP_CXX "clang++" CACHE STRING "" FORCE)
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
set(OpenMP_omp_LIBRARY "/usr/lib64/libomp.so" CACHE PATH "" FORCE)

View File

@ -1,40 +1,259 @@
.TH LAMMPS "2018-08-22"
.TH LAMMPS "11 April 2019" "2019-04-11"
.SH NAME
.B LAMMPS
\- Molecular Dynamics Simulator.
.SH SYNOPSIS
.B lmp
-in in.file
.B lmp
\-in <input file> [OPTIONS] ...
or
mpirun \-np 2
.B lmp
-in in.file
mpirun \-np 2
.B lmp
<input file> [OPTIONS] ...
or
.B lmp
\-r2data file.restart file.data
.SH DESCRIPTION
.B LAMMPS
LAMMPS is a classical molecular dynamics code, and an acronym for Large-scale
Atomic/Molecular Massively Parallel Simulator. LAMMPS has potentials for soft
materials (biomolecules, polymers) and solid-state materials (metals,
semiconductors) and coarse-grained or mesoscopic systems. It can be used to
model atoms or, more generically, as a parallel particle simulator at the
.B LAMMPS
is a classical molecular dynamics code, and an acronym for \fBL\fRarge-scale
\fBA\fRtomic/\fBM\fRolecular \fBM\fRassively \fBP\fRarallel \fBS\fRimulator.
.B LAMMPS
has potentials for soft
materials (bio-molecules, polymers) and solid-state materials (metals,
semiconductors) and coarse-grained or mesoscopic systems. It can be used to
model atoms or, more generically, as a parallel particle simulator at the
atomic, meso, or continuum scale.
See http://lammps.sandia.gov/ for documentation.
See https://lammps.sandia.gov/ for more information and documentation.
.SH EXECUTABLE NAME
The
.B LAMMPS
executable can have different names depending on how it was configured,
compiled and installed. It will be either
.B lmp
or
.B lmp_<machine name>.
The <machine name> suffix corresponds to the (machine specific) makefile
used to compile
.B LAMMPS
when using the conventional build process. When building
.B LAMMPS
using
.B CMake
this <machine name> parameter can be chosen arbitrarily at configuration
time, but more common is to just use
.B lmp
without a suffix. In this manpage we will use
.B lmp
to represent any of those names.
.SH OPTIONS
See https://lammps.sandia.gov/doc/Run_options.html for details on
command-line options.
.SH COPYRIGHT
© 2003--2018 Sandia Corporation
.TP
\fB\-h\fR or \fB\-help\fR
Print a brief help summary and a list of settings and options compiled
into this executable. It also explicitly lists all LAMMPS styles
(atom_style, fix, compute, pair_style, bond_style, etc) available in
the specific executable. This can tell you if the command you want to
use was included via the appropriate package at compile time.
LAMMPS will print the info and immediately exit if this switch is used.
.TP
\fB\-e\fR or \fB\-echo\fR
Set the style of command echoing. The style can be
.B none
or
.B screen
or
.B log
or
.B both.
Depending on the style, each command read from the input script will
be echoed to the screen and/or logfile. This can be useful to figure
out which line of your script is causing an input error.
The default value is
.B log.
.TP
\fB\-i <input file>\fR or \fB\-in <input file>\fR
Specify a file to use as an input script. If it is not specified,
LAMMPS reads its script from standard input. This is a required
switch when running LAMMPS in multi-partition mode.
.TP
\fB\-k on/off [keyword value]\fR or \fB\-kokkos on/off [keyword value]\fR
Enable or disable general KOKKOS support, as provided by the KOKKOS
package. Even if LAMMPS is built with this package, this switch must
be set to \fBon\fR to enable running with KOKKOS-enabled styles. More
details on this switch and its optional keyword value pairs are discussed
at: https://lammps.sandia.gov/doc/Run_options.html
.TP
\fB\-l <log file>\fR or \fB\-log <log file>\fR
Specify a log file for LAMMPS to write status information to.
The default value is "log.lammps". If the file name "none" is used,
\fBLAMMPS\fR will not write a log file. In multi-partition mode only
some high-level all-partition information is written to the "<log file>"
file, the remainder is written in a per-partition file "<log file>.N"
with "N" being the respective partition number, unless overridden
by the \-plog flag (see below).
.TP
\fB\-m <number>\fR or \fB\-mpicolor <number>\fR
If used, this must be the first command-line argument after the
.B LAMMPS
executable name. It is only used when
.B LAMMPS
is launched by an mpirun command which also launches one or more
other executable(s) at the same time.
.B LAMMPS
and the other executable(s) perform an MPI_Comm_split(), each with
their own different colors, to split the MPI_COMM_WORLD communicator
for each executable to the subset of processors they are supposed to
be actually running on. Currently, this is only used in
.B LAMMPS
to perform client/server messaging with another application.
.B LAMMPS
can act as either a client or server (or both).
.TP
\fB\-nc\fR or \fB\-nocite\fR
Disable writing the "log.cite" file which is normally written to
list references for specific cite-able features used during a
.B LAMMPS
run.
.TP
\fB\-pk <style> [options]\fR or \fB\-package <style> [options]\fR
Invoke the \fBpackage\R command with <style> and optional arguments.
The syntax is the same as if the command appeared in an input script.
For example "-pk gpu 2" is the same as "package gpu 2" in the input
script. The possible styles and options are discussed in the
.B LAMMPS
manual for the "package" command. This switch can be used multiple
times, e.g. to set options for the USER-INTEL and USER-OMP packages
when used together. Along with the "-sf" or "-suffix" switch, this
is a convenient mechanism for invoking accelerator packages and their
options without having to edit an input script.
.TP
\fB\-p\fR or \fB\-partition\fR
Invoke
.B LAMMPS
in multi-partition mode. Without this,
.B LAMMPS
uses all P processors allocated via MPI to run a single simulation.
If this switch is used, the P processors are split into separate
partitions and each partition runs its own simulation. The arguments
to the switch specify the number of processors in each partition.
Arguments of the form "MxN" mean M partitions, each with N processors.
Arguments of the form "N" mean a single partition with N processors.
The sum of processors in all partitions must be equal P. Thus the
command “-partition 8x2 4 5” has 10 partitions and runs on a total
of 25 processors. Running with multiple partitions is required for
multi-replica simulations, where each replica runs on on one or more
few processors.
.TP
\fB\-pl <basename>\fR or \fB\-plog <basename>\fR
Specify the base name for the per-partition log files in multi-partition
runs, where partition N writes log information to <basename>.N.
If basename is set to "none", then no per-partition log files are created.
This overrides the name specified in the \-log command-line option.
.TP
\fB\-ps <basename>\fR or \fB\-pscreen <basename>\fR
Specify the base name for the per-partition screen files in multi-partition
runs, where partition N writes screen output to <basename>.N.
If basename is set to "none", then no per-partition screen files are created.
The default value is "screen" or whatever is set by the \-screen flag.
.TP
\fB\-r2data <restart file> [remap] <data file>\fR or
\fB\-restart2data <restart file> [remap] <data file>\fR
Convert <restart file> previously written by
.B LAMMPS
into a data file and immediately exit. This option has replaced the
external restart2data executable. Following <restart file>
argument, the optional word "remap" may be used. This has the
same effect like adding it to a "read_restart" command.
The syntax following the <data file> name is identical to the
arguments of the "write_data" command. See the
.B LAMMPS
manual for details on either of the two commands.
.TP
\fB\-r2dump <restart file> [remap] <dump file>\fR or
\fB\-restart2dump <restart file> [remap] <dump file>\fR
Convert <restart file> previously written by
.B LAMMPS
into a dump file and immediately exit. Following <restart file>
argument, the optional word "remap" may be used. This has the
same effect like adding it to a "read_restart" command.
The syntax following the <dump file> name is identical to the
arguments of the "dump" command. See the
.B LAMMPS
manual for details on either of the two commands.
.TP
\fB\-sc <file name>\fR or \fB\-screen <file name>\fR
Specify a file for
.B LAMMPS
to write its screen information to. By default, this will be
the standard output. If <file name> is "none", (most) screen
output will be suppressed. In multi-partition mode only
some high-level all-partition information is written to the
screen or "<file name>" file, the remainder is written in a
per-partition file "screen.N" or "<file name>.N"
with "N" being the respective partition number, and unless
overridden by the \-pscreen flag (see above).
.TP
\fB\-sf <suffix>\fR or \fB\-suffix <suffix>\fR
Use variants of various styles in the input, if they exist. This is
achieved by transparently trying to convert a style named <my/style>
into <my/style/suffix> if that latter style exists, but otherwise
fall back to the former. The most useful suffixes are "gpu",
"intel", "kk", "omp", "opt", or "hybrid". These refer to styles from
optional packages that LAMMPS can be built with. The hybrid suffix is
special, as it enables, having two suffixes tried (e.g. first "intel"
and then "omp") and thus requires two arguments. Along with the
"-package" command-line switch, this is a convenient mechanism for
invoking styles from accelerator packages and setting their options
without having to edit an input script.
See https://lammps.sandia.gov/doc/Run_options.html for additional
details and discussions on command-line options.
.SH LAMMPS BASICS
LAMMPS executes by reading commands from a input script (text file),
one line at a time. When the input script ends, LAMMPS exits. Each
command causes LAMMPS to take some action. It may set or change an
internal, read and parse a file, or run a simulation. Most commands
have default settings, which means you only need to use the command
if you wish to change the default.
The ordering of commands in an input script is usually not very important
unless a command like "run" is encountered, which starts some calculation
using the current internal state. Also, if a "pair_style" or "bond_style"
other similar style command is issued that has a different name from what
was previously active, it will replace the previous style and wipe out
all corresponding "pair_coeff" or "bond_coeff" or equivalent settings.
Some commands are only valid when they follow other commands. For
example you cannot set the temperature of a group of atoms until atoms
have been defined and a group command is used to define which atoms
belong to the group of a given name. Sometimes command B will use values
that can be set by command A. This means command A must precede command
B in the input to have the desired effect. Some commands must be issued
.B before
the simulation box is defined and others can only be issued
.B after.
Many input script errors are detected by
.B LAMMPS
and an ERROR or WARNING message is printed. The documentation for
each command lists restrictions on how the command can be used, and
the chapter on errors in the
.B LAMMPS
manual gives some additional information about error messages, if possible.
.SH COPYRIGHT
© 2003--2019 Sandia Corporation
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of

111
doc/msi2lmp.1 Normal file
View File

@ -0,0 +1,111 @@
.TH MSI2LMP "v3.9.9" "2018-11-05"
.SH NAME
.B MSI2LMP
\- Converter for Materials Studio files to LAMMPS
.SH SYNOPSIS
.B msi2lmp
<ROOTNAME> [-class <I|1|II|2|O|0>] [-frc <path to frc file>] [-print #] [-ignore] [-nocenter] [-oldstyle] [-shift <x> <y> <z>]
.SH DESCRIPTION
.PP
.B MSI2LMP
is a tool bundled with LAMMPS to aide in the conversion of simulation
inputs from Biovia's Materials Studio software for use with LAMMPS.
It is a standalone program that generates a LAMMPS data file based on
the information in an MS .car file (atom coordinates), an .mdf file
(molecular topology and atom types) and an .frc (forcefield parameters)
file. The .car and .mdf files are specific to a molecular system while
the .frc file is specific to a forcefield (variant). The only coherency
needed between .frc and .car/.mdf files are the atom types.
.PP
.SH OPTIONS
.TP
\fB\<ROOTNAME>\fR
This has to be the first argument and is a
.B mandatory
argument. It defines the root of the file names; i.e. for a
.B <ROOTNAME>
of benzene, you have to provide the files 'benzene.car' and 'benzene.mdf'
in the current working directory.
.B msi2lmp
will then read and process those files according to its remaining settings.
All other settins are optional and have defaults as listed.
.TP
\fB\-c <I,1,II,2,O,0>\fR, \fB\-class <I,1,II,2,O,0>\fR
The \-c or \-class option selects the force field class, i.e which pair
styles and bond styles and so on are required in the LAMMPS input file.
Class I or class 1 uses similar combination of functional forms as Amber
and Charmm force field and support the force fields
.B cvff
and
.B clayff.
Class II or class 2 corresponds to the more complex force fields
.B COMPASS
and
.B pcff.
Class O or class 0 finally is an experimental and incomplete extension
and supports generating output for
.B OPLS-AA
.TP
\fB\-f <ffname>\fR, \fB\-frc <ffname>\fR
The \-c or \-frc option allows the selection of the force field parameter
file
.B<ffname>.frc.
Valid names for <ffname> with this distribution are: cvff, clayff, cvff_aug,
pcff, compass_published, cff91, and oplsaa. If the argument is a pathname,
i.e. it starts with a '.' or a '/', then this absolute path is used to read
the force field, otherwise
.B msi2lmp
will look in the folder pointed to by the environment variable
$MSI2LMP_LIBRARY. If the variable is not set, then it will look in the current
directory. The extension '.frc' is appended, if missing.
Default is to look for the cvff.frc force field file.
.TP
\fB\-p <loglevel>\fR, \fB\-print <loglevel>\fR,
Selects the amount of information messages about the progress of the
conversion printed to the screen.
.B <loglevel>
can be a number from 0 (silent except for errors) to 3 (very detailed).
.TP
\fB\-i\fR, \fB\-ignore\fR,
Ignore errors about missing parameters and use 0.0 for the respective
force constants making these no-ops. Is correct to be used for a few
molecules and settings, but often an indication, that either the atom
type assignment have errors, or the force field file is missing entries.
.TP
\fB\-n\fR, \fB\-nocenter\fR,
Do not center the box around the (geometrical) center of the atoms,
but around the origin. Default is to recenter.
.TP
\fB\-o\fR, \fB\-oldstyle\fR,
Write out a data file without style hint comments to be compatible
with old LAMMPS versions. Default is to write out those comments.
.TP
\fB-s <x> <y> <z>\fR, \fB-shift <x> <y> <z>\fR,
Shift the entire system (box and coordinates) by a vector
(default: 0.0 0.0 0.0).
.TP
.SH EXAMPLES
msi2lmp benzene -c 2 -p 1 -f ../frc_files/pcff.frc
msi2lmp benzene-class1 -c I
msi2lmp decane -c 0 -f oplsaa
.SH COPYRIGHT
© 2003--2019 Sandia Corporation
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

View File

@ -159,6 +159,8 @@ cmake -C ../cmake/presets/most.cmake \[OPTIONS\] ../cmake |
enable most common packages |
cmake -C ../cmake/presets/nolib.cmake \[OPTIONS\] ../cmake |
disable packages that do require extra libraries or tools |
cmake -C ../cmake/presets/clang.cmake \[OPTIONS\] ../cmake |
change settings to use the Clang compilers by default |
cmake -C ../cmake/presets/mingw.cmake \[OPTIONS\] ../cmake |
enable all packages compatible with MinGW compilers :tb(c=2,s=|,a=l)

View File

@ -79,7 +79,7 @@ stdin.
Explicitly enable or disable KOKKOS support, as provided by the KOKKOS
package. Even if LAMMPS is built with this package, as described
in "Speed kokkos"_Speed_kokkos.html, this switch must be set to enable
running with the KOKKOS-enabled styles the package provides. If the
running with KOKKOS-enabled styles the package provides. If the
switch is not set (the default), LAMMPS will operate as if the KOKKOS
package were not installed; i.e. you can run standard LAMMPS or with
the GPU or USER-OMP packages, for testing or benchmarking purposes.
@ -448,7 +448,7 @@ partition screen files file.N.
[-suffix style args] :link(suffix)
Use variants of various styles if they exist. The specified style can
be {cuda}, {gpu}, {intel}, {kk}, {omp}, {opt}, or {hybrid}. These
be {gpu}, {intel}, {kk}, {omp}, {opt}, or {hybrid}. These
refer to optional packages that LAMMPS can be built with, as described
in "Accelerate performance"_Speed.html. The "gpu" style corresponds to the
GPU package, the "intel" style to the USER-INTEL package, the "kk"

View File

@ -357,6 +357,13 @@ The {meam/c} style is provided in the USER-MEAMC package. It is
only enabled if LAMMPS was built with that package.
See the "Build package"_Build_package.html doc page for more info.
The maximum number of elements, that can be read from the MEAM
library file, is determined at compile time. The default is 5.
If you need support for more elements, you have to change the
define for the constant 'maxelt' at the beginning of the file
src/USER-MEAMC/meam.h and update/recompile LAMMPS. There is no
limit on the number of atoms types.
[Related commands:]
"pair_coeff"_pair_coeff.html, "pair_style eam"_pair_eam.html,

View File

@ -349,6 +349,7 @@ Cii
Cij
cis
civ
Clang
clearstore
Cleary
Clebsch
@ -1543,6 +1544,7 @@ Mattox
Mattson
maxangle
maxbond
maxelt
maxeval
maxfiles
Maxfoo

View File

@ -52,7 +52,7 @@
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Designed for use with the kim-api-v2-2.0.0 (and newer) package
Designed for use with the kim-api-2.0.2 (and newer) package
------------------------------------------------------------------------- */
#include <mpi.h>

View File

@ -51,7 +51,7 @@
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Designed for use with the kim-api-v2-2.0.0 (and newer) package
Designed for use with the kim-api-2.0.2 (and newer) package
------------------------------------------------------------------------- */
#ifdef COMMAND_CLASS

View File

@ -50,7 +50,7 @@
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Designed for use with the kim-api-v2-2.0.0 (and newer) package
Designed for use with the kim-api-2.0.2 (and newer) package
------------------------------------------------------------------------- */
#include <cstring>
@ -189,8 +189,6 @@ void PairKIM::set_contributing()
void PairKIM::compute(int eflag , int vflag)
{
int kimerror;
ev_init(eflag,vflag);
// grow kim_particleSpecies and kim_particleContributing array if necessary
@ -238,7 +236,7 @@ void PairKIM::compute(int eflag , int vflag)
lmps_local_tot_num_atoms = (int) nall;
// compute via KIM model
kimerror = KIM_Model_Compute(pkim, pargs);
int kimerror = KIM_Model_Compute(pkim, pargs);
if (kimerror) error->all(FLERR,"KIM Compute returned error");
// compute virial before reverse comm!
@ -313,7 +311,7 @@ void PairKIM::settings(int narg, char **arg)
(0 == strcmp("LAMMPSvirial", arg[0]))))
{
error->all(FLERR,"'KIMvirial' or 'LAMMPSvirial' not supported with "
"kim-api-v2.");
"kim-api.");
}
else
error->all(FLERR,"Illegal pair_style command");
@ -434,10 +432,9 @@ void PairKIM::coeff(int narg, char **arg)
kim_particle_codes = new int[lmps_num_unique_elements];
kim_particle_codes_ok = true;
for(int i = 0; i < lmps_num_unique_elements; i++){
int kimerror;
int supported;
int code;
kimerror = KIM_Model_GetSpeciesSupportAndCode(
KIM_Model_GetSpeciesSupportAndCode(
pkim,
KIM_SpeciesName_FromString(lmps_unique_elements[i]),
&supported,
@ -468,8 +465,6 @@ void PairKIM::init_style()
if (domain->dimension != 3)
error->all(FLERR,"PairKIM only works with 3D problems");
int kimerror;
// setup lmps_stripped_neigh_list for neighbors of one atom, if needed
if (lmps_using_molecular) {
memory->destroy(lmps_stripped_neigh_list);
@ -676,9 +671,9 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf)
va[j*6+4]+=buf[m++];
va[j*6+5]+=buf[m++];
}
} else {
; // do nothing
}
else
;// do nothing
return;
}
@ -720,11 +715,8 @@ int PairKIM::get_neigh(void const * const dataObject,
*numberOfNeighbors = 0;
NeighList * neiobj = Model->neighborLists[neighborListIndex];
int nAtoms = Model->lmps_local_tot_num_atoms;
int j, jj, inum, *ilist, *numneigh, **firstneigh;
inum = neiobj->inum; //# of I atoms neighbors are stored for
ilist = neiobj->ilist; //local indices of I atoms
int *numneigh, **firstneigh;
numneigh = neiobj->numneigh; // # of J neighbors for each I atom
firstneigh = neiobj->firstneigh; // ptr to 1st J int value of each I atom
@ -750,8 +742,6 @@ int PairKIM::get_neigh(void const * const dataObject,
void PairKIM::kim_free()
{
int kimerror;
if (kim_init_ok)
{
int kimerror = KIM_Model_ComputeArgumentsDestroy(pkim, &pargs);
@ -1043,10 +1033,10 @@ void PairKIM::set_kim_model_has_flags()
for (int i = 0; i < numberOfComputeArgumentNames; ++i)
{
KIM_ComputeArgumentName computeArgumentName;
int kimerror = KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName(
KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName(
i, &computeArgumentName);
KIM_SupportStatus supportStatus;
kimerror = KIM_ComputeArguments_GetArgumentSupportStatus(
KIM_ComputeArguments_GetArgumentSupportStatus(
pargs, computeArgumentName, &supportStatus);
if (KIM_ComputeArgumentName_Equal(computeArgumentName,
@ -1105,10 +1095,10 @@ void PairKIM::set_kim_model_has_flags()
for (int i = 0; i < numberOfComputeCallbackNames; ++i)
{
KIM_ComputeCallbackName computeCallbackName;
int kimerror = KIM_COMPUTE_CALLBACK_NAME_GetComputeCallbackName(
KIM_COMPUTE_CALLBACK_NAME_GetComputeCallbackName(
i, &computeCallbackName);
KIM_SupportStatus supportStatus;
kimerror = KIM_ComputeArguments_GetCallbackSupportStatus(
KIM_ComputeArguments_GetCallbackSupportStatus(
pargs, computeCallbackName, &supportStatus);
if (KIM_SupportStatus_Equal(supportStatus, KIM_SUPPORT_STATUS_required))

View File

@ -50,7 +50,7 @@
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Designed for use with the kim-api-v2-2.0.0 (and newer) package
Designed for use with the kim-api-2.0.2 (and newer) package
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
@ -182,9 +182,9 @@ E: KIM Compute returned error
The KIM model was unable, for some reason, to complete the computation.
E: 'KIMvirial' or 'LAMMPSvirial' not supported with kim-api-v2.
E: 'KIMvirial' or 'LAMMPSvirial' not supported with kim-api.
"KIMvirial or "LAMMPSvirial" found on the pair_style line. These keys are not supported kim-api-v2. (The virial computation is always performed by LAMMPS.) Please remove these keys, make sure the KIM model you are using supports kim-api-v2, and rerun.
"KIMvirial or "LAMMPSvirial" found on the pair_style line. These keys are not supported kim-api. (The virial computation is always performed by LAMMPS.) Please remove these keys, make sure the KIM model you are using supports kim-api, and rerun.
E: Illegal pair_style command

View File

@ -1390,7 +1390,7 @@ void FixShake::shake_info(int *npartner, tagint **partner_tag,
------------------------------------------------------------------------- */
int FixShake::rendezvous_ids(int n, char *inbuf,
int &flag, int *&proclist, char *&outbuf,
int &flag, int *& /*proclist*/, char *& /*outbuf*/,
void *ptr)
{
FixShake *fsptr = (FixShake *) ptr;

View File

@ -226,6 +226,9 @@ void PairMEAMC::coeff(int narg, char **arg)
}
nelements = narg - 4 - atom->ntypes;
if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients");
if (nelements > maxelt)
error->all(FLERR,"Too many elements extracted from MEAM library. "
"Increase 'maxelt' in meam.h and recompile.");
elements = new char*[nelements];
mass = new double[nelements];

View File

@ -196,6 +196,10 @@ void PairReaxCOMP::compute(int eflag, int vflag)
if (vflag_global) control->virial = 1;
else control->virial = 0;
if (vflag_atom)
error->all(FLERR,"Pair style reax/c/omp does not support "
"computing per-atom stress");
system->n = atom->nlocal; // my atoms
system->N = atom->nlocal + atom->nghost; // mine + ghosts
system->bigN = static_cast<int> (atom->natoms); // all atoms in the system

View File

@ -262,8 +262,8 @@ void Compute_Total_ForceOMP( reax_system *system, control_params *control,
/* ---------------------------------------------------------------------- */
void Validate_ListsOMP( reax_system *system, storage * /*workspace */, reax_list **lists,
int step, int n, int N, int numH, MPI_Comm comm )
void Validate_ListsOMP(reax_system *system, storage * /*workspace*/, reax_list **lists,
int step, int n, int N, int numH, MPI_Comm /*comm*/)
{
int i, comp, Hindex;
reax_list *bonds, *hbonds;

View File

@ -213,9 +213,9 @@ void vdW_Coulomb_Energy_OMP( reax_system *system, control_params *control,
rvec_ScaledSum( delij, 1., system->my_atoms[i].x,
-1., system->my_atoms[j].x );
f_tmp = -(CEvd + CEclmb);
pair_reax_ptr->ev_tally_thr_proxy( system->pair_ptr, i, j, natoms,
1, pe_vdw, e_ele, f_tmp,
delij[0], delij[1], delij[2], thr);
pair_reax_ptr->ev_tally_thr_proxy(system->pair_ptr, i, j, natoms,
1, pe_vdw, e_ele, f_tmp,
delij[0], delij[1], delij[2], thr);
}
if (control->virial == 0) {

View File

@ -76,8 +76,10 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp)
system = (reax_system *)
memory->smalloc(sizeof(reax_system),"reax:system");
memset(system,0,sizeof(reax_system));
control = (control_params *)
memory->smalloc(sizeof(control_params),"reax:control");
memset(control,0,sizeof(control_params));
data = (simulation_data *)
memory->smalloc(sizeof(simulation_data),"reax:data");
workspace = (storage *)
@ -87,6 +89,7 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp)
memset(lists,0,LIST_N * sizeof(reax_list));
out_control = (output_controls *)
memory->smalloc(sizeof(output_controls),"reax:out_control");
memset(out_control,0,sizeof(output_controls));
mpi_data = (mpi_datatypes *)
memory->smalloc(sizeof(mpi_datatypes),"reax:mpi");

View File

@ -156,7 +156,7 @@ int Init_MPI_Datatypes( reax_system *system, storage * /*workspace*/,
int Init_Lists( reax_system *system, control_params *control,
simulation_data * /*data*/, storage * /*workspace*/, reax_list **lists,
mpi_datatypes *mpi_data, char * /*msg*/ )
mpi_datatypes * /*mpi_data*/, char * /*msg*/ )
{
int i, total_hbonds, total_bonds, bond_cap, num_3body, cap_3body, Htop;
int *hb_top, *bond_top;
@ -219,8 +219,6 @@ void Initialize( reax_system *system, control_params *control,
mpi_datatypes *mpi_data, MPI_Comm comm )
{
char msg[MAX_STR];
char errmsg[128];
if (Init_MPI_Datatypes(system, workspace, mpi_data, comm, msg) == FAILURE) {
control->error_ptr->one(FLERR,"Could not create datatypes");

View File

@ -92,13 +92,15 @@ int Close_Output_Files( reax_system *system, control_params *control,
End_Traj( system->my_rank, out_control );
if (system->my_rank == MASTER_NODE) {
if (out_control->energy_update_freq > 0) {
if (out_control->pot) {
fclose( out_control->pot );
out_control->pot = NULL;
}
if( control->ensemble == NPT || control->ensemble == iNPT ||
control->ensemble == sNPT )
fclose( out_control->prs );
if (out_control->prs) {
fclose(out_control->prs);
out_control->prs = NULL;
}
}
return SUCCESS;
@ -122,7 +124,7 @@ void Output_Results( reax_system *system, control_params *control,
out_control->energy_update_freq > 0 &&
data->step % out_control->energy_update_freq == 0 ) {
if (control->virial) {
if (control->virial && out_control->prs) {
fprintf( out_control->prs,
"%8d%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f\n",
data->step,

View File

@ -58,7 +58,7 @@ void Write_Skip_Line( output_controls *out_control, mpi_datatypes * /*mpi_data*/
int Write_Header( reax_system *system, control_params *control,
output_controls *out_control, mpi_datatypes *mpi_data )
output_controls *out_control, mpi_datatypes * /*mpi_data*/ )
{
int num_hdr_lines, my_hdr_lines, buffer_req;
char ensembles[ens_N][25] = { "NVE", "NVT", "fully flexible NPT",
@ -357,7 +357,7 @@ int Init_Traj( reax_system *system, control_params *control,
int Write_Frame_Header( reax_system *system, control_params *control,
simulation_data *data, output_controls *out_control,
mpi_datatypes *mpi_data )
mpi_datatypes * /*mpi_data*/ )
{
int me, num_frm_hdr_lines, my_frm_hdr_lines, buffer_req;

View File

@ -642,7 +642,7 @@ void ComputeVoronoi::compute_local()
/* ---------------------------------------------------------------------- */
int ComputeVoronoi::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int /* pbc_flag */, int * /* pbc */)
{
int i,m=0;
for (i = 0; i < n; ++i) buf[m++] = rfield[list[i]];

View File

@ -72,7 +72,9 @@ void Error::universe_all(const char *file, int line, const char *str)
#ifdef LAMMPS_EXCEPTIONS
// allow commands if an exception was caught in a run
update->whichflag = 0;
// update may be NULL when catching command line errors
if (update) update->whichflag = 0;
char msg[100];
snprintf(msg, 100, "ERROR: %s (%s:%d)\n", str, truncpath(file), line);
@ -97,7 +99,9 @@ void Error::universe_one(const char *file, int line, const char *str)
#ifdef LAMMPS_EXCEPTIONS
// allow commands if an exception was caught in a run
update->whichflag = 0;
// update may be NULL when catching command line errors
if (update) update->whichflag = 0;
char msg[100];
snprintf(msg, 100, "ERROR: %s (%s:%d)\n", str, truncpath(file), line);
@ -148,7 +152,9 @@ void Error::all(const char *file, int line, const char *str)
#ifdef LAMMPS_EXCEPTIONS
// allow commands if an exception was caught in a run
update->whichflag = 0;
// update may be NULL when catching command line errors
if (update) update->whichflag = 0;
char msg[100];
snprintf(msg, 100, "ERROR: %s (%s:%d)\n", str, truncpath(file), line);
@ -198,7 +204,9 @@ void Error::one(const char *file, int line, const char *str)
#ifdef LAMMPS_EXCEPTIONS
// allow commands if an exception was caught in a run
update->whichflag = 0;
// update may be NULL when catching command line errors
if (update) update->whichflag = 0;
char msg[100];
snprintf(msg, 100, "ERROR on proc %d: %s (%s:%d)\n", me, str, truncpath(file), line);

View File

@ -40,7 +40,7 @@ using namespace LAMMPS_NS;
#define MAX_GROUP 32
#define EPSILON 1.0e-6
enum{TYPE,MOLECULE,ID};
enum{NONE,TYPE,MOLECULE,ID};
enum{LT,LE,GT,GE,EQ,NEQ,BETWEEN};
#define BIG 1.0e20
@ -202,7 +202,7 @@ void Group::assign(int narg, char **arg)
if (narg < 3) error->all(FLERR,"Illegal group command");
int category;
int category=NONE;
if (strcmp(arg[1],"type") == 0) category = TYPE;
else if (strcmp(arg[1],"molecule") == 0) category = MOLECULE;
else if (strcmp(arg[1],"id") == 0) category = ID;

View File

@ -477,7 +477,7 @@ class Memory : protected Pointers {
}
template <typename TYPE>
TYPE *****grow(TYPE *****&array, int n1, int n2, int n3, int n4,
TYPE *****grow(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/,
const char *name)
{
fail(name); return NULL;

View File

@ -49,8 +49,12 @@ This program uses the .car and .mdf files from MSI/Biosyms's INSIGHT
1. Building msi2lmp
Use the Makefile in the src directory. It is
currently set up for gcc. You will have to modify
If you are using CMake to compile LAMMPS, the building
(and installation) of msi2lmp is included in the normal
build process.
Otherwise you can use the Makefile in the src directory.
It is currently set up for gcc. You will have to modify
it to use a different compiler.
2. Testing the program