Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8db7159
ci: add first version clangd-tidy checks
97gamjak Jul 29, 2026
82bfc6f
cleanup: remove unused header
97gamjak Jul 29, 2026
976653b
cleanup: export intrinsic headers in linearAlgebra lib
97gamjak Jul 29, 2026
79d124f
Merge remote-tracking branch 'origin/dev' into add_clangd-tidy_checks
97gamjak Jul 30, 2026
054157a
cleanup: final call on dstr is prohibited -- make full class final
97gamjak Jul 30, 2026
2443255
cleanup: wrap Kokkos-related code in conditional compilation directives
97gamjak Jul 30, 2026
dc5805a
cleanup: another kokkos PP cleanup
97gamjak Jul 30, 2026
41be66f
cleanup: remove some unused headers
97gamjak Jul 30, 2026
f05d588
Merge remote-tracking branch 'origin/dev' into add_clangd-tidy_checks
97gamjak Jul 30, 2026
e3f4d53
cleanup: guard mpi approach with correct PP directive
97gamjak Jul 30, 2026
c69bffe
cleanup: remove some more unused headers
97gamjak Jul 30, 2026
37f9a5c
cleanup: comment out unused function params
97gamjak Jul 30, 2026
ac4e188
cleanup: guard kokkos impl files with correct PP directive
97gamjak Jul 30, 2026
4b8f56b
fix: remove error flags when compiling with benchmarking
97gamjak Jul 30, 2026
9c4eef8
cleanup: guard selection impl file with PP guards
97gamjak Jul 30, 2026
08b66d2
cleanup: more kokkos PP guards
97gamjak Jul 30, 2026
1f4d9af
cleanup: fix reusing same variable twice
97gamjak Jul 30, 2026
f184178
Merge remote-tracking branch 'origin/dev' into add_clangd-tidy_checks
97gamjak Jul 30, 2026
fa504ee
cleanup: more kokkos PP directives
97gamjak Jul 30, 2026
76a4022
cleanup: remove unused header
97gamjak Jul 30, 2026
eaa92e0
cleanup: remove this argument from lambdas as it is not used
97gamjak Jul 30, 2026
17ce6db
cleanup: add explicit destructor for private unique ptr
97gamjak Jul 30, 2026
577a990
cleanup: more kokkos PP
97gamjak Jul 30, 2026
e3aae94
fix: add missing cmake dependency to benchmark lib
97gamjak Jul 30, 2026
716e70b
cleanup: correct include paths according to cmake approach
97gamjak Jul 30, 2026
d5939b0
Merge remote-tracking branch 'origin/dev' into add_clangd-tidy_checks
97gamjak Jul 30, 2026
5f4c874
cleanup: remove unused step param
97gamjak Jul 30, 2026
5b6eada
cleanup: remove unused includes
97gamjak Jul 30, 2026
107e27a
fix: add missing step in rst file for rpmd
97gamjak Jul 30, 2026
d0b594c
fix: make check of typeid in tests for engine safer
97gamjak Jul 30, 2026
cb79f6a
chore: fix some rework bugs
97gamjak Jul 30, 2026
7d4ba9e
chore: cmake fix after rework
97gamjak Jul 30, 2026
cf68a0f
cleanup: use bindMember in tests also
97gamjak Jul 30, 2026
6fbb7ed
cleanup: remove unused param for rpmd rst output
97gamjak Jul 30, 2026
ccfee3d
cleanup: remove unused header
97gamjak Jul 30, 2026
8c905db
cleanup: silence unused result warning
97gamjak Jul 30, 2026
ed0d3a5
chore: fix header in tests to be compliant with cmake approach
97gamjak Jul 30, 2026
3cbfd30
cleanup: generalize engine type check
97gamjak Jul 30, 2026
bef34c5
cleanup: remove unused headers
97gamjak Jul 30, 2026
c8f8d89
cleanup: add type checking approach in tests also for potential types
97gamjak Jul 30, 2026
319b354
cleanup: generalize template approach for type checking
97gamjak Jul 30, 2026
a2c997d
chore: some more cleanups and header removals
97gamjak Jul 30, 2026
4307a6c
Merge remote-tracking branch 'origin/dev' into add_clangd-tidy_checks
97gamjak Jul 30, 2026
9dea215
cleanup: finish implementing first version of clangd and clang_tidy c…
97gamjak Jul 30, 2026
4c04e9c
chore: add changelog update
97gamjak Jul 30, 2026
9d6fa6d
chore: add numpy to lint ci
97gamjak Jul 30, 2026
5d858ef
chore: add same on settings as for build workflow
97gamjak Jul 30, 2026
6eb4d8b
chore: fix problems in lint.yml ci
97gamjak Jul 31, 2026
8fffe7b
chore: remove some more kokkos include via PP directive
97gamjak Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
587 changes: 587 additions & 0 deletions .clang-tidy

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .cmake/benchmarking.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FetchContent_Declare(

# Keep project warning policy from being applied to third-party sources.
set(_CMAKE_CXX_FLAGS_BACKUP "${CMAKE_CXX_FLAGS}")
foreach(flag IN ITEMS "-Wswitch-enum" "-Werror=switch-enum")
foreach(flag IN ITEMS "-Wswitch-enum" "-Werror=switch-enum" "-Werror" "-Wundef")
string(REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endforeach()

Expand Down
58 changes: 0 additions & 58 deletions .github/notworkingworkflows/ci_cuda.yml

This file was deleted.

80 changes: 80 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: LINT

on:
pull_request:
branches:
- '*'
paths:
- '.github/workflows/ci_build.yml'
- '.cmake/**'
- 'apps/**'
- 'include/**'
- 'src/**'
- 'integration_tests/**'
- 'tests/**'
- 'benchmarks/CMakeLists.txt'
- 'benchmarks/src/**'
- 'CMakeLists.txt'
- '.clang-tidy'
- 'scripts/clang_tidy.sh'
- '.github/workflows/lint.yml'
push:
Comment thread
97gamjak marked this conversation as resolved.
branches:
- dev
- main
paths:
- '.github/workflows/ci_build.yml'
- '.cmake/**'
- 'apps/**'
- 'include/**'
- 'src/**'
- 'integration_tests/**'
- 'CMakeLists.txt'
- '.clang-tidy'
- 'scripts/clang_tidy.sh'
- '.github/workflows/lint.yml'
- 'benchmarks/src/**'
- 'CMakeLists.txt'
workflow_dispatch:
Comment thread
97gamjak marked this conversation as resolved.

jobs:
lint:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4

- name: Install build tools
run: |
sudo apt update
sudo apt install -y gcc-13 g++-13 mold ninja-build clangd-20
sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-20 100
shell: bash

- name: Setup python
uses: actions/setup-python@v3
with:
python-version: '3.12'

- name: install python dependencies
run: |
python -m pip install numpy
shell: bash

- name: Install clangd-tidy
run: python -m pip install clangd-tidy
shell: bash

- name: Configure (generate compile_commands.json)
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBUILD_WITH_NATIVE=Off
env:
CC: gcc-13
CXX: g++-13

- name: Run clangd-tidy
run: |
clangd-tidy $(find src/ apps/ include/ -name "*.cpp" -o -name "*.hpp" -o -name "*.tpp" 2>/dev/null) -p=build
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ examples/**/tm.out
examples/**/traj2box
examples/**/*.cao


*.gcov

googletest
Expand All @@ -77,3 +76,11 @@ venv
.venv
env
.env

# local clangd output for checks for ci -- not to be committed
clangd-tidy-report.log

# sometimes useful to make a syslink into the main dir from the build dir, but not to be committed
compile_commands.json

CMakePresets.json
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,15 @@
"coulombic",
"Coulombics",
"Coupl",
"Cueq",
"cuequivariance",
"datapoints",
"Derivs",
"DFTD",
"dxyz",
"ekin",
"equil",
"Fennol",
"filterwarnings",
"forcexyz",
"freset",
Expand Down Expand Up @@ -214,6 +218,7 @@
"RSTFILEEXCEPTION",
"RSTFILEOUTPUT",
"SHAKEEXCEPTION",
"Slakos",
"sonarlint",
"STDOUTOUTPUT",
"STREQ",
Expand Down Expand Up @@ -241,4 +246,4 @@
"esbonio.sphinx.confDir": "",
"workbench.colorTheme": "Visual Studio Dark - C++",
"sonarlint.pathToCompileCommands": "${workspaceFolder}/.build/compile_commands.json"
}
}
74 changes: 74 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "clangd-tidy (changed)",
"type": "shell",
"command": "bash",
"args": [
"-c",
"scripts/clang_tidy.sh"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
{
"owner": "clangd-tidy",
"fileLocation": [
"absolute"
],
"pattern": {
"regexp": "^(.*?):(\\d+):(\\d+):\\s*(warning|error|note):\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
],
"group": "build"
},
{
"label": "clangd-tidy (all)",
"type": "shell",
"command": "bash",
"args": [
"-c",
"scripts/clang_tidy.sh --all"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
{
"owner": "clangd-tidy",
"fileLocation": [
"absolute"
],
"pattern": {
"regexp": "^(.*?):(\\d+):(\\d+):\\s*(warning|error|note):\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
],
"group": "build"
},
{
"type": "cmake",
"label": "CMake: build",
"command": "build",
"targets": [
"all"
],
"group": "build",
"problemMatcher": [],
"detail": "CMake template build task"
}
]
}
13 changes: 6 additions & 7 deletions apps/PQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@
<GPL_HEADER>
******************************************************************************/

#include <cstdlib> // for EXIT_SUCCESS
#include <exception> // for exception
#include <filesystem> // for remove_all
#include <iostream> // for operator<<
#include <memory> // for unique_ptr
#include <string> // for string, char_traits
#include <vector> // for vector
#include <cstdlib> // for EXIT_SUCCESS
#include <exception> // for exception
#include <iostream> // for operator<<
#include <memory> // for unique_ptr
#include <string> // for string, char_traits
#include <vector> // for vector

#include "commandLineArgs.hpp" // for CommandLineArgs
#include "engine.hpp" // for Engine
Expand Down
25 changes: 18 additions & 7 deletions benchmarks/perf/perfBenchSetup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "matrix.hpp"
#include "molecule.hpp"
#include "simulationBox.hpp"
#include "vector3d.hpp"

namespace potential
{
Expand Down Expand Up @@ -72,7 +71,9 @@ namespace benchSetup
0.25 * d
};
atom->setPosition(pos);
atom->setPositionOld(pos); // at-rest start (stable for constraints)
atom->setPositionOld(
pos
); // at-rest start (stable for constraints)
atom->setVelocity({0.01 * (d + 1.0), -0.015, 0.02});
atom->setForce({0.1, -0.2, 0.05});
atom->setShiftForce({0.0, 0.0, 0.0});
Expand All @@ -94,11 +95,19 @@ namespace benchSetup
{
auto nonCoulomb = potential::ForceFieldNonCoulomb();
nonCoulomb.setNonCoulombPairsMatrix(
linearAlgebra::Matrix<std::shared_ptr<potential::NonCoulombPair>>(2, 2)
linearAlgebra::Matrix<std::shared_ptr<potential::NonCoulombPair>>(
2,
2
)
);

auto pair =
potential::LennardJonesPair(std::size_t(0), std::size_t(1), 12.0, 2.0, 3.0);
auto pair = potential::LennardJonesPair(
std::size_t(0),
std::size_t(1),
12.0,
2.0,
3.0
);
nonCoulomb.setNonCoulombPairsMatrix(0, 1, pair);
nonCoulomb.setNonCoulombPairsMatrix(1, 0, pair);

Expand All @@ -118,10 +127,12 @@ namespace benchSetup

for (std::size_t m = 0; m < nMolecules; ++m)
{
auto molecule = makeMolecule(nAtomsPerMol, 3.0 * static_cast<double>(m));
auto molecule =
makeMolecule(nAtomsPerMol, 3.0 * static_cast<double>(m));

for (std::size_t i = 0; i < nAtomsPerMol; ++i)
box.addAtom(molecule.getAtoms()[i]); // share the atom pointers
box.addAtom(molecule.getAtoms()[i]
); // share the atom pointers

box.addMolecule(molecule);
}
Expand Down
1 change: 0 additions & 1 deletion benchmarks/perf/perfBoxTransforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

#include "orthorhombicBox.hpp"
#include "triclinicBox.hpp"
#include "vector3d.hpp"

static constexpr long ITERATIONS = 20000;

Expand Down
12 changes: 8 additions & 4 deletions benchmarks/perf/perfConstraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@
#define CALLGRIND_ZERO_STATS
#endif

#include "perfBenchSetup.hpp"
#include "bondConstraint.hpp"
#include "constraints.hpp"
#include "molecule.hpp"
#include "perfBenchSetup.hpp"
#include "simulationBox.hpp"
#include "timingsSettings.hpp"
#include "vector3d.hpp"

static constexpr long ITERATIONS = 1000;

Expand All @@ -59,7 +57,13 @@ int main()

for (std::size_t m = 0; m < molecules.size(); ++m)
constr.addBondConstraint(
constraints::BondConstraint(&molecules[m], &molecules[m], 0, 1, 0.85)
constraints::BondConstraint(
&molecules[m],
&molecules[m],
0,
1,
0.85
)
);

constr.calculateConstraintBondRefs(box);
Expand Down
Loading
Loading