Skip to content

Commit bb71ac9

Browse files
committed
Update CI runners and installation docs
1 parent 59b6064 commit bb71ac9

File tree

11 files changed

+95
-71
lines changed

11 files changed

+95
-71
lines changed

.clang-tidy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Checks: |
1010
-bugprone-implicit-widening-of-multiplication-result,
1111
-bugprone-macro-parentheses,
1212
-bugprone-reserved-identifier,
13+
-bugprone-switch-missing-default-case,
14+
-bugprone-unchecked-optional-access,
1315
clang-analyzer-alpha.*,
1416
modernize-deprecated-headers,
1517
modernize-make-shared,
@@ -41,7 +43,6 @@ Checks: |
4143
readability-function-size'
4244
WarningsAsErrors: '*,-clang-analyzer-core.StackAddrEscapeBase,-clang-analyzer-optin.mpi.MPI-Checker'
4345
HeaderFilterRegex: '.*'
44-
AnalyzeTemporaryDtors: false
4546
FormatStyle: none
4647
User: espresso
4748
CheckOptions:

.github/actions/build_and_check/action.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
name: 'Build and check'
2-
description: 'Build espresso and run checks'
3-
inputs:
4-
asan: # id of input
5-
description: 'Whether to build with address sanitizer'
6-
required: true
7-
default: 'false'
8-
ubsan:
9-
description: 'Whether to build with undefined behavior sanitizer'
10-
required: true
11-
default: 'false'
2+
description: 'Build ESPResSo and run checks'
123
runs:
134
using: "composite"
145
steps:
156
- run: |
167
brew install boost boost-mpi fftw
178
brew install hdf5-mpi
18-
pip3 install -c requirements.txt numpy cython h5py scipy
9+
pip3 install -c requirements.txt "cython<3.0" numpy scipy h5py packaging
1910
shell: bash
2011
- run: |
21-
export myconfig=maxset with_cuda=false test_timeout=800 with_asan=${{ inputs.asan }} with_ubsan=${{ inputs.ubsan }} check_skip_long=true
12+
export myconfig=maxset with_cuda=false with_gsl=false test_timeout=800 check_skip_long=true
2213
bash maintainer/CI/build_cmake.sh
2314
shell: bash
2415
# This is a workaround for the unfortunate interaction of MacOS and OpenMPI 4

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install pandoc
1717
uses: r-lib/actions/setup-pandoc@v2
1818
- name: Setup SSH agent
19-
uses: webfactory/ssh-agent@v0.7.0
19+
uses: webfactory/ssh-agent@v0.9.0
2020
with:
2121
ssh-private-key: ${{ secrets.GH_PAGES_SSH_PRIVATE_KEY }}
2222
- name: Checkout

.github/workflows/push_pull.yml

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,24 @@
1-
name: run tests on mac
1+
name: run tests on macOS
22

33
on:
44
push:
55
pull_request:
6-
schedule:
7-
- cron: '0 3 * * *'
86

97
permissions:
108
contents: read # to fetch code (actions/checkout)
119

1210
jobs:
13-
regular_check:
14-
runs-on: macos-12
15-
if: github.event_name != 'schedule'
11+
macos:
12+
runs-on: macos-13
1613
steps:
1714
- name: Checkout
1815
uses: actions/checkout@main
1916
- name: Setup Python environment
20-
uses: actions/setup-python@v4.3.1
17+
uses: actions/setup-python@v5.1.0
2118
with:
22-
python-version: '3.8'
23-
- name: Check without sanitizer
19+
python-version: '3.9'
20+
- name: Build and check
2421
uses: ./.github/actions/build_and_check
25-
with:
26-
asan: false
27-
ubsan: false
28-
29-
sanitizer_check:
30-
permissions:
31-
contents: read # to fetch code (actions/checkout)
32-
issues: write # to create an issue
33-
34-
runs-on: macos-12
35-
if: (github.event_name == 'schedule' && github.repository == 'espressomd/espresso')
36-
steps:
37-
- name: Checkout
38-
uses: actions/checkout@main
39-
- name: Setup Python environment
40-
uses: actions/setup-python@v4.3.1
41-
with:
42-
python-version: '3.8'
43-
- name: Check with sanitizer
44-
uses: ./.github/actions/build_and_check
45-
with:
46-
asan: true
47-
ubsan: true
48-
- name: Setting job link variable
49-
if: ${{ failure() }}
50-
run: |
51-
echo "job_link=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" >> $GITHUB_ENV
52-
- uses: alialaa/issue-action@v1
53-
if: ${{ failure() }}
54-
with:
55-
token: ${{ secrets.GITHUB_TOKEN }}
56-
title: Scheduled CI job has failed
57-
body: ${{ env.job_link }}
22+
env:
23+
build_procs: 4
24+
check_procs: 4

