Skip to content

Commit

Permalink
Merge pull request lammps#4348 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 Oct 4, 2024
2 parents 2ae4062 + 0a6d258 commit 36dd4de
Show file tree
Hide file tree
Showing 26 changed files with 100 additions and 40 deletions.
2 changes: 1 addition & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ endif()

# silence nvcc warnings
if((PKG_KOKKOS) AND (Kokkos_ENABLE_CUDA) AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
set(CMAKE_TUNE_DEFAULT "${CMAKE_TUNE_DEFAULT} -Xcudafe --diag_suppress=unrecognized_pragma")
set(CMAKE_TUNE_DEFAULT "${CMAKE_TUNE_DEFAULT} -Xcudafe --diag_suppress=unrecognized_pragma -Xcudafe --diag_suppress=128")
endif()

# we require C++11 without extensions. Kokkos requires at least C++17 (currently)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/Packages/H5MD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ enable_language(C)
# we don't use the parallel i/o interface.
set(HDF5_PREFER_PARALLEL FALSE)

find_package(HDF5 REQUIRED)
find_package(HDF5 COMPONENTS C REQUIRED)

# parallel HDF5 will import incompatible MPI headers with a serial build
if((NOT BUILD_MPI) AND HDF5_IS_PARALLEL)
Expand Down
4 changes: 4 additions & 0 deletions doc/src/compute_composition_atom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ too frequently.

----------

.. include:: accel_styles.rst

----------

Output info
"""""""""""

Expand Down
4 changes: 0 additions & 4 deletions doc/src/compute_pressure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ where thermo_temp is the ID of a similarly defined compute of style

----------

.. include:: accel_styles.rst

----------

Output info
"""""""""""

Expand Down
6 changes: 6 additions & 0 deletions doc/src/compute_temp_deform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ See the :doc:`Howto thermostat <Howto_thermostat>` page for a
discussion of different ways to compute temperature and perform
thermostatting.

----------

.. include:: accel_styles.rst

----------

Output info
"""""""""""

Expand Down
6 changes: 0 additions & 6 deletions doc/src/compute_temp_partial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ See the :doc:`Howto thermostat <Howto_thermostat>` page for a
discussion of different ways to compute temperature and perform
thermostatting.

----------

.. include:: accel_styles.rst

----------

Output info
"""""""""""

Expand Down
4 changes: 0 additions & 4 deletions doc/src/fix_addforce.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ correctly, the minimization will not converge properly.

----------

.. include:: accel_styles.rst

----------

Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
4 changes: 0 additions & 4 deletions doc/src/fix_aveforce.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ to it.

----------

.. include:: accel_styles.rst

----------

Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
2 changes: 0 additions & 2 deletions doc/src/fix_nph_body.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ It also means that changing attributes of *thermo_temp* or

----------

.. include:: accel_styles.rst

Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
2 changes: 0 additions & 2 deletions doc/src/fix_npt_body.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ remaining thermal degrees of freedom, and the bias is added back in.

----------

.. include:: accel_styles.rst

Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
2 changes: 0 additions & 2 deletions doc/src/fix_nvt_body.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ remaining thermal degrees of freedom, and the bias is added back in.

----------

.. include:: accel_styles.rst

Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
6 changes: 6 additions & 0 deletions doc/src/fix_wall_flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ also be potentially mitigated by using more multiple walls.
conservative as possible (every timestep if needed). Those are the
default settings.

----------

.. include:: accel_styles.rst

----------

Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
2 changes: 2 additions & 0 deletions doc/src/min_style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
min_style cg command
====================

Accelerator Variant: *cg/kk*

min_style hftn command
======================

Expand Down
4 changes: 4 additions & 0 deletions doc/src/pair_coul_diel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ The global cutoff (:math:`r_c`) specified in the pair_style command is used.

----------

.. include:: accel_styles.rst

----------

Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
4 changes: 4 additions & 0 deletions doc/src/pair_coul_slater.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ The global decay length of the charge (:math:`\lambda`) specified in the pair_st

----------

.. include:: accel_styles.rst

----------

Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
4 changes: 0 additions & 4 deletions doc/src/pair_granular.rst
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,6 @@ atom types.

----------

.. include:: accel_styles.rst

----------

Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
4 changes: 4 additions & 0 deletions doc/src/pair_mesodpd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ concentration profiles of the two chemical species as

----------

.. include:: accel_styles.rst

----------

Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
4 changes: 4 additions & 0 deletions doc/src/pair_mie.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ cutoff specified in the pair_style command is used.

----------

.. include:: accel_styles.rst

----------

Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
4 changes: 4 additions & 0 deletions doc/src/pair_sph_heatconduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ above.

----------

.. include:: accel_styles.rst

----------

Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
4 changes: 4 additions & 0 deletions doc/src/pair_sph_lj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ above.

----------

.. include:: accel_styles.rst

----------

Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
4 changes: 4 additions & 0 deletions doc/src/pair_sph_taitwater.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ above.

----------

.. include:: accel_styles.rst

----------

Mixing, shift, table, tail correction, restart, rRESPA info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down
53 changes: 47 additions & 6 deletions doc/utils/check-styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,50 @@
total = 0

index_pattern = re.compile(r"^.. index:: (compute|fix|pair_style|angle_style|bond_style|dihedral_style|improper_style|kspace_style|dump)\s+([a-zA-Z0-9/_]+)$")
accel_pattern = re.compile(r"^.. include::\s+accel_styles.rst$")
style_pattern = re.compile(r"(.+)Style\((.+),(.+)\)")
cmd_pattern = re.compile(r"^.. index:: ([a-zA-Z0-9/_]+)$")
upper = re.compile("[A-Z]+")
gpu = re.compile("(.+)/gpu$")
intel = re.compile("(.+)/intel$")
kokkos = re.compile("(.+)/kk$")
kokkos_skip = re.compile("(.+)/kk/(host|device)$")
omp = re.compile("(.+)/omp$")
opt = re.compile("(.+)/opt$")
gpu = re.compile("(.+)/gpu\\s*$")
intel = re.compile("(.+)/intel\\s*$")
kokkos = re.compile("(.+)/kk$\\s*")
kokkos_skip = re.compile("(.+)/kk/(host|device)\\s*$")
omp = re.compile("(.+)/omp\\s*$")
opt = re.compile("(.+)/opt\\s*$")
removed = re.compile("(.*)Deprecated$")

accel_pattern = re.compile(r"^.. include::\s+accel_styles.rst$")

def require_accel_include(path):
found = False
needs = False
# handle exceptions
if path == "src/min_style.rst" : needs = True
if path == "src/atom_style.rst" : needs = True
# check file
with open(path, 'r') as reader:
for line in reader:
m = accel_pattern.match(line)
if m: found = True
m = index_pattern.match(line)
if m:
if gpu.match(line): needs = True
if omp.match(line): needs = True
if kokkos.match(line): needs = True
if intel.match(line): needs = True
if opt.match(line): needs = True
m = cmd_pattern.match(line)
if m:
if gpu.match(line): needs = True
if omp.match(line): needs = True
if kokkos.match(line): needs = True
if intel.match(line): needs = True
if opt.match(line): needs = True
if needs and not found:
print("Missing '.. include:: accel_style.rst' in file ", path)
if not needs and found:
print("Have '.. include:: accel_style.rst' without accelerated styles in file ", path)

def load_index_entries_in_file(path):
entries = []
with open(path, 'r') as reader:
Expand All @@ -82,6 +116,11 @@ def load_index_entries_in_file(path):
entries.append((command_type, style))
return entries

def check_accel_includes():
rst_files = glob(os.path.join(doc_dir, '*.rst'))
for f in rst_files:
require_accel_include(f)

def load_index_entries():
index = {'compute': set(), 'fix': set(), 'pair_style': set(), 'angle_style': set(),
'bond_style': set(), 'dihedral_style': set(), 'improper_style': set(),
Expand Down Expand Up @@ -249,6 +288,8 @@ def check_style_index(name, styles, index, skip=[]):
len(fix), len(improper), len(integrate), len(kspace), \
len(minimize), len(pair), len(reader), len(region), total))

