From 10961b8cb692ed4923f2c877aa8d456bd7c90dac Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 21 May 2021 16:15:31 -0400 Subject: [PATCH] update to upstream --- cmake/Modules/Packages/USER-MDI.cmake | 104 +++++++++++++----- cmake/Modules/Packages/USER-PACE.cmake | 3 +- cmake/presets/all_off.cmake | 14 +-- cmake/presets/all_on.cmake | 14 +-- cmake/presets/download.cmake | 8 +- cmake/presets/mingw-cross.cmake | 4 +- cmake/presets/nolib.cmake | 2 +- doc/src/Howto_mdi.rst | 14 +-- doc/src/Run_options.rst | 19 +++- doc/src/angle_table.rst | 1 - doc/src/pair_lj_cut_tip4p.rst | 16 +++ examples/ASPHERE/box/in.box | 2 +- examples/ASPHERE/box/in.box.mp | 2 +- examples/ASPHERE/dimer/in.dimer | 2 +- examples/ASPHERE/dimer/in.dimer.mp | 2 +- examples/ASPHERE/ellipsoid/in.ellipsoid | 2 +- examples/ASPHERE/ellipsoid/in.ellipsoid.mp | 2 +- examples/ASPHERE/line/in.line.srd | 2 +- examples/ASPHERE/poly/in.poly | 2 +- examples/ASPHERE/poly/in.poly.mp | 2 +- examples/ASPHERE/star/in.star | 2 +- examples/ASPHERE/star/in.star.mp | 2 +- examples/ASPHERE/tri/in.tri.srd | 2 +- .../USER/cgsdk/sds-monolayer/in.sds-hybrid | 3 +- src/KOKKOS/memory_kokkos.h | 2 +- src/KOKKOS/pair_table_kokkos.cpp | 8 ++ src/KOKKOS/pair_table_rx_kokkos.cpp | 10 +- src/KOKKOS/sna_kokkos_impl.h | 1 + src/USER-QTB/fix_qbmsst.cpp | 2 +- src/compute_dipole_chunk.cpp | 6 + src/fix_wall_region.cpp | 2 +- src/lammps.cpp | 1 + src/pair_hybrid.cpp | 16 +++ 33 files changed, 195 insertions(+), 79 deletions(-) diff --git a/cmake/Modules/Packages/USER-MDI.cmake b/cmake/Modules/Packages/USER-MDI.cmake index 75fe0d2bca..88d7b5e498 100644 --- a/cmake/Modules/Packages/USER-MDI.cmake +++ b/cmake/Modules/Packages/USER-MDI.cmake @@ -12,37 +12,89 @@ if(DOWNLOAD_MDI) set(MDI_MD5 "ddfa46d6ee15b4e59cfd527ec7212184" CACHE STRING "MD5 checksum for MDI tarball") mark_as_advanced(MDI_URL) mark_as_advanced(MDI_MD5) + enable_language(C) - set(LAMMPS_LIB_MDI_BIN_DIR ${LAMMPS_LIB_BINARY_DIR}/mdi) + # only ON/OFF are allowed for "mpi" flag when building MDI library + # so translate boolean value of BUILD_MPI + # always disable MPI when cross-compiling to Windows. + if((BUILD_MPI) AND NOT((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)) + set(MDI_USE_MPI ON) + else() + set(MDI_USE_MPI OFF) + endif() + # detect if we have python development support and thus can enable python plugins + set(MDI_USE_PYTHON_PLUGINS OFF) + if(CMAKE_VERSION VERSION_LESS 3.12) + find_package(PythonLibs QUIET) # Deprecated since version 3.12 + if (PYTHONLIBS_FOUND) + set(MDI_USE_PYTHON_PLUGINS ON) + endif() + else() + find_package(Python QUIET COMPONENTS Development) + if (Python_Development_FOUND) + set(MDI_USE_PYTHON_PLUGINS ON) + endif() + endif() + + # download/ build MDI library + # always build static library with -fpic + # support cross-compilation and ninja-build include(ExternalProject) - message(STATUS "Building mdi.") - ExternalProject_Add(mdi_external - URL ${MDI_URL} - URL_MD5 ${MDI_MD5} - UPDATE_COMMAND "" - CMAKE_ARGS ${CMAKE_REQUEST_PIC} - -DCMAKE_INSTALL_PREFIX=${LAMMPS_LIB_MDI_BIN_DIR} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} - -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} - -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} - -Dlanguage=C - CMAKE_CACHE_ARGS -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} - -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} - -DTargetOpenMP_FIND_COMPONENTS:STRING=C;CXX) + ExternalProject_Add(mdi_build + URL ${MDI_URL} + URL_MD5 ${MDI_MD5} + CMAKE_ARGS ${CMAKE_REQUEST_PIC} + -DCMAKE_INSTALL_PREFIX= + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -Dlanguage=C + -Dlibtype=STATIC + -Dmpi=${MDI_USE_MPI} + -Dpython_plugins=${MDI_USE_PYTHON_PLUGINS} + UPDATE_COMMAND "" + INSTALL_COMMAND "" + BUILD_BYPRODUCTS "/MDI_Library/libmdi.a" + ) - # Link the lammps library against MDI - target_include_directories(lammps PRIVATE ${LAMMPS_LIB_MDI_BIN_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/mdi) - target_link_directories(lammps PRIVATE ${LAMMPS_LIB_MDI_BIN_DIR}/${CMAKE_INSTALL_LIBDIR}/mdi) - target_link_libraries(lammps PRIVATE mdi) - add_dependencies(lammps mdi_external) + # where is the compiled library? + ExternalProject_get_property(mdi_build BINARY_DIR) + set(MDI_BINARY_DIR "${BINARY_DIR}/MDI_Library") + # workaround for older CMake versions + file(MAKE_DIRECTORY ${MDI_BINARY_DIR}) - # Link the lammps executable against MDI - target_include_directories(lmp PRIVATE ${LAMMPS_LIB_MDI_BIN_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/mdi) - target_link_directories(lmp PRIVATE ${LAMMPS_LIB_MDI_BIN_DIR}/${CMAKE_INSTALL_LIBDIR}/mdi) - target_link_libraries(lmp PRIVATE mdi) - add_dependencies(lmp mdi_external) + # create imported target for the MDI library + add_library(LAMMPS::MDI UNKNOWN IMPORTED) + add_dependencies(LAMMPS::MDI mdi_build) + set_target_properties(LAMMPS::MDI PROPERTIES + IMPORTED_LOCATION "${MDI_BINARY_DIR}/libmdi.a" + INTERFACE_INCLUDE_DIRECTORIES ${MDI_BINARY_DIR} + ) + + set(MDI_DEP_LIBS "") + # if compiling with python plugins we need + # to add python libraries as dependency. + if(MDI_USE_PYTHON_PLUGINS) + if(CMAKE_VERSION VERSION_LESS 3.12) + list(APPEND MDI_DEP_LIBS ${PYTHON_LIBRARIES}) + else() + list(APPEND MDI_DEP_LIBS Python::Python) + endif() + + endif() + # need to add support for dlopen/dlsym, except when compiling for Windows. + if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + list(APPEND MDI_DEP_LIBS "${CMAKE_DL_LIBS}") + endif() + if(MDI_DEP_LIBS) + set_target_properties(LAMMPS::MDI PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES "${MDI_DEP_LIBS}") + endif() + + target_link_libraries(lammps PRIVATE LAMMPS::MDI) + target_link_libraries(lmp PRIVATE LAMMPS::MDI) else() diff --git a/cmake/Modules/Packages/USER-PACE.cmake b/cmake/Modules/Packages/USER-PACE.cmake index 2d88d3a313..ccc7423355 100644 --- a/cmake/Modules/Packages/USER-PACE.cmake +++ b/cmake/Modules/Packages/USER-PACE.cmake @@ -14,13 +14,12 @@ execute_process( WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) - file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE) file(GLOB PACE_EVALUATOR_SOURCES ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE/*.cpp) list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp) add_library(pace STATIC ${PACE_EVALUATOR_SOURCES}) -set_target_properties(pace PROPERTIES OUTPUT_NAME lammps_pace${LAMMPS_MACHINE}) +set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE}) target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR}) target_link_libraries(lammps PRIVATE pace) diff --git a/cmake/presets/all_off.cmake b/cmake/presets/all_off.cmake index 32ab6744f5..df93599056 100644 --- a/cmake/presets/all_off.cmake +++ b/cmake/presets/all_off.cmake @@ -5,13 +5,13 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MESSAGE MISC MLIAP MOLECULE MPIIO MSCG OPT PERI PLUGIN POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI - USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-HDNNP - USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD USER-MESONT - USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP USER-PACE - USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP USER-REACTION - USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY - USER-UEF USER-VTK USER-YAFF) + USER-ADIOS USER-ATC USER-AWPMD USER-BROWNIAN USER-BOCS USER-CGDNA USER-CGSDK + USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD + USER-HDNNP USER-INTEL USER-LB USER-MANIFOLD USER-MDI USER-MEAMC USER-MESODPD + USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP + USER-PACE USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP + USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH + USER-TALLY USER-UEF USER-VTK USER-YAFF) foreach(PKG ${ALL_PACKAGES}) set(PKG_${PKG} OFF CACHE BOOL "" FORCE) diff --git a/cmake/presets/all_on.cmake b/cmake/presets/all_on.cmake index f8b2889487..d84caebe28 100644 --- a/cmake/presets/all_on.cmake +++ b/cmake/presets/all_on.cmake @@ -7,13 +7,13 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MESSAGE MISC MLIAP MOLECULE MPIIO MSCG OPT PERI PLUGIN POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI - USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-HDNNP - USER-INTEL USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD USER-MESONT - USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP USER-PACE - USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP USER-REACTION - USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY - USER-UEF USER-VTK USER-YAFF) + USER-ADIOS USER-ATC USER-AWPMD USER-BROWNIAN USER-BOCS USER-CGDNA USER-CGSDK + USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD + USER-HDNNP USER-INTEL USER-LB USER-MANIFOLD USER-MDI USER-MEAMC USER-MESODPD + USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP + USER-PACE USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP + USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH + USER-TALLY USER-UEF USER-VTK USER-YAFF) foreach(PKG ${ALL_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) diff --git a/cmake/presets/download.cmake b/cmake/presets/download.cmake index 84629ce785..ebab6ab658 100644 --- a/cmake/presets/download.cmake +++ b/cmake/presets/download.cmake @@ -1,7 +1,7 @@ -# preset that turns on packages with automatic downloads of sources of potentials -# compilation of libraries like Plumed or ScaFaCoS can take a considerable amount of time. +# Preset that turns on packages with automatic downloads of sources or potentials. +# Compilation of libraries like Plumed or ScaFaCoS can take a considerable amount of time. -set(ALL_PACKAGES KIM LATTE MSCG VORONOI USER-PLUMED USER-SCAFACOS USER-SMD USER-MESONT) +set(ALL_PACKAGES KIM LATTE MSCG VORONOI USER-PLUMED USER-SCAFACOS USER-SMD USER-MESONT USER-MDI USER-PACE) foreach(PKG ${ALL_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) @@ -9,9 +9,11 @@ endforeach() set(DOWNLOAD_KIM ON CACHE BOOL "" FORCE) set(DOWNLOAD_LATTE ON CACHE BOOL "" FORCE) +set(DOWNLOAD_MDI ON CACHE BOOL "" FORCE) set(DOWNLOAD_MSCG ON CACHE BOOL "" FORCE) set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE) set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE) +set(DOWNLOAD_PACE ON CACHE BOOL "" FORCE) set(DOWNLOAD_PLUMED ON CACHE BOOL "" FORCE) set(DOWNLOAD_SCAFACOS ON CACHE BOOL "" FORCE) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 32b17d43c2..e622211190 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -1,11 +1,11 @@ set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU GRANULAR KSPACE LATTE MANYBODY MC MISC MLIAP MOLECULE OPT PERI POEMS QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI - USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK + USER-ATC USER-AWPMD USER-BOCS USER-BROWNIAN USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-INTEL USER-MANIFOLD USER-MEAMC USER-MESODPD USER-MESONT USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE USER-OMP - USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC + USER-PACE USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-YAFF) diff --git a/cmake/presets/nolib.cmake b/cmake/presets/nolib.cmake index e2ec19c2c2..08a3a531a1 100644 --- a/cmake/presets/nolib.cmake +++ b/cmake/presets/nolib.cmake @@ -4,7 +4,7 @@ set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MESSAGE MPIIO MSCG PYTHON VORONOI USER-ADIOS USER-ATC USER-AWPMD USER-H5MD USER-HDNNP USER-LB USER-MOLFILE - USER-MESONT USER-NETCDF USER-PACE USER-PLUMED USER-QMMM USER-QUIP + USER-MESONT USER-MDI USER-NETCDF USER-PACE USER-PLUMED USER-QMMM USER-QUIP USER-SCAFACOS USER-SMD USER-VTK) foreach(PKG ${PACKAGES_WITH_LIB}) diff --git a/doc/src/Howto_mdi.rst b/doc/src/Howto_mdi.rst index a0a1cd0286..7cfcd01a50 100644 --- a/doc/src/Howto_mdi.rst +++ b/doc/src/Howto_mdi.rst @@ -1,7 +1,7 @@ Using LAMMPS with the MDI library for code coupling =================================================== -..note:: +.. note:: This Howto doc page will eventually replace the :doc:`Howto client/server ` doc page. @@ -65,8 +65,8 @@ how the 2 codes are launched to communicate by MPI: .. code-block:: bash -% mpirun -np 2 lmp_mpi -mdi "-role DRIVER -name d -method MPI" \ - -in in.aimd : -np 16 pw.x -in qe.in -mdi "-role ENGINE -name e -method MPI" + % mpirun -np 2 lmp_mpi -mdi "-role DRIVER -name d -method MPI" \ + -in in.aimd : -np 16 pw.x -in qe.in -mdi "-role ENGINE -name e -method MPI" In this case LAMMPS runs on 2 processors (MPI tasks), ``pw.x`` runs on 16 processors. @@ -75,8 +75,8 @@ Here is how the 2 codes are launched to communicate by sockets: .. code-block:: bash -% mpirun -np 2 lmp_mpi -mdi "-role DRIVER -name d -method TCP -port 8021" -in in.aimd -% mpirun -np 16 pw.x -in qe.in -mdi "-role ENGINE -name e -method TCP -port 8021 -hostname localhost" + % mpirun -np 2 lmp_mpi -mdi "-role DRIVER -name d -method TCP -port 8021" -in in.aimd + % mpirun -np 16 pw.x -in qe.in -mdi "-role ENGINE -name e -method TCP -port 8021 -hostname localhost" These commands could be issued in different windows on a desktop machine. Or in the same window, if the first command is ended with @@ -99,7 +99,7 @@ Examples scripts for using LAMMPS as an MDI engine are in the examples/mdi directory. See the README file in that directory for instructions on how to run the examples. -..note:: +.. note:: Work is underway to add commands that allow LAMMPS to be used as an MDI driver, e.g. for the AIMD example discussed above. Example @@ -109,7 +109,7 @@ instructions on how to run the examples. If LAMMPS is used as a stand-alone engine it should set up the system it will be modeling in its input script, then invoke the :doc:`mdi/engine ` command. This will put LAMMPS into -engine mode where it waits for messages and data from the driver. +"engine mode" where it waits for messages and data from the driver. When the driver sends an "EXIT" command, LAMMPS will exit engine mode and the input script will continue. diff --git a/doc/src/Run_options.rst b/doc/src/Run_options.rst index 25756d9be0..d8adfcc5be 100644 --- a/doc/src/Run_options.rst +++ b/doc/src/Run_options.rst @@ -10,6 +10,7 @@ letter abbreviation can be used: * :ref:`-i or -in ` * :ref:`-k or -kokkos ` * :ref:`-l or -log ` +* :ref:`-mdi ` * :ref:`-m or -mpicolor ` * :ref:`-c or -cite ` * :ref:`-nc or -nocite ` @@ -196,9 +197,23 @@ Option -plog will override the name of the partition log files file.N. ---------- +.. _mdi: + +**-mdi 'multiple flags'** + +This flag is only recognized and used when LAMMPS has support for the MolSSI +Driver Interface (MDI) included as part of the :ref:`USER-MDI ` +package. This flag is specific to the MDI library and controls how LAMMPS +interacts with MDI. There are usually multiple flags that have to follow it +and those have to be placed in quotation marks. For more information about +how to launch LAMMPS in MDI client/server mode please refer to the +:doc:`MDI Howto `. + +---------- + .. _mpicolor: -**-mpicolor** color +**-mpicolor color** If used, this must be the first command-line argument after the LAMMPS executable name. It is only used when LAMMPS is launched by an mpirun @@ -223,7 +238,7 @@ links with from the lib/message directory. See the .. _cite: -**-cite style or file name** +**-cite style** or **file name** Select how and where to output a reminder about citing contributions to the LAMMPS code that were used during the run. Available styles are diff --git a/doc/src/angle_table.rst b/doc/src/angle_table.rst index cad9f5a82f..b8aeae780b 100644 --- a/doc/src/angle_table.rst +++ b/doc/src/angle_table.rst @@ -69,7 +69,6 @@ parenthesized comments): HAM (keyword is the first text on line) N 181 FP 0 0 EQ 90.0 (N, FP, EQ parameters) (blank line) - N 181 FP 0 0 (N, FP parameters) 1 0.0 200.5 2.5 (index, angle, energy, derivative) 2 1.0 198.0 2.5 ... diff --git a/doc/src/pair_lj_cut_tip4p.rst b/doc/src/pair_lj_cut_tip4p.rst index 4f55f3b14e..5f3b4e48e7 100644 --- a/doc/src/pair_lj_cut_tip4p.rst +++ b/doc/src/pair_lj_cut_tip4p.rst @@ -145,6 +145,22 @@ specified since a Coulombic cutoff cannot be specified for an individual I,J type pair. All type pairs use the same global Coulombic cutoff specified in the pair_style command. +.. warning:: + + Because of how these pair styles implement the coulomb interactions + by implicitly defining a fourth site for the negative charge + of the TIP4P and similar water models, special care must be taken + when using these pair styles with other computations that also use + charges. Unless they are specially set up to also handle the implicit + definition of the 4th site, results are likely incorrect. Example: + :doc:`compute dipole/chunk `. For the same + reason, when using one of these pair styles with + :doc:`pair_style hybrid `, **all** coulomb interactions + should be handled by a single sub-style with TIP4P support. All other + instances and styles will "see" the M point charges at the position + of the Oxygen atom and thus compute incorrect forces and energies. + LAMMPS will print a warning when it detects one of these issues. + ---------- A version of these styles with a soft core, *lj/cut/tip4p/long/soft*\ , suitable diff --git a/examples/ASPHERE/box/in.box b/examples/ASPHERE/box/in.box index 2ec09faf56..6018458231 100644 --- a/examples/ASPHERE/box/in.box +++ b/examples/ASPHERE/box/in.box @@ -67,7 +67,7 @@ delete_atoms overlap 1.0 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/box/in.box.mp b/examples/ASPHERE/box/in.box.mp index 2953552595..ce1591c7dc 100644 --- a/examples/ASPHERE/box/in.box.mp +++ b/examples/ASPHERE/box/in.box.mp @@ -67,7 +67,7 @@ delete_atoms overlap 1.0 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/dimer/in.dimer b/examples/ASPHERE/dimer/in.dimer index 9e514d83f1..224db9937d 100644 --- a/examples/ASPHERE/dimer/in.dimer +++ b/examples/ASPHERE/dimer/in.dimer @@ -61,7 +61,7 @@ delete_atoms overlap 0.5 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/dimer/in.dimer.mp b/examples/ASPHERE/dimer/in.dimer.mp index 2970df022b..a637acaf87 100644 --- a/examples/ASPHERE/dimer/in.dimer.mp +++ b/examples/ASPHERE/dimer/in.dimer.mp @@ -61,7 +61,7 @@ delete_atoms overlap 0.5 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/ellipsoid/in.ellipsoid b/examples/ASPHERE/ellipsoid/in.ellipsoid index 241f010771..5e9a20f6e0 100644 --- a/examples/ASPHERE/ellipsoid/in.ellipsoid +++ b/examples/ASPHERE/ellipsoid/in.ellipsoid @@ -72,7 +72,7 @@ delete_atoms overlap 1.6 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/ellipsoid/in.ellipsoid.mp b/examples/ASPHERE/ellipsoid/in.ellipsoid.mp index 52c30db0a9..7ce01ad4e1 100644 --- a/examples/ASPHERE/ellipsoid/in.ellipsoid.mp +++ b/examples/ASPHERE/ellipsoid/in.ellipsoid.mp @@ -72,7 +72,7 @@ delete_atoms overlap 1.6 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/line/in.line.srd b/examples/ASPHERE/line/in.line.srd index 6ec1998d31..a32bde0b76 100644 --- a/examples/ASPHERE/line/in.line.srd +++ b/examples/ASPHERE/line/in.line.srd @@ -34,7 +34,7 @@ reset_timestep 0 velocity small create 1.44 87287 loop geom -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes neigh_modify exclude molecule/intra big include big diff --git a/examples/ASPHERE/poly/in.poly b/examples/ASPHERE/poly/in.poly index 3496a774bb..68bd2a6bbc 100644 --- a/examples/ASPHERE/poly/in.poly +++ b/examples/ASPHERE/poly/in.poly @@ -70,7 +70,7 @@ delete_atoms overlap 1.0 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/poly/in.poly.mp b/examples/ASPHERE/poly/in.poly.mp index 1c6a1faee3..8fa5d24a55 100644 --- a/examples/ASPHERE/poly/in.poly.mp +++ b/examples/ASPHERE/poly/in.poly.mp @@ -70,7 +70,7 @@ delete_atoms overlap 1.0 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/star/in.star b/examples/ASPHERE/star/in.star index 6711e7a0a7..a098810199 100644 --- a/examples/ASPHERE/star/in.star +++ b/examples/ASPHERE/star/in.star @@ -67,7 +67,7 @@ delete_atoms overlap 0.5 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/star/in.star.mp b/examples/ASPHERE/star/in.star.mp index de5f23dfb6..53cb924e42 100644 --- a/examples/ASPHERE/star/in.star.mp +++ b/examples/ASPHERE/star/in.star.mp @@ -67,7 +67,7 @@ delete_atoms overlap 0.5 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/tri/in.tri.srd b/examples/ASPHERE/tri/in.tri.srd index e7ef6ef59a..9bfc9d7b65 100644 --- a/examples/ASPHERE/tri/in.tri.srd +++ b/examples/ASPHERE/tri/in.tri.srd @@ -33,7 +33,7 @@ reset_timestep 0 velocity small create 1.44 87287 loop geom -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes neigh_modify exclude molecule/intra big include big diff --git a/examples/USER/cgsdk/sds-monolayer/in.sds-hybrid b/examples/USER/cgsdk/sds-monolayer/in.sds-hybrid index 3a9fcc13a9..eb3eca9c96 100644 --- a/examples/USER/cgsdk/sds-monolayer/in.sds-hybrid +++ b/examples/USER/cgsdk/sds-monolayer/in.sds-hybrid @@ -37,10 +37,11 @@ atom_modify first charged kspace_style pppm/cg 0.00001 kspace_modify order 3 -comm_modify mode multi neighbor 2.0 multi neigh_modify delay 4 every 2 check yes +comm_modify mode multi + timestep 10.0 fix 1 all nvt temp 310.0 310.0 100.0 diff --git a/src/KOKKOS/memory_kokkos.h b/src/KOKKOS/memory_kokkos.h index 86cce893c0..413d7074ce 100644 --- a/src/KOKKOS/memory_kokkos.h +++ b/src/KOKKOS/memory_kokkos.h @@ -253,7 +253,7 @@ TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, data.resize(n1); bigint nbytes = ((bigint) sizeof(typename TYPE::value_type *)) * n1; - array = (typename TYPE::value_type **) smalloc(nbytes,name); + array = (typename TYPE::value_type **) srealloc(array,nbytes,name); for (int i = 0; i < n1; i++) if (data.h_view.extent(1)==0) diff --git a/src/KOKKOS/pair_table_kokkos.cpp b/src/KOKKOS/pair_table_kokkos.cpp index a662298a3e..f803a06456 100644 --- a/src/KOKKOS/pair_table_kokkos.cpp +++ b/src/KOKKOS/pair_table_kokkos.cpp @@ -52,6 +52,14 @@ PairTableKokkos::~PairTableKokkos() { if (copymode) return; + if (allocated) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memory->destroy(setflag); + memoryKK->destroy_kokkos(d_table->cutsq,cutsq); + memoryKK->destroy_kokkos(d_table->tabindex,tabindex); + } + delete h_table; h_table = nullptr; delete d_table; diff --git a/src/KOKKOS/pair_table_rx_kokkos.cpp b/src/KOKKOS/pair_table_rx_kokkos.cpp index 5465b57b81..8b5905d473 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.cpp +++ b/src/KOKKOS/pair_table_rx_kokkos.cpp @@ -166,12 +166,12 @@ PairTableRXKokkos::~PairTableRXKokkos() delete [] site1; delete [] site2; - memoryKK->destroy_kokkos(k_eatom,eatom); - memoryKK->destroy_kokkos(k_vatom,vatom); - if (allocated) { - memoryKK->destroy_kokkos(d_table->cutsq, cutsq); - memoryKK->destroy_kokkos(d_table->tabindex, tabindex); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memory->destroy(setflag); + memoryKK->destroy_kokkos(d_table->cutsq,cutsq); + memoryKK->destroy_kokkos(d_table->tabindex,tabindex); } delete h_table; diff --git a/src/KOKKOS/sna_kokkos_impl.h b/src/KOKKOS/sna_kokkos_impl.h index 8f28c2ada6..7a4fdd0ece 100644 --- a/src/KOKKOS/sna_kokkos_impl.h +++ b/src/KOKKOS/sna_kokkos_impl.h @@ -55,6 +55,7 @@ SNAKokkos::SNAKokkos(real_type rfac0_in, ncoeff = compute_ncoeff(); nmax = 0; + natom = 0; build_indexlist(); diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index 341591d087..2ea66dffea 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -221,7 +221,7 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) // create a new compute potential energy compute id_pe = utils::strdup(std::string(id) + "_pe"); - modify->add_compute(fmt::format("{} all pe",id_temp)); + modify->add_compute(fmt::format("{} all pe",id_pe)); peflag = 1; // allocate qbmsst diff --git a/src/compute_dipole_chunk.cpp b/src/compute_dipole_chunk.cpp index cb0bb8d914..4ca991f90b 100644 --- a/src/compute_dipole_chunk.cpp +++ b/src/compute_dipole_chunk.cpp @@ -15,9 +15,11 @@ #include "compute_dipole_chunk.h" #include "atom.h" +#include "comm.h" #include "compute_chunk_atom.h" #include "domain.h" #include "error.h" +#include "force.h" #include "math_special.h" #include "memory.h" #include "modify.h" @@ -95,6 +97,10 @@ void ComputeDipoleChunk::init() cchunk = (ComputeChunkAtom *) modify->compute[icompute]; if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute dipole/chunk does not use chunk/atom compute"); + + if ((force->pair_match("/tip4p/",0) != nullptr) && (comm->me == 0)) + error->warning(FLERR,"Computed dipole moments may be incorrect when " + "using a tip4p pair style"); } /* ---------------------------------------------------------------------- */ diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp index d521e8e216..869a632b89 100644 --- a/src/fix_wall_region.cpp +++ b/src/fix_wall_region.cpp @@ -397,7 +397,7 @@ void FixWallRegion::morse(double r) { double dr = r - sigma; double dexp = exp(-alpha * dr); - fwall = coeff1 * (dexp*dexp - dexp) / r; + fwall = coeff1 * (dexp*dexp - dexp); eng = epsilon * (dexp*dexp - 2.0*dexp) - offset; } diff --git a/src/lammps.cpp b/src/lammps.cpp index ea83dccad1..9e340477f4 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -1142,6 +1142,7 @@ void _noopt LAMMPS::help() "-in none/filename : read input from file or stdin (default) (-i)\n" "-kokkos on/off ... : turn KOKKOS mode on or off (-k)\n" "-log none/filename : where to send log output (-l)\n" + "-mdi '' : pass flags to the MolSSI Driver Interface\n" "-mpicolor color : which exe in a multi-exe mpirun cmd (-m)\n" "-cite : select citation reminder style (-c)\n" "-nocite : disable citation reminder (-nc)\n" diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index ecbb8ffa0c..7c5976e65e 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -341,6 +341,8 @@ void PairHybrid::settings(int narg, char **arg) // multiple[i] = 1 to M if sub-style used multiple times, else 0 + int num_tip4p = 0, num_coul = 0; // count sub-styles with tip4p and coulomb + for (int i = 0; i < nstyles; i++) { int count = 0; for (int j = 0; j < nstyles; j++) { @@ -348,8 +350,22 @@ void PairHybrid::settings(int narg, char **arg) if (j == i) multiple[i] = count; } if (count == 1) multiple[i] = 0; + + if (utils::strmatch(keywords[i],"/tip4p/")) ++num_tip4p; + if (utils::strmatch(keywords[i],"/coul/") + || utils::strmatch(keywords[i],"^comb") + || utils::strmatch(keywords[i],"^reax/c")) ++num_coul; } + if ((num_tip4p > 1) && (comm->me == 0)) + error->warning(FLERR,"Using multiple tip4p sub-styles can result in " + "inconsistent calculation of coulomb interactions"); + + if ((num_tip4p > 0) && (num_coul > 0) && (comm->me == 0)) + error->warning(FLERR,"Using a tip4p sub-style with other sub-styles " + "that include coulomb interactions can result in " + "inconsistent calculation of the coulomb interactions"); + // set pair flags from sub-style flags flags();