diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7d1f1a417b..a4fc5b7b4f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -111,6 +111,7 @@ src/exceptions.h @rbberger src/fix_nh.* @athomps src/info.* @akohlmey @rbberger src/timer.* @akohlmey +src/min* @sjplimp @stanmoore1 # tools tools/msi2lmp/* @akohlmey diff --git a/cmake/Modules/FindNetCDF.cmake b/cmake/Modules/FindNetCDF.cmake index a28c959acf..2a992b6b3b 100644 --- a/cmake/Modules/FindNetCDF.cmake +++ b/cmake/Modules/FindNetCDF.cmake @@ -46,10 +46,14 @@ endif() find_path (NETCDF_INCLUDE_DIR netcdf.h HINTS "${NETCDF_DIR}/include") mark_as_advanced (NETCDF_INCLUDE_DIR) + set (NETCDF_C_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR}) +string(REGEX REPLACE "/include/?$" "" + NETCDF_LIB_HINT ${NETCDF_INCLUDE_DIR}) + find_library (NETCDF_LIBRARY NAMES netcdf - HINTS "${NETCDF_DIR}/lib") + HINTS "${NETCDF_DIR}" "${NETCDF_LIB_HINT}" PATH_SUFFIXES lib lib64) mark_as_advanced (NETCDF_LIBRARY) set (NETCDF_C_LIBRARIES ${NETCDF_LIBRARY}) diff --git a/cmake/Modules/FindPNetCDF.cmake b/cmake/Modules/FindPNetCDF.cmake new file mode 100644 index 0000000000..bc3a5f9538 --- /dev/null +++ b/cmake/Modules/FindPNetCDF.cmake @@ -0,0 +1,55 @@ +# source: https://ftp.space.dtu.dk/pub/Ioana/pism0.6.1-10/CMake/FindPNetCDF.cmake +# license: GPL v3 (https://ftp.space.dtu.dk/pub/Ioana/pism0.6.1-10/COPYING) +# +# - Find PNetCDF +# Find the native PNetCDF includes and library +# +# PNETCDF_INCLUDES - where to find netcdf.h, etc +# PNETCDF_LIBRARIES - Link these libraries when using NetCDF +# PNETCDF_FOUND - True if PNetCDF was found +# +# Normal usage would be: +# find_package (PNetCDF REQUIRED) +# target_link_libraries (uses_pnetcdf ${PNETCDF_LIBRARIES}) + +if (PNETCDF_INCLUDES AND PNETCDF_LIBRARIES) + # Already in cache, be silent + set (PNETCDF_FIND_QUIETLY TRUE) +endif (PNETCDF_INCLUDES AND PNETCDF_LIBRARIES) + +find_path (PNETCDF_INCLUDES pnetcdf.h + HINTS "${PNETCDF_ROOT}/include" "$ENV{PNETCDF_ROOT}/include") + +string(REGEX REPLACE "/include/?$" "" + PNETCDF_LIB_HINT ${PNETCDF_INCLUDES}) + +find_library (PNETCDF_LIBRARIES + NAMES pnetcdf + HINTS ${PNETCDF_LIB_HINT} PATH_SUFFIXES lib lib64) + +if ((NOT PNETCDF_LIBRARIES) OR (NOT PNETCDF_INCLUDES)) + message(STATUS "Trying to find PNetCDF using LD_LIBRARY_PATH (we're desperate)...") + + file(TO_CMAKE_PATH "$ENV{LD_LIBRARY_PATH}" LD_LIBRARY_PATH) + + find_library(PNETCDF_LIBRARIES + NAMES pnetcdf + HINTS ${LD_LIBRARY_PATH}) + + if (PNETCDF_LIBRARIES) + get_filename_component(PNETCDF_LIB_DIR ${PNETCDF_LIBRARIES} PATH) + string(REGEX REPLACE "/(lib|lib64)/?$" "/include" + PNETCDF_H_HINT ${PNETCDF_LIB_DIR}) + + find_path (PNETCDF_INCLUDES pnetcdf.h + HINTS ${PNETCDF_H_HINT} + DOC "Path to pnetcdf.h") + endif() +endif() + +# handle the QUIETLY and REQUIRED arguments and set PNETCDF_FOUND to TRUE if +# all listed variables are TRUE +include (FindPackageHandleStandardArgs) +find_package_handle_standard_args (PNetCDF DEFAULT_MSG PNETCDF_LIBRARIES PNETCDF_INCLUDES) + +mark_as_advanced (PNETCDF_LIBRARIES PNETCDF_INCLUDES) diff --git a/cmake/Modules/Packages/KIM.cmake b/cmake/Modules/Packages/KIM.cmake index 8d17225760..a75e248097 100644 --- a/cmake/Modules/Packages/KIM.cmake +++ b/cmake/Modules/Packages/KIM.cmake @@ -5,6 +5,16 @@ if(PKG_KIM) include_directories(${CURL_INCLUDE_DIRS}) list(APPEND LAMMPS_LINK_LIBS ${CURL_LIBRARIES}) add_definitions(-DLMP_KIM_CURL) + set(LMP_DEBUG_CURL OFF CACHE STRING "Set libcurl verbose mode on/off. If on, it displays a lot of verbose information about its operations.") + mark_as_advanced(LMP_DEBUG_CURL) + if(LMP_DEBUG_CURL) + add_definitions(-DLMP_DEBUG_CURL) + endif() + set(LMP_NO_SSL_CHECK OFF CACHE STRING "Tell libcurl to not verify the peer. If on, the connection succeeds regardless of the names in the certificate. Insecure - Use with caution!") + mark_as_advanced(LMP_NO_SSL_CHECK) + if(LMP_NO_SSL_CHECK) + add_definitions(-DLMP_NO_SSL_CHECK) + endif() endif() find_package(KIM-API QUIET) if(KIM-API_FOUND) diff --git a/cmake/Modules/Packages/USER-NETCDF.cmake b/cmake/Modules/Packages/USER-NETCDF.cmake index a90725bbbc..f60c046ab9 100644 --- a/cmake/Modules/Packages/USER-NETCDF.cmake +++ b/cmake/Modules/Packages/USER-NETCDF.cmake @@ -1,6 +1,24 @@ if(PKG_USER-NETCDF) - find_package(NetCDF REQUIRED) - include_directories(${NETCDF_INCLUDE_DIRS}) - list(APPEND LAMMPS_LINK_LIBS ${NETCDF_LIBRARIES}) - add_definitions(-DLMP_HAS_NETCDF -DNC_64BIT_DATA=0x0020) + # USER-NETCDF can use NetCDF, Parallel NetCDF (PNetCDF), or both. At least one necessary. + # NetCDF library enables dump sytle "netcdf", while PNetCDF enables dump style "netcdf/mpiio" + find_package(NetCDF) + if(NETCDF_FOUND) + find_package(PNetCDF) + else(NETCDF_FOUND) + find_package(PNetCDF REQUIRED) + endif(NETCDF_FOUND) + + if(NETCDF_FOUND) + include_directories(${NETCDF_INCLUDE_DIRS}) + list(APPEND LAMMPS_LINK_LIBS ${NETCDF_LIBRARIES}) + add_definitions(-DLMP_HAS_NETCDF) + endif(NETCDF_FOUND) + + if(PNETCDF_FOUND) + include_directories(${PNETCDF_INCLUDES}) + list(APPEND LAMMPS_LINK_LIBS ${PNETCDF_LIBRARIES}) + add_definitions(-DLMP_HAS_PNETCDF) + endif(PNETCDF_FOUND) + + add_definitions(-DNC_64BIT_DATA=0x0020) endif() diff --git a/doc/lammps.1 b/doc/lammps.1 index a5045be5c4..4355e64961 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,4 +1,4 @@ -.TH LAMMPS "20 November 2019" "2019-11-20" +.TH LAMMPS "9 January 2020" "2020-01-09" .SH NAME .B LAMMPS \- Molecular Dynamics Simulator. diff --git a/doc/src/.gitignore b/doc/src/.gitignore index be126ab4aa..e0b9693457 100644 --- a/doc/src/.gitignore +++ b/doc/src/.gitignore @@ -1,2 +1,3 @@ -Eqs -JPG +/Eqs +/JPG +/false_positives.txt diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 6162940015..c02b24641e 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -195,12 +195,32 @@ minutes to hours) to build. Of course you only need to do that once.) .. parsed-literal:: -D DOWNLOAD_KIM=value # download OpenKIM API v2 for build, value = no (default) or yes + -D LMP_DEBUG_CURL=value # set libcurl verbose mode on/off, value = off (default) or on + -D LMP_NO_SSL_CHECK=value # tell libcurl to not verify the peer, value = no (default) or yes If DOWNLOAD\_KIM is set, the KIM library will be downloaded and built inside the CMake build directory. If the KIM library is already on your system (in a location CMake cannot find it), set the PKG\_CONFIG\_PATH environment variable so that libkim-api can be found. +For using KIM web queries. + +If LMP\_DEBUG\_CURL is set, the libcurl verbose mode will be on, and any +libcurl calls within the KIM web query display a lot of information about +libcurl operations. You hardly ever want this set in production use, you will +almost always want this when you debug/report problems. + +The libcurl performs peer SSL certificate verification by default. This +verification is done using a CA certificate store that the SSL library can +use to make sure the peer's server certificate is valid. If SSL reports an +error ("certificate verify failed") during the handshake and thus refuses +further communication with that server, you can set LMP\_NO\_SSL\_CHECK. +If LMP\_NO\_SSL\_CHECK is set, libcurl does not verify the peer and connection +succeeds regardless of the names in the certificate. This option is insecure. +As an alternative, you can specify your own CA cert path by setting the +environment variable CURL\_CA\_BUNDLE to the path of your choice. A call to the +KIM web query would get this value from the environmental variable. + **Traditional make**\ : You can download and build the KIM library manually if you prefer; diff --git a/doc/src/Commands.rst b/doc/src/Commands.rst index e845faa903..f192d6a59d 100644 --- a/doc/src/Commands.rst +++ b/doc/src/Commands.rst @@ -27,8 +27,3 @@ commands in it are used to define a LAMMPS simulation. :maxdepth: 1 Commands_removed - - -.. _lws: http://lammps.sandia.gov -.. _ld: Manual.html -.. _lc: Commands_all.html diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index 583e9e3c3a..d47c3299d0 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -1,59 +1,135 @@ -+----------------------------------------+------------------------------------+------------------------------------------+ -| :doc:`General commands ` | :doc:`Fix styles ` | :doc:`Compute styles ` | -+----------------------------------------+------------------------------------+------------------------------------------+ -| :doc:`Pair styles ` | :doc:`Bond styles ` | :ref:`Angle styles ` | -+----------------------------------------+------------------------------------+------------------------------------------+ -| :ref:`Dihedral styles ` | :ref:`Improper styles ` | :doc:`KSpace styles ` | -+----------------------------------------+------------------------------------+------------------------------------------+ +.. table_from_list:: + :columns: 3 + + * :doc:`General commands ` + * :doc:`Fix styles ` + * :doc:`Compute styles ` + * :doc:`Pair styles ` + * :ref:`Bond styles ` + * :ref:`Angle styles ` + * :ref:`Dihedral styles ` + * :ref:`Improper styles ` + * :doc:`KSpace styles ` General commands ================ An alphabetic list of all general LAMMPS commands. -+-----------------------------------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+---------------------------------------------+-----------------------------------------+ -| :doc:`angle\_coeff ` | :doc:`angle\_style ` | :doc:`atom\_modify ` | :doc:`atom\_style ` | :doc:`balance ` | :doc:`bond\_coeff ` | -+-----------------------------------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+---------------------------------------------+-----------------------------------------+ -| :doc:`bond\_style ` | :doc:`bond\_write ` | :doc:`boundary ` | :doc:`box ` | :doc:`change\_box ` | :doc:`clear ` | -+-----------------------------------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+---------------------------------------------+-----------------------------------------+ -| :doc:`comm\_modify ` | :doc:`comm\_style ` | :doc:`compute ` | :doc:`compute\_modify ` | :doc:`create\_atoms ` | :doc:`create\_bonds ` | -+-----------------------------------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+---------------------------------------------+-----------------------------------------+ -| :doc:`create\_box ` | :doc:`delete\_atoms ` | :doc:`delete\_bonds ` | :doc:`dielectric ` | :doc:`dihedral\_coeff ` | :doc:`dihedral\_style ` | -+-----------------------------------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+---------------------------------------------+-----------------------------------------+ -| :doc:`dimension ` | :doc:`displace\_atoms ` | :doc:`dump ` | :doc:`dump adios ` | :doc:`dump image ` | :doc:`dump movie ` | -+-----------------------------------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+---------------------------------------------+-----------------------------------------+ -| :doc:`dump netcdf ` | :doc:`dump netcdf/mpiio ` | :doc:`dump vtk ` | :doc:`dump\_modify ` | :doc:`dynamical\_matrix ` | :doc:`echo ` | -+-----------------------------------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+---------------------------------------------+-----------------------------------------+ -| :doc:`fix ` | :doc:`fix\_modify ` | :doc:`group ` | :doc:`group2ndx ` | :doc:`hyper ` | :doc:`if ` | -+-----------------------------------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+---------------------------------------------+-----------------------------------------+ -| :doc:`info ` | :doc:`improper\_coeff ` | :doc:`improper\_style ` | :doc:`include ` | :doc:`jump ` | :doc:`kim\_init ` | -+-----------------------------------------+-----------------------------------------+-----------------------------------------+-----------------------------------------+---------------------------------------------+-----------------------------------------+ -| :doc:`kim\_interactions ` | :doc:`kim\_query ` | :doc:`kspace\_modify ` | :doc:`kspace\_style ` | :doc:`label