diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index aad5a89b2..f412d2fdf 100755 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -21,6 +21,12 @@ on: env: ARTIFACT_RETENTION: ${{ github.ref == 'refs/heads/main' && '30' || '7' }} +# Merges queue up fast; a newer main supersedes an older smoke build. Release +# builds must never cancel each other, so only non-release runs are cancelled. +concurrency: + group: build-wheels-${{ github.ref }} + cancel-in-progress: ${{ github.event_name != 'release' }} + jobs: cpython-linux-x86_64: name: 'Linux CPython (${{ matrix.cibw_archs }}, ${{ matrix.manylinux_image }})' diff --git a/.github/workflows/ci-matrix.yml b/.github/workflows/ci-matrix.yml index ff0110448..3531c35ec 100644 --- a/.github/workflows/ci-matrix.yml +++ b/.github/workflows/ci-matrix.yml @@ -14,6 +14,11 @@ permissions: contents: read actions: read +# PR updates supersede each other; pushes to main and manual runs never cancel. +concurrency: + group: ci-matrix-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + env: OMP_NUM_THREADS: 2 CXX_STANDARD: 20 @@ -25,6 +30,10 @@ env: jobs: build: name: "${{ matrix.os }} (${{ matrix.arch }}, ${{ matrix.compiler }})" + # Pushes to main were already validated as PRs; post-merge coverage comes + # from release-build below (plus the wheel smoke build), so don't redo the + # PR checks on every merge. + if: github.event_name != 'push' runs-on: ${{ matrix.runner }} # The gcc-13 builds run in manylinux_2_28 containers (glibc 2.28 # compatible release binaries); macos/windows/llvm-20 run on their runners. diff --git a/CMakeLists.txt b/CMakeLists.txt index eb4be2ac2..8717129fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -719,7 +719,7 @@ add_subdirectory(networkit/cpp) set(NETWORKIT_LIBRARIES networkit) install(DIRECTORY include/networkit DESTINATION ${NETWORKIT_INSTALL_INCLUDE_DIR} - FILES_MATCHING PATTERN "*.hpp") + FILES_MATCHING PATTERN "*.hpp" PATTERN "*.tpp") # Install ttmath header files install(DIRECTORY extlibs/ttmath/ttmath diff --git a/include/networkit/graph/InducedSubgraphView.hpp b/include/networkit/graph/InducedSubgraphView.hpp index 8d5f3337d..1a66276f2 100644 --- a/include/networkit/graph/InducedSubgraphView.hpp +++ b/include/networkit/graph/InducedSubgraphView.hpp @@ -541,14 +541,14 @@ class InducedSubgraphView : public std::conditional_t outDegreeC_; - /// Only populated on a directed base. - Aux::flat_map inDegreeC_; + /// updated in place by every edit, so readers never observe a stale mapping. In- and + /// out-degrees share one map because they have identical key sets; a second map would + /// duplicate the keys (n * sizeof(node) bytes) and double the sorted-insertion work. + /// The `in` field is unused on an undirected base. + struct CompactDegrees { + count out = 0; + count in = 0; + }; + Aux::flat_map degreesC_; count n_ = 0, m_ = 0, selfLoops_ = 0; bool directed_; /// When true, the GraphLike primitives present dense ids @c [0, n) while the membership @@ -788,7 +793,7 @@ class InducedSubgraphView : public std::conditional_t void addNodesImpl(const NodeRange &nodes) { @@ -924,10 +937,8 @@ class InducedSubgraphView : public std::conditional_t