.gitlab-ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,21 @@ debian:10:
166166
- espresso
167167
- no-cuda
168168

169+
debian:12:
170+
<<: *global_job_definition
171+
stage: build
172+
image: ghcr.io/espressomd/docker/debian:f7f8ef2c0ca93c67aa16b9f91785492fb04ecc1b
173+
variables:
174+
with_cuda: 'false'
175+
myconfig: 'maxset'
176+
make_check_python: 'false'
177+
with_stokesian_dynamics: 'true'
178+
script:
179+
- bash maintainer/CI/build_cmake.sh
180+
tags:
181+
- espresso
182+
- no-cuda
183+
169184
fedora:36:
170185
<<: *global_job_definition
171186
stage: build
@@ -181,6 +196,23 @@ fedora:36:
181196
- espresso
182197
- no-cuda
183198

199+
fedora:40:
200+
<<: *global_job_definition
201+
stage: build
202+
image: ghcr.io/espressomd/docker/fedora:f7f8ef2c0ca93c67aa16b9f91785492fb04ecc1b
203+
variables:
204+
with_cuda: 'false'
205+
with_gsl: 'false'
206+
myconfig: 'maxset'
207+
make_check_python: 'true'
208+
with_stokesian_dynamics: 'true'
209+
cmake_params: '-D CMAKE_INCLUDE_PATH=/usr/include/mpich-x86_64 -D CMAKE_PREFIX_PATH=/usr/lib64/mpich/lib/'
210+
script:
211+
- bash maintainer/CI/build_cmake.sh
212+
tags:
213+
- espresso
214+
- no-cuda
215+
184216
### Builds with CUDA
185217

186218
clang-sanitizer:
@@ -227,6 +259,28 @@ fast_math:
227259
- cuda
228260
when: manual
229261

262+
cuda12-maxset-ubuntu24.04:
263+
<<: *global_job_definition
264+
stage: build
265+
image: ghcr.io/espressomd/docker/ubuntu:f7f8ef2c0ca93c67aa16b9f91785492fb04ecc1b
266+
variables:
267+
CC: 'gcc-12'
268+
CXX: 'g++-12'
269+
GCOV: 'gcov-12'
270+
myconfig: 'maxset'
271+
with_cuda: 'true'
272+
with_coverage: 'false'
273+
with_coverage_python: 'false'
274+
check_skip_long: 'false'
275+
with_scafacos: 'true'
276+
with_stokesian_dynamics: 'true'
277+
script:
278+
- bash maintainer/CI/build_cmake.sh
279+
tags:
280+
- espresso
281+
- cuda
282+
- numa
283+
230284
cuda11-maxset-ubuntu20.04:
231285
<<: *global_job_definition
232286
stage: build
@@ -238,6 +292,7 @@ cuda11-maxset-ubuntu20.04:
238292
myconfig: 'maxset'
239293
with_cuda: 'true'
240294
with_coverage: 'true'
295+
with_coverage_python: 'true'
241296
check_skip_long: 'true'
242297
with_scafacos: 'true'
243298
with_stokesian_dynamics: 'true'
@@ -259,6 +314,7 @@ cuda11-maxset-ubuntu22.04:
259314
myconfig: 'maxset'
260315
with_cuda: 'true'
261316
with_coverage: 'true'
317+
with_coverage_python: 'true'
262318
check_skip_long: 'true'
263319
with_scafacos: 'true'
264320
with_stokesian_dynamics: 'true'
@@ -489,6 +545,7 @@ run_tutorials:
489545
paths:
490546
- build/doc/tutorials
491547
expire_in: 1 week
548+
timeout: 2h
492549
tags:
493550
- espresso
494551
- cuda

doc/sphinx/installation.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ performance of the code. Therefore it is not possible to build a single
2525
binary that can satisfy all needs. For performance reasons a user
2626
should always activate only those features that are actually needed.
2727
This means, however, that learning how to compile is a necessary evil.
28-
The build system of |es| uses CMake [4]_ to compile
28+
The build system of |es| uses CMake to compile
2929
software easily on a wide range of platforms.
3030

3131
.. _Requirements:
@@ -39,7 +39,7 @@ are required to be able to compile and use |es|:
3939
.. glossary::
4040

4141
CMake
42-
The build system is based on CMake.
42+
The build system is based on CMake version 3 or later [4]_.
4343

4444
C++ compiler
4545
The C++ core of |es| needs to be built by a C++14-capable compiler.
@@ -52,6 +52,11 @@ are required to be able to compile and use |es|:
5252
For some algorithms like P\ :math:`^3`\ M, |es| needs the FFTW library
5353
version 3 or later [5]_ for Fourier transforms, including header files.
5454

