Skip to content

Commit

Permalink
Update CI runners and installation docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed May 22, 2024
1 parent 59b6064 commit bb71ac9
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 71 deletions.
3 changes: 2 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Checks: |
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-macro-parentheses,
-bugprone-reserved-identifier,
-bugprone-switch-missing-default-case,
-bugprone-unchecked-optional-access,
clang-analyzer-alpha.*,
modernize-deprecated-headers,
modernize-make-shared,
Expand Down Expand Up @@ -41,7 +43,6 @@ Checks: |
readability-function-size'
WarningsAsErrors: '*,-clang-analyzer-core.StackAddrEscapeBase,-clang-analyzer-optin.mpi.MPI-Checker'
HeaderFilterRegex: '.*'
AnalyzeTemporaryDtors: false
FormatStyle: none
User: espresso
CheckOptions:
Expand Down
15 changes: 3 additions & 12 deletions .github/actions/build_and_check/action.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
name: 'Build and check'
description: 'Build espresso and run checks'
inputs:
asan: # id of input
description: 'Whether to build with address sanitizer'
required: true
default: 'false'
ubsan:
description: 'Whether to build with undefined behavior sanitizer'
required: true
default: 'false'
description: 'Build ESPResSo and run checks'
runs:
using: "composite"
steps:
- run: |
brew install boost boost-mpi fftw
brew install hdf5-mpi
pip3 install -c requirements.txt numpy cython h5py scipy
pip3 install -c requirements.txt "cython<3.0" numpy scipy h5py packaging
shell: bash
- run: |
export myconfig=maxset with_cuda=false test_timeout=800 with_asan=${{ inputs.asan }} with_ubsan=${{ inputs.ubsan }} check_skip_long=true
export myconfig=maxset with_cuda=false with_gsl=false test_timeout=800 check_skip_long=true
bash maintainer/CI/build_cmake.sh
shell: bash
# This is a workaround for the unfortunate interaction of MacOS and OpenMPI 4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.7.0
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.GH_PAGES_SSH_PRIVATE_KEY }}
- name: Checkout
Expand Down
51 changes: 9 additions & 42 deletions .github/workflows/push_pull.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,24 @@
name: run tests on mac
name: run tests on macOS

on:
push:
pull_request:
schedule:
- cron: '0 3 * * *'

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

jobs:
regular_check:
runs-on: macos-12
if: github.event_name != 'schedule'
macos:
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup Python environment
uses: actions/setup-python@v4.3.1
uses: actions/setup-python@v5.1.0
with:
python-version: '3.8'
- name: Check without sanitizer
python-version: '3.9'
- name: Build and check
uses: ./.github/actions/build_and_check
with:
asan: false
ubsan: false

sanitizer_check:
permissions:
contents: read # to fetch code (actions/checkout)
issues: write # to create an issue

