Skip to content

Commit

Permalink
🧹 Major housekeeping (#2274)
Browse files Browse the repository at this point in the history
Housekeeping before v0.10.0

## bump and deprecate dependencies

Go through all submodules, build docs, and other dependencies to adjust
version numbers.
Submodules go to Spack's latest

## `pip` now protects managed environments
MacOS `brew` has becomes finicky lately when it comes to installing
globally via `pip`,
as new versions of `pip` are no longer allowing the user to break global
environments.
Fix by forcing `pip` to disregard that rule, as we set up and tear down
VMs for precisely
this purpose.

Fixes #2273 

## spack develop started to misbehave

Massage code in package.py around handling optimization flags. Output is
a `version` object,
input expects a string. Adjust by converting to string

## fix dubious type punning

`network.cpp` uses `reinterpret_cast` to type pun. Use `memcpy` instead
as recommended.
Also got flagged by compiler warning with newer GCC

## `result_of` -> `invoke_result`

Flagged as deprecated.

## fix includes in `test_*`

Newer versions of GCC require including `algorithm` directly.
  • Loading branch information
thorstenhater authored Jun 12, 2024
1 parent 9d02e21 commit 3ef1682
Show file tree
Hide file tree
Showing 35 changed files with 108 additions and 937 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build-pip-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- ciwheel
tags:
- v*

schedule:
- cron: '0 2 * * 0' # run at 2 AM every sunday

Expand All @@ -23,7 +22,7 @@ jobs:
- name: Create unique version in pyproject.toml
if: startsWith(github.ref, 'refs/tags/v') == false
run: python3 -c 'import time;f=open("pyproject.toml","r+");c = f.readlines();d=[i.split("#")[0].strip()[:-1]+time.strftime("%Y%m%d%H%I%S")+"\"\n" if i.startswith("version") else i for i in c];f.seek(0);f.writelines(d);f.truncate()'
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: arbver
path: ${{ github.workspace }}/pyproject.toml
Expand All @@ -44,18 +43,20 @@ jobs:
- name: Delete pyproject.toml
run: rm -f pyproject.toml
- name: Get pyproject.toml
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: arbver
- name: Check pyproject.toml
run: cat pyproject.toml
- name: Move fast and...
run: python3 -m pip config set global.break-system-packages true
- name: Install cibuildwheel
run: python3 -m pip install cibuildwheel
- name: Build wheels
run: python3 -m cibuildwheel --output-dir dist
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
name: dist-${{ matrix.os }}
path: dist/*.whl

build_sdist:
Expand All @@ -75,7 +76,7 @@ jobs:
- name: Delete pyproject.toml
run: rm -f pyproject.toml
- name: Get pyproject.toml
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: arbver
- name: Check pyproject.toml
Expand All @@ -90,7 +91,7 @@ jobs:
run: scripts/run_python_examples.sh
- name: Test executables
run: scripts/test_executables.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*.tar.gz
Expand All @@ -100,7 +101,7 @@ jobs:
runs-on: ubuntu-latest
needs: [build_binary_wheels, build_sdist]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: dist
- name: Publish distribution 📦 to Test PyPI
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: [3.8]
os: [ubuntu-22.04]
python-version: ["3.10"]
steps:
- name: Set up cmake
uses: jwlawson/actions-setup-cmake@v2.0.0
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,70 +17,70 @@ jobs:
config:
- {
name: "Linux Min GCC",
os: "ubuntu-20.04",
cc: "gcc-9",
cxx: "g++-9",
py: "3.8",
os: "ubuntu-22.04",
cc: "gcc-12",
cxx: "g++-12",
py: "3.9",
cmake: "3.19.x",
mpi: "ON",
simd: "OFF"
}
- {
name: "Linux Min Clang",
os: "ubuntu-20.04",
cc: "clang-9",
cxx: "clang++-9",
py: "3.8",
os: "ubuntu-22.04",
cc: "clang-12",
cxx: "clang++-12",
py: "3.9",
cmake: "3.19.x",
mpi: "ON",
simd: "OFF"
}
- {
name: "MacOS Min",
os: "macos-11",
os: "macos-12",
cc: "clang",
cxx: "clang++",
py: "3.8",
py: "3.9",
cmake: "3.19.x",
mpi: "ON",
simd: "OFF"
}
- {
name: "Linux Max GCC",
os: "ubuntu-22.04",
cc: "gcc-12",
cxx: "g++-12",
py: "3.11",
os: "ubuntu-24.04",
cc: "gcc-14",
cxx: "g++-14",
py: "3.12",
cmake: "3.22.x",
mpi: "ON",
simd: "OFF"
}
- {
name: "Linux SIMD",
os: "ubuntu-22.04",
cc: "gcc-12",
cxx: "g++-12",
py: "3.11",
os: "ubuntu-24.04",
cc: "gcc-14",
cxx: "g++-14",
py: "3.12",
cmake: "3.22.x",
mpi: "OFF",
simd: "ON"
}
- {
name: "Linux Max Clang",
os: "ubuntu-22.04",
cc: "clang-14",
cxx: "clang++-14",
py: "3.11",
os: "ubuntu-24.04",
cc: "clang-18",
cxx: "clang++-18",
py: "3.12",
cmake: "3.22.x",
mpi: "ON",
simd: "OFF"
}
- {
name: "MacOS Max",
os: "macos-13",
os: "macos-14",
cc: "clang",
cxx: "clang++",
py: "3.11",
py: "3.12",
cmake: "3.22.x",
mpi: "ON",
simd: "OFF"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: [3.8]
os: [ubuntu-24.04]
python-version: [3.12]
steps:
- uses: actions/setup-python@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ formats: []
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.10"

python:
install:
Expand Down
48 changes: 25 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project(arbor VERSION ${numeric_version})
enable_language(CXX)

include(GNUInstallDirs)
include(CheckCXXCompilerFlag)

# Effectively adds '-fpic' flag to CXX_FLAGS. Needed for dynamic catalogues.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand All @@ -38,8 +39,13 @@ option(ARBDEV_COLOR "Always produce ANSI-colored output (GNU/Clang only)." OFF)
#----------------------------------------------------------

# Specify target architecture.

set(ARB_ARCH "native" CACHE STRING "Target architecture for arbor libraries")
check_cxx_compiler_flag("-march=native" CXX_HAS_NATIVE)
if(CXX_HAS_NATIVE)
set(ARB_DEFAULT_ARCH "native")
else()
set(ARB_DEFAULT_ARCH "none")
endif()
set(ARB_ARCH ${ARB_DEFAULT_ARCH} CACHE STRING "Target architecture for arbor libraries")

# Perform explicit vectorization?

Expand Down Expand Up @@ -141,13 +147,8 @@ if(ARB_GPU STREQUAL "cuda")
# Pascal, Volta, Ampere, Hopper
set(CMAKE_CUDA_ARCHITECTURES 60 70 80 90)
endif()
elseif(${CUDAToolkit_VERSION_MAJOR} GREATER_EQUAL 11)
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
# Pascal, Volta, Ampere
set(CMAKE_CUDA_ARCHITECTURES 60 70 80)
endif()
else()
message(FATAL_ERROR "Need at least CUDA 11, got ${CUDAToolkit_VERSION_MAJOR}")
message(FATAL_ERROR "Need at least CUDA 12, got ${CUDAToolkit_VERSION_MAJOR}")
endif()

# We _still_ need this otherwise CUDA symbols will not be exported
Expand All @@ -158,7 +159,7 @@ if(ARB_GPU STREQUAL "cuda")
elseif(ARB_GPU STREQUAL "cuda-clang")
include(FindCUDAToolkit)
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES 60 70 80)
set(CMAKE_CUDA_ARCHITECTURES 60 70 80 90)
endif()
set(ARB_WITH_CUDA_CLANG TRUE)
enable_language(CUDA)
Expand Down Expand Up @@ -336,21 +337,23 @@ endif()
# Add SVE compiler flags if detected/desired
set(ARB_SVE_WIDTH "auto" CACHE STRING "Default SVE vector length in bits. Default: auto (detection during configure time).")
mark_as_advanced(ARB_SVE_WIDTH)
if (ARB_SVE_WIDTH STREQUAL "auto")
get_sve_length(ARB_HAS_SVE ARB_SVE_BITS)
if (ARB_HAS_SVE)
message(STATUS "SVE detected with vector size = ${ARB_SVE_BITS} bits")
set(ARB_CXX_SVE_FLAGS " -msve-vector-bits=${ARB_SVE_BITS}")
if (ARB_VECTORIZE)
if (ARB_SVE_WIDTH STREQUAL "auto")
get_sve_length(ARB_HAS_SVE ARB_SVE_BITS)
if (ARB_HAS_SVE)
message(STATUS "SVE detected with vector size = ${ARB_SVE_BITS} bits")
set(ARB_CXX_SVE_FLAGS " -msve-vector-bits=${ARB_SVE_BITS}")
else()
message(STATUS "NO SVE detected")
set(ARB_CXX_SVE_FLAGS "")
endif()
else()
message(STATUS "NO SVE detected")
set(ARB_CXX_SVE_FLAGS "")
set(ARB_SVE_BITS ${ARB_SVE_WIDTH})
set(ARB_CXX_SVE_FLAGS " -msve-vector-bits=${ARB_SVE_BITS}")
endif()
else()
set(ARB_SVE_BITS ${ARB_SVE_WIDTH})
set(ARB_CXX_SVE_FLAGS " -msve-vector-bits=${ARB_SVE_BITS}")
list(APPEND ARB_CXX_FLAGS_TARGET_FULL
"$<$<BUILD_INTERFACE:$<COMPILE_LANGUAGE:CXX>>:${ARB_CXX_SVE_FLAGS}>")
endif()
list(APPEND ARB_CXX_FLAGS_TARGET_FULL
"$<$<BUILD_INTERFACE:$<COMPILE_LANGUAGE:CXX>>:${ARB_CXX_SVE_FLAGS}>")

# Compile with `-fvisibility=hidden` to ensure that the symbols of the generated
# arbor static libraries are hidden from the dynamic symbol tables of any shared
Expand Down Expand Up @@ -378,7 +381,7 @@ endif()
#----------------------------------------------------------

# The minimum version of Python supported by Arbor.
set(arb_py_version 3.8.0)
set(arb_py_version 3.9.0)

if(DEFINED PYTHON_EXECUTABLE)
set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE})
Expand All @@ -404,7 +407,6 @@ if(${Python3_FOUND})
message(STATUS "PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}")
endif()


# Threading model
#-----------------

Expand Down
8 changes: 4 additions & 4 deletions arbor/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#include <cstdint>
#include <memory>
#include <optional>
#include <type_traits>
#include <variant>
#include <vector>

#include "backends/rand_impl.hpp"
Expand All @@ -32,8 +30,10 @@ enum class network_seed : unsigned {
};

std::uint64_t location_hash(const mlocation& loc) {
const double l = static_cast<double>(loc.branch) + loc.pos;
return *reinterpret_cast<const std::uint64_t*>(&l);
double l = static_cast<double>(loc.branch) + loc.pos;
std::uint64_t res;
std::memcpy(&res, &l, sizeof(l));
return res;
}

double uniform_rand(std::array<unsigned, 4> seed,
Expand Down
2 changes: 1 addition & 1 deletion arbor/util/transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class transform_iterator: public iterator_adaptor<transform_iterator<I, F>, I> {
I& inner() { return inner_; }

using inner_value_type = decltype(*inner_);
using raw_value_type = std::result_of_t<F (inner_value_type)>;
using raw_value_type = std::invoke_result_t<F, inner_value_type>;

static constexpr bool present_lvalue = std::is_reference<raw_value_type>::value;

Expand Down
27 changes: 0 additions & 27 deletions ci/cscs/daint_gpu/Dockerfile

This file was deleted.

Loading

0 comments on commit 3ef1682

Please sign in to comment.