check_accel_includes()

index = load_index_entries()

total_index = 0
Expand Down
3 changes: 2 additions & 1 deletion lib/h5md/Makefile.h5cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ CC=h5cc

# -DH5_NO_DEPRECATED_SYMBOLS is required here to ensure we are using
# the v1.8 API when HDF5 is configured to default to using the v1.6 API.
CFLAGS=-D_DEFAULT_SOURCE -O2 -DH5_NO_DEPRECATED_SYMBOLS -Wall -fPIC
#CFLAGS=-D_DEFAULT_SOURCE -O2 -DH5_NO_DEPRECATED_SYMBOLS -Wall -fPIC
CFLAGS=-D_DEFAULT_SOURCE -O2 -Wall -fPIC
HDF5_PATH=/usr
INC=-I include
AR=ar
Expand Down
2 changes: 1 addition & 1 deletion src/MAKE/MACHINES/Makefile.perlmutter_kokkos
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SHELL = /bin/sh
KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd)

CC = $(KOKKOS_ABSOLUTE_PATH)/bin/nvcc_wrapper
CCFLAGS = -g -O3 -DNDEBUG -Xcudafe --diag_suppress=unrecognized_pragma
CCFLAGS = -g -O3 -DNDEBUG -Xcudafe --diag_suppress=unrecognized_pragma -Xcudafe --diag_suppress=128
SHFLAGS = -fPIC
DEPFLAGS = -M

Expand Down
2 changes: 1 addition & 1 deletion src/MAKE/MACHINES/Makefile.summit_kokkos
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SHELL = /bin/sh
KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd)

CC = $(KOKKOS_ABSOLUTE_PATH)/bin/nvcc_wrapper
CCFLAGS = -g -O3 -DNDEBUG -Xcudafe --diag_suppress=unrecognized_pragma
CCFLAGS = -g -O3 -DNDEBUG -Xcudafe --diag_suppress=unrecognized_pragma -Xcudafe --diag_suppress=128
SHFLAGS = -fPIC
DEPFLAGS = -M

Expand Down
2 changes: 1 addition & 1 deletion src/MAKE/OPTIONS/Makefile.kokkos_cuda_mpi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd)
export MPICH_CXX = $(KOKKOS_ABSOLUTE_PATH)/bin/nvcc_wrapper
export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/bin/nvcc_wrapper
CC = mpicxx
CCFLAGS = -g -O3 -DNDEBUG -Xcudafe --diag_suppress=unrecognized_pragma
CCFLAGS = -g -O3 -DNDEBUG -Xcudafe --diag_suppress=unrecognized_pragma -Xcudafe --diag_suppress=128
SHFLAGS = -fPIC
# uncomment when compiling with Intel 21.5 or older
FMTFLAGS = # -std=c++11
Expand Down

0 comments on commit 36dd4de

Please sign in to comment.