runs-on: macos-12
if: (github.event_name == 'schedule' && github.repository == 'espressomd/espresso')
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup Python environment
uses: actions/[email protected]
with:
python-version: '3.8'
- name: Check with sanitizer
uses: ./.github/actions/build_and_check
with:
asan: true
ubsan: true
- name: Setting job link variable
if: ${{ failure() }}
run: |
echo "job_link=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" >> $GITHUB_ENV
- uses: alialaa/issue-action@v1
if: ${{ failure() }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: Scheduled CI job has failed
body: ${{ env.job_link }}
env:
build_procs: 4
check_procs: 4
57 changes: 57 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,21 @@ debian:10:
- espresso
- no-cuda

debian:12:
<<: *global_job_definition
stage: build
image: ghcr.io/espressomd/docker/debian:f7f8ef2c0ca93c67aa16b9f91785492fb04ecc1b
variables:
with_cuda: 'false'
myconfig: 'maxset'
make_check_python: 'false'
with_stokesian_dynamics: 'true'
script:
- bash maintainer/CI/build_cmake.sh
tags:
- espresso
- no-cuda

fedora:36:
<<: *global_job_definition
stage: build
Expand All @@ -181,6 +196,23 @@ fedora:36:
- espresso
- no-cuda

fedora:40:
<<: *global_job_definition
stage: build
image: ghcr.io/espressomd/docker/fedora:f7f8ef2c0ca93c67aa16b9f91785492fb04ecc1b
variables:
with_cuda: 'false'
with_gsl: 'false'
myconfig: 'maxset'
make_check_python: 'true'
with_stokesian_dynamics: 'true'
cmake_params: '-D CMAKE_INCLUDE_PATH=/usr/include/mpich-x86_64 -D CMAKE_PREFIX_PATH=/usr/lib64/mpich/lib/'
script:
- bash maintainer/CI/build_cmake.sh
tags:
- espresso
- no-cuda

### Builds with CUDA

clang-sanitizer:
Expand Down Expand Up @@ -227,6 +259,28 @@ fast_math:
- cuda
when: manual

cuda12-maxset-ubuntu24.04:
<<: *global_job_definition
stage: build
image: ghcr.io/espressomd/docker/ubuntu:f7f8ef2c0ca93c67aa16b9f91785492fb04ecc1b
variables:
CC: 'gcc-12'
CXX: 'g++-12'
GCOV: 'gcov-12'
myconfig: 'maxset'
with_cuda: 'true'
with_coverage: 'false'
with_coverage_python: 'false'
check_skip_long: 'false'
with_scafacos: 'true'
with_stokesian_dynamics: 'true'
script:
- bash maintainer/CI/build_cmake.sh
tags:
- espresso
- cuda
- numa

cuda11-maxset-ubuntu20.04:
<<: *global_job_definition
stage: build
Expand All @@ -238,6 +292,7 @@ cuda11-maxset-ubuntu20.04:
myconfig: 'maxset'
with_cuda: 'true'
with_coverage: 'true'
with_coverage_python: 'true'
check_skip_long: 'true'
with_scafacos: 'true'
with_stokesian_dynamics: 'true'
Expand All @@ -259,6 +314,7 @@ cuda11-maxset-ubuntu22.04:
myconfig: 'maxset'
with_cuda: 'true'
with_coverage: 'true'
with_coverage_python: 'true'
check_skip_long: 'true'
with_scafacos: 'true'
with_stokesian_dynamics: 'true'
Expand Down Expand Up @@ -489,6 +545,7 @@ run_tutorials:
paths:
- build/doc/tutorials
expire_in: 1 week
timeout: 2h
tags:
- espresso
- cuda
Expand Down
15 changes: 10 additions & 5 deletions doc/sphinx/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ performance of the code. Therefore it is not possible to build a single
binary that can satisfy all needs. For performance reasons a user
should always activate only those features that are actually needed.
This means, however, that learning how to compile is a necessary evil.
The build system of |es| uses CMake [4]_ to compile
The build system of |es| uses CMake to compile
software easily on a wide range of platforms.

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

CMake
The build system is based on CMake.
The build system is based on CMake version 3 or later [4]_.

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

CUDA
For some algorithms like P\ :math:`^3`\ M,
|es| provides GPU-accelerated implementations for NVIDIA GPUs.
We strongly recommend CUDA 12.0 or later [6]_.

MPI
An MPI library that implements the MPI standard version 1.2 is required
to run simulations in parallel. |es| is currently tested against
Expand Down Expand Up @@ -247,11 +252,11 @@ Installing requirements on Windows via WSL

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

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

Expand Down
3 changes: 2 additions & 1 deletion doc/tutorials/error_analysis/error_analysis_part2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@
"plt.plot(autocov)\n",
"plt.xlabel(\"lag time $j$\")\n",
"plt.ylabel(r\"$\\hat{K}^{XX}_j$\")\n",
"plt.show()"
"plt.show()\n",
"```"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#endif

/** Whether to use the approximation of Abramowitz/Stegun @cite abramowitz65a
* @ref AS_erfc_part() for \f$\exp(d^2) \mathrm{erfc}(d)\f$,
* @ref Utils::AS_erfc_part() for \f$\exp(d^2) \mathrm{erfc}(d)\f$,
* or the C function <tt>std::erfc()</tt> in P3M and Ewald summation.
*/
#ifndef USE_ERFC_APPROXIMATION
Expand Down
5 changes: 1 addition & 4 deletions src/core/statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,15 @@ Utils::Vector3d angularmomentum(PartCfg &partCfg, int type) {
}

void momentofinertiamatrix(PartCfg &partCfg, int type, double *MofImatrix) {
int i, count;
double massi;
Utils::Vector3d p1{};
count = 0;

for (i = 0; i < 9; i++)
for (unsigned int i = 0; i < 9; i++)
MofImatrix[i] = 0.;

auto const com = centerofmass(partCfg, type);
for (auto const &p : partCfg) {
if (type == p.type() and (not p.is_virtual())) {
count++;
p1 = p.pos() - com;
massi = p.mass();
MofImatrix[0] += massi * (p1[1] * p1[1] + p1[2] * p1[2]);
Expand Down
11 changes: 7 additions & 4 deletions src/python/espressomd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL
Espresso_pyx_flags
INTERFACE -Wno-pedantic -Wno-\#warnings -Wno-sometimes-uninitialized
-Wno-unused-variable -Wno-deprecated-declarations)
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
target_compile_options(Espresso_pyx_flags
INTERFACE -Wno-missing-field-initializers)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
target_compile_options(Espresso_pyx_flags INTERFACE -wd1224)
else()
Expand Down Expand Up @@ -105,10 +109,9 @@ foreach(cython_file ${cython_SRC})
add_custom_command(
OUTPUT ${outputpath}
COMMAND
${CYTHON_EXECUTABLE} $<$<BOOL:${WARNINGS_ARE_ERRORS}>:--warning-errors>
-3 --cplus --directive embedsignature=True --directive binding=True -I
${CMAKE_CURRENT_SOURCE_DIR} -I ${CMAKE_CURRENT_BINARY_DIR}
${cython_file} -o ${outputpath}
${CYTHON_EXECUTABLE} -3 --cplus --directive embedsignature=True
--directive binding=True -I ${CMAKE_CURRENT_SOURCE_DIR} -I
${CMAKE_CURRENT_BINARY_DIR} ${cython_file} -o ${outputpath}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/..
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/myconfig.pxi ${cython_file}
${cython_HEADER})
Expand Down
2 changes: 2 additions & 0 deletions testsuite/python/sigint_child.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import numpy as np
import espressomd

np.random.seed(42)

system = espressomd.System(box_l=[100, 100, 100])
system.time_step = 0.01
system.cell_system.skin = 0.1
Expand Down

0 comments on commit bb71ac9

Please sign in to comment.