55+
CUDA
56+
For some algorithms like P\ :math:`^3`\ M,
57+
|es| provides GPU-accelerated implementations for NVIDIA GPUs.
58+
We strongly recommend CUDA 12.0 or later [6]_.
59+
5560
MPI
5661
An MPI library that implements the MPI standard version 1.2 is required
5762
to run simulations in parallel. |es| is currently tested against
@@ -247,11 +252,11 @@ Installing requirements on Windows via WSL
247252

248253
To run |es| on Windows, use the Linux subsystem. For that you need to
249254

250-
* follow `these instructions <https://docs.microsoft.com/en-us/windows/wsl/install-win10>`__ to install Ubuntu
251-
* start Ubuntu (or open an Ubuntu tab in `Windows Terminal <https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701>`__)
255+
* follow `these instructions <https://learn.microsoft.com/en-us/windows/wsl/install>`__ to install Ubuntu
256+
* start Ubuntu (or open an Ubuntu tab in `Windows Terminal <https://apps.microsoft.com/detail/9n0dx20hk701?hl=en-us&gl=US>`__)
252257
* execute ``sudo apt update`` to prepare the installation of dependencies
253258
* optional step: If you have a NVIDIA graphics card available and want to make
254-
use of |es|'s GPU acceleration, follow `these instructions <https://docs.nvidia.com/cuda/wsl-user-guide/index.html#ch03a-setting-up-cuda>`__
259+
use of |es|'s GPU acceleration, follow `these instructions <https://docs.nvidia.com/cuda/wsl-user-guide/index.html>`__
255260
to set up CUDA.
256261
* follow the instructions for :ref:`Installing requirements on Ubuntu Linux`
257262

doc/tutorials/error_analysis/error_analysis_part2.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@
205205
"plt.plot(autocov)\n",
206206
"plt.xlabel(\"lag time $j$\")\n",
207207
"plt.ylabel(r\"$\\hat{K}^{XX}_j$\")\n",
208-
"plt.show()"
208+
"plt.show()\n",
209+
"```"
209210
]
210211
},
211212
{

src/config/config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#endif
5555

5656
/** Whether to use the approximation of Abramowitz/Stegun @cite abramowitz65a
57-
* @ref AS_erfc_part() for \f$\exp(d^2) \mathrm{erfc}(d)\f$,
57+
* @ref Utils::AS_erfc_part() for \f$\exp(d^2) \mathrm{erfc}(d)\f$,
5858
* or the C function <tt>std::erfc()</tt> in P3M and Ewald summation.
5959
*/
6060
#ifndef USE_ERFC_APPROXIMATION

src/core/statistics.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,15 @@ Utils::Vector3d angularmomentum(PartCfg &partCfg, int type) {
133133
}
134134

135135
void momentofinertiamatrix(PartCfg &partCfg, int type, double *MofImatrix) {
136-
int i, count;
137136
double massi;
138137
Utils::Vector3d p1{};
139-
count = 0;
140138

141-
for (i = 0; i < 9; i++)
139+
for (unsigned int i = 0; i < 9; i++)
142140
MofImatrix[i] = 0.;
143141

144142
auto const com = centerofmass(partCfg, type);
145143
for (auto const &p : partCfg) {
146144
if (type == p.type() and (not p.is_virtual())) {
147-
count++;
148145
p1 = p.pos() - com;
149146
massi = p.mass();
150147
MofImatrix[0] += massi * (p1[1] * p1[1] + p1[2] * p1[2]);

src/python/espressomd/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL
7373
Espresso_pyx_flags
7474
INTERFACE -Wno-pedantic -Wno-\#warnings -Wno-sometimes-uninitialized
7575
-Wno-unused-variable -Wno-deprecated-declarations)
76+
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
77+
target_compile_options(Espresso_pyx_flags
78+
INTERFACE -Wno-missing-field-initializers)
79+
endif()
7680
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
7781
target_compile_options(Espresso_pyx_flags INTERFACE -wd1224)
7882
else()
@@ -105,10 +109,9 @@ foreach(cython_file ${cython_SRC})
105109
add_custom_command(
106110
OUTPUT ${outputpath}
107111
COMMAND
108-
${CYTHON_EXECUTABLE} $<$<BOOL:${WARNINGS_ARE_ERRORS}>:--warning-errors>
109-
-3 --cplus --directive embedsignature=True --directive binding=True -I
110-
${CMAKE_CURRENT_SOURCE_DIR} -I ${CMAKE_CURRENT_BINARY_DIR}
111-
${cython_file} -o ${outputpath}
112+
${CYTHON_EXECUTABLE} -3 --cplus --directive embedsignature=True
113+
--directive binding=True -I ${CMAKE_CURRENT_SOURCE_DIR} -I
114+
${CMAKE_CURRENT_BINARY_DIR} ${cython_file} -o ${outputpath}
112115
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/..
113116
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/myconfig.pxi ${cython_file}
114117
${cython_HEADER})

0 commit comments

Comments
 (0)