Skip to content

Commit

Permalink
Merge pull request lammps#4051 from akohlmey/collected-small-changes
Browse files Browse the repository at this point in the history
Collected small changes and fixes
  • Loading branch information
akohlmey authored Jan 25, 2024
2 parents d7e8530 + 1016e28 commit 3941bae
Show file tree
Hide file tree
Showing 519 changed files with 1,620 additions and 1,898 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- name: Cache Coverity
id: cache-coverity
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./download/
key: ${{ runner.os }}-download-${{ hashFiles('**/coverity_tool.*') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittest-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: mkdir build

- name: Set up ccache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: macos-ccache-${{ github.sha }}
Expand Down
7 changes: 7 additions & 0 deletions cmake/Modules/Packages/GPU.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@

# Silence CMake warnings about FindCUDA being obsolete.
# We may need to eventually rewrite this section to use enable_language(CUDA)
if(POLICY CMP0146)
cmake_policy(SET CMP0146 OLD)
endif()

set(GPU_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/GPU)
set(GPU_SOURCES ${GPU_SOURCES_DIR}/gpu_extra.h
${GPU_SOURCES_DIR}/fix_gpu.h
Expand Down
4 changes: 2 additions & 2 deletions cmake/Modules/Packages/MDI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ option(DOWNLOAD_MDI "Download and compile the MDI library instead of using an al

if(DOWNLOAD_MDI)
message(STATUS "MDI download requested - we will build our own")
set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.4.16.tar.gz" CACHE STRING "URL for MDI tarball")
set(MDI_MD5 "407db44e2d79447ab5c1233af1965f65" CACHE STRING "MD5 checksum for MDI tarball")
set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.4.26.tar.gz" CACHE STRING "URL for MDI tarball")
set(MDI_MD5 "3124bb85259471e2a53a891f04bf697a" CACHE STRING "MD5 checksum for MDI tarball")
mark_as_advanced(MDI_URL)
mark_as_advanced(MDI_MD5)
GetFallbackURL(MDI_URL MDI_FALLBACK)
Expand Down
3 changes: 3 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\
env LC_ALL=C grep -n ' `[^`]\+<[a-z][^`]\+`[^_]' $(RSTDIR)/*.rst ;\
env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst ;\
env LC_ALL=C grep -n '\(ref\|doc\)`[^`]' $(RSTDIR)/*.rst ;\
$(PYTHON) $(BUILDDIR)/utils/check-styles.py -s ../src -d src ;\
echo "############################################" ;\
deactivate ;\
Expand Down Expand Up @@ -182,6 +183,7 @@ pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\
env LC_ALL=C grep -n ' `[^`]\+<[a-z][^`]\+`[^_]' $(RSTDIR)/*.rst ;\
env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst ;\
env LC_ALL=C grep -n '\(ref\|doc\)`[^`]' $(RSTDIR)/*.rst ;\
$(PYTHON) utils/check-styles.py -s ../src -d src ;\
echo "############################################" ;\
deactivate ;\
Expand Down Expand Up @@ -231,6 +233,7 @@ role_check :
@( env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst && exit 1 || : )
@( env LC_ALL=C grep -n ' `[^`]\+<[a-z][^`]\+`[^_]' $(RSTDIR)/*.rst && exit 1 || : )
@( env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst && exit 1 || : )
@( env LC_ALL=C grep -n '\(ref\|doc\)`[^`]' $(RSTDIR)/*.rst && exit 1 || : )

link_check : $(VENV) html
@(\
Expand Down
98 changes: 49 additions & 49 deletions doc/src/fix_neb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Note that in this case the specified *Kspring* is in
force/distance units.

With a value of *ideal*, the spring force is computed as suggested in
ref`(WeinanE) <WeinanE>`
:ref:`(WeinanE) <WeinanE>`

.. math::
Expand All @@ -120,18 +120,18 @@ and :math:`RD_{ideal}` is the ideal *RD* for which all the images are
equally spaced. I.e. :math:`RD_{ideal} = (i-1) \cdot meanDist` when the
climbing replica is off, where *i* is the replica number). The
*meanDist* is the average distance between replicas. Note that in this
case the specified *Kspring* is in force units. When the climbing replica
is on, :math:`RD_{ideal}` and :math:`meanDist` are calculated separately
each side of the climbing image. Note that the *ideal* form of nudging
can often be more effective at keeping the replicas equally spaced before
climbing, then equally spaced either side of the climbing image whilst
climbing.

With a value of *equal* the spring force is computed as for *ideal*
when the climbing replica is off, promoting equidistance. When the climbing
case the specified *Kspring* is in force units. When the climbing
replica is on, :math:`RD_{ideal}` and :math:`meanDist` are calculated
separately each side of the climbing image. Note that the *ideal* form
of nudging can often be more effective at keeping the replicas equally
spaced before climbing, then equally spaced either side of the climbing
image whilst climbing.

With a value of *equal* the spring force is computed as for *ideal* when
the climbing replica is off, promoting equidistance. When the climbing
replica is on, the spring force is computed to promote equidistant
absolute differences in energy, rather than distance, each side of
the climbing image:
absolute differences in energy, rather than distance, each side of the
climbing image:

.. math::
Expand All @@ -143,23 +143,22 @@ where *ED* is the cumulative sum of absolute energy differences:
ED = \sum_{i<N} \left|E(R_{i+1}) - E(R_i)\right|,
*meanEdist* is the average absolute energy difference between
replicas up to the climbing image or from the climbing image
to the final image, for images before or after the climbing
image respectively. :math:`ED_{ideal}` is the corresponding
cumulative sum of average absolute energy differences in
each case, in close analogy to *ideal*. This form of nudging
is to aid schemes which integrate forces along, or near to,
NEB pathways such as :doc:`fix_pafi <fix_pafi>`.
*meanEdist* is the average absolute energy difference between replicas
up to the climbing image or from the climbing image to the final image,
for images before or after the climbing image
respectively. :math:`ED_{ideal}` is the corresponding cumulative sum of
average absolute energy differences in each case, in close analogy to
*ideal*. This form of nudging is to aid schemes which integrate forces
along, or near to, NEB pathways such as :doc:`fix_pafi <fix_pafi>`.

----------

The keyword *perp* specifies if and how a perpendicular nudging force
is computed. It adds a spring force perpendicular to the path in
order to prevent the path from becoming too strongly kinked. It can
The keyword *perp* specifies if and how a perpendicular nudging force is
computed. It adds a spring force perpendicular to the path in order to
prevent the path from becoming too strongly kinked. It can
significantly improve the convergence of the NEB calculation when the
resolution is poor. I.e. when few replicas are used; see
:ref:`(Maras) <Maras1>` for details.
resolution is poor. I.e. when few replicas are used; see :ref:`(Maras)
<Maras1>` for details.

The perpendicular spring force is given by

Expand All @@ -181,10 +180,10 @@ force is added.

By default, no additional forces act on the first and last replicas
during the NEB relaxation, so these replicas simply relax toward their
respective local minima. By using the key word *end*, additional
forces can be applied to the first and/or last replicas, to enable
them to relax toward a MEP while constraining their energy E to the
target energy ETarget.
respective local minima. By using the key word *end*, additional forces
can be applied to the first and/or last replicas, to enable them to
relax toward a MEP while constraining their energy E to the target
energy ETarget.

If :math:`E_{Target} > E`, the interatomic force :math:`F_i` for the
specified replica becomes:
Expand All @@ -197,33 +196,33 @@ specified replica becomes:
The "spring" constant on the difference in energies is the specified
*Kspring3* value.

When *estyle* is specified as *first*, the force is applied to the
first replica. When *estyle* is specified as *last*, the force is
applied to the last replica. Note that the *end* keyword can be used
twice to add forces to both the first and last replicas.
When *estyle* is specified as *first*, the force is applied to the first
replica. When *estyle* is specified as *last*, the force is applied to
the last replica. Note that the *end* keyword can be used twice to add
forces to both the first and last replicas.

For both these *estyle* settings, the target energy *ETarget* is set
to the initial energy of the replica (at the start of the NEB
calculation).

If the *estyle* is specified as *last/efirst* or *last/efirst/middle*,
force is applied to the last replica, but the target energy *ETarget*
is continuously set to the energy of the first replica, as it evolves
force is applied to the last replica, but the target energy *ETarget* is
continuously set to the energy of the first replica, as it evolves
during the NEB relaxation.

The difference between these two *estyle* options is as follows. When
*estyle* is specified as *last/efirst*, no change is made to the
inter-replica force applied to the intermediate replicas (neither
first or last). If the initial path is too far from the MEP, an
intermediate replica may relax "faster" and reach a lower energy than
the last replica. In this case the intermediate replica will be
relaxing toward its own local minima. This behavior can be prevented
by specifying *estyle* as *last/efirst/middle* which will alter the
inter-replica force applied to intermediate replicas by removing the
contribution of the gradient to the inter-replica force. This will
only be done if a particular intermediate replica has a lower energy
than the first replica. This should effectively prevent the
intermediate replicas from over-relaxing.
inter-replica force applied to the intermediate replicas (neither first
or last). If the initial path is too far from the MEP, an intermediate
replica may relax "faster" and reach a lower energy than the last
replica. In this case the intermediate replica will be relaxing toward
its own local minima. This behavior can be prevented by specifying
*estyle* as *last/efirst/middle* which will alter the inter-replica
force applied to intermediate replicas by removing the contribution of
the gradient to the inter-replica force. This will only be done if a
particular intermediate replica has a lower energy than the first
replica. This should effectively prevent the intermediate replicas from
over-relaxing.

After converging a NEB calculation using an *estyle* of
*last/efirst/middle*, you should check that all intermediate replicas
Expand All @@ -237,9 +236,10 @@ target energy.
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

No information about this fix is written to :doc:`binary restart files <restart>`. None of the :doc:`fix_modify <fix_modify>` options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various :doc:`output commands <Howto_output>`.
No information about this fix is written to :doc:`binary restart files
<restart>`. None of the :doc:`fix_modify <fix_modify>` options are
relevant to this fix. No global or per-atom quantities are stored by
this fix for access by various :doc:`output commands <Howto_output>`.
No parameter of this fix can be used with the *start/stop* keywords of
the :doc:`run <run>` command.

Expand Down
13 changes: 7 additions & 6 deletions doc/src/neb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Syntax
neb etol ftol N1 N2 Nevery file-style arg keyword values
* etol = stopping tolerance for energy (energy units)
* etol = stopping tolerance for energy (dimensionless)
* ftol = stopping tolerance for force (force units)
* N1 = max # of iterations (timesteps) to run initial NEB
* N2 = max # of iterations (timesteps) to run barrier-climbing NEB
Expand Down Expand Up @@ -89,10 +89,11 @@ potentials, and the starting configuration when the neb command is
issued should be the same for every replica.

In a NEB calculation each replica is connected to other replicas by
inter-replica nudging forces. These forces are imposed by the :doc:`fix neb <fix_neb>` command, which must be used in conjunction with the
neb command. The group used to define the fix neb command defines the
NEB atoms which are the only ones that inter-replica springs are
applied to. If the group does not include all atoms, then non-NEB
inter-replica nudging forces. These forces are imposed by the
:doc:`fix neb <fix_neb>` command, which must be used in conjunction
with the neb command. The group used to define the fix neb command
defines the NEB atoms which are the only ones that inter-replica springs
are applied to. If the group does not include all atoms, then non-NEB
atoms have no inter-replica springs and the forces they feel and their
motion is computed in the usual way due only to other atoms within
their replica. Conceptually, the non-NEB atoms provide a background
Expand Down Expand Up @@ -445,7 +446,7 @@ Related commands
""""""""""""""""

:doc:`prd <prd>`, :doc:`temper <temper>`, :doc:`fix langevin <fix_langevin>`,
:doc:`fix viscous <fix_viscous>`
:doc:`fix viscous <fix_viscous>`, :doc:`fix neb <fix_neb>`

Default
"""""""
Expand Down
4 changes: 2 additions & 2 deletions lib/gpu/Makefile.cuda
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ $(OBJ_DIR)/scan_app.cu_o: cudpp_mini/scan_app.cu
$(GPU_LIB): $(OBJS) $(CUDPP)
$(AR) -crusv $(GPU_LIB) $(OBJS) $(CUDPP)
@cp $(EXTRAMAKE) Makefile.lammps

# test app for querying device info

$(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H)
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda

clean:
-rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUDPP) $(CUHS) *.linkinfo
Expand Down
4 changes: 2 additions & 2 deletions lib/gpu/Makefile.cuda_mps
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ $(OBJ_DIR)/scan_app.cu_o: cudpp_mini/scan_app.cu
$(GPU_LIB): $(OBJS) $(CUDPP)
$(AR) -crusv $(GPU_LIB) $(OBJS) $(CUDPP)
@cp $(EXTRAMAKE) Makefile.lammps

# test app for querying device info

$(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H)
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda

clean:
-rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUDPP) $(CUHS) *.linkinfo
Expand Down
4 changes: 2 additions & 2 deletions lib/gpu/Makefile.hip
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ HIP_GPU_OPTS += $(HIP_OPTS) -I./
ifeq (spirv,$(HIP_PLATFORM))
HIP_HOST_OPTS += -fPIC
HIP_GPU_CC = $(HIP_PATH)/bin/hipcc -c
HIP_GPU_OPTS_S =
HIP_GPU_OPTS_S =
HIP_GPU_OPTS_E =
HIP_KERNEL_SUFFIX = .cpp
HIP_LIBS_TARGET =
HIP_LIBS_TARGET =
export HCC_AMDGPU_TARGET := $(HIP_ARCH)
else ifeq (clang,$(HIP_COMPILER))
HIP_HOST_OPTS += -fPIC
Expand Down
2 changes: 1 addition & 1 deletion lib/gpu/Makefile.lammps.mac_ocl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

gpu_SYSINC = -DFFT_SINGLE
gpu_SYSLIB = -framework OpenCL
gpu_SYSPATH =
gpu_SYSPATH =
2 changes: 1 addition & 1 deletion lib/gpu/Makefile.lammps.mingw-cross
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# settings for OpenCL builds
gpu_SYSINC =
gpu_SYSLIB = -Wl,--enable-stdcall-fixup -L../../tools/mingw-cross$(LIBOBJDIR) -Wl,-Bdynamic,-lOpenCL,-Bstatic
gpu_SYSPATH =
gpu_SYSPATH =

2 changes: 1 addition & 1 deletion lib/gpu/Makefile.lammps.opencl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

gpu_SYSINC =
gpu_SYSLIB = -lOpenCL
gpu_SYSPATH =
gpu_SYSPATH =
2 changes: 1 addition & 1 deletion lib/gpu/Makefile.linux
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# /* ----------------------------------------------------------------------
# /* ----------------------------------------------------------------------
# Generic Linux Makefile for CUDA
# - Change CUDA_ARCH for your GPU
# ------------------------------------------------------------------------- */
Expand Down
2 changes: 1 addition & 1 deletion lib/gpu/Makefile.linux_multi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# /* ----------------------------------------------------------------------
# /* ----------------------------------------------------------------------
# Generic Linux Makefile for CUDA complied for multiple compute capabilities
# - Add your GPU to CUDA_CODE
# ------------------------------------------------------------------------- */
Expand Down
4 changes: 2 additions & 2 deletions lib/gpu/Makefile.linux_opencl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# /* ----------------------------------------------------------------------
# /* ----------------------------------------------------------------------
# Generic Linux Makefile for OpenCL - Mixed precision
# ------------------------------------------------------------------------- */

Expand All @@ -11,7 +11,7 @@ EXTRAMAKE = Makefile.lammps.opencl

LMP_INC = -DLAMMPS_SMALLBIG

OCL_INC =
OCL_INC =
OCL_CPP = mpic++ -std=c++11 -O3 -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC)
OCL_LINK = -lOpenCL
OCL_PREC = -D_SINGLE_DOUBLE
Expand Down
2 changes: 1 addition & 1 deletion lib/gpu/Makefile.mac_opencl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# /* ----------------------------------------------------------------------
# /* ----------------------------------------------------------------------
# Generic Mac Makefile for OpenCL - Single precision with FFT_SINGLE
# ------------------------------------------------------------------------- */

Expand Down
2 changes: 1 addition & 1 deletion lib/gpu/Makefile.mac_opencl_mpi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# /* ----------------------------------------------------------------------
# /* ----------------------------------------------------------------------
# Generic Mac Makefile for OpenCL - Single precision with FFT_SINGLE
# ------------------------------------------------------------------------- */

Expand Down
2 changes: 1 addition & 1 deletion lib/gpu/Makefile.oneapi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# /* ----------------------------------------------------------------------
# /* ----------------------------------------------------------------------
# Linux Makefile for Intel oneAPI - Mixed precision
# ------------------------------------------------------------------------- */

Expand Down
2 changes: 1 addition & 1 deletion lib/gpu/Makefile.oneapi_prof
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# /* ----------------------------------------------------------------------
# /* ----------------------------------------------------------------------
# Linux Makefile for Intel oneAPI - Mixed precision (with timing enabled)
# ------------------------------------------------------------------------- */

Expand Down
2 changes: 1 addition & 1 deletion lib/gpu/Makefile.serial
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# /* ----------------------------------------------------------------------
# /* ----------------------------------------------------------------------
# Generic Linux Makefile for CUDA without MPI libraries
# - Change CUDA_ARCH for your GPU
# ------------------------------------------------------------------------- */
Expand Down
4 changes: 2 additions & 2 deletions lib/gpu/Nvidia.makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ HOST_H = lal_answer.h lal_atom.h lal_balance.h lal_base_atomic.h lal_base_amoeba
lal_base_charge.h lal_base_dipole.h lal_base_dpd.h \
lal_base_ellipsoid.h lal_base_three.h lal_device.h lal_neighbor.h \
lal_neighbor_shared.h lal_pre_ocl_config.h $(NVD_H)

# Source files
SRCS := $(wildcard ./lal_*.cpp)
OBJS := $(subst ./,$(OBJ_DIR)/,$(SRCS:%.cpp=%.o))
Expand Down Expand Up @@ -127,7 +127,7 @@ $(GPU_LIB): $(OBJS) $(CUDPP)
# test app for querying device info

$(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H)
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda

clean:
-rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUDPP) $(CUHS) *.cubin *.linkinfo
Expand Down
2 changes: 1 addition & 1 deletion lib/gpu/Nvidia.makefile_multi
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ $(GPU_LIB): $(OBJS) $(CUDPP)
# test app for querying device info

$(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H)
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda

clean:
-rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUDPP) $(CUHS) *.linkinfo
Expand Down
Loading

0 comments on commit 3941bae

Please sign in to comment.