Skip to content

Commit

Permalink
Merge branch 'support-numpy-2.0' into trunk-minor
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Jun 4, 2024
2 parents bcbe5b8 + 9be61ba commit 7725617
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
name: Build release tarball
runs-on: ubuntu-latest
container:
image: glotzerlab/ci:2024.03.01-ubuntu20.04
image: glotzerlab/ci:2024.06.04-ubuntu20.04

steps:
- name: Checkout
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/templates/configurations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,16 @@ validate_configurations:
# Configurations to build and test only rarely, such as just before a release.
# There should be no overlap between this list and `unit_test_configurations`
release_test_configurations:
- config: "[gcc12_py311]"
- config: "[clang16_py311, mpi, llvm]"
- config: "[clang15_py311, mpi, llvm]"
- config: "[clang18_py312, mpi]"
- config: "[clang17_py312, mpi]"
- config: "[clang16_py312, mpi, llvm]"
- config: "[clang15_py312, mpi, llvm]"
- config: "[clang13_py310, llvm]"
- config: "[clang12_py310, llvm]"
- config: "[clang11_py310, llvm]"
- config: "[gcc14_py312]"
- config: "[gcc12_py311]"
- config: "[gcc11_py310]"
- config: "[gcc10_py310]"
- config: "[cuda118_gcc11_py310, mpi, llvm]"
- config: "[cuda117_gcc11_py310, mpi, llvm]"
- config: "[cuda116_gcc9_py38, mpi, llvm]"
- config: "[cuda115_gcc9_py38, mpi, llvm]"
- config: "[cuda114_gcc9_py38, mpi, llvm]"
- config: "[cuda113_gcc9_py38, mpi, llvm]"
- config: "[cuda112_gcc9_py38, mpi, llvm]"
- config: "[cuda111_gcc9_py38, mpi, llvm]"
- config: "[clang10_py38, llvm]"
2 changes: 1 addition & 1 deletion .github/workflows/templates/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% block name %><% endblock %>
<% set container_prefix="glotzerlab/ci:2024.03.01" %>
<% set container_prefix="glotzerlab/ci:2024.06.04" %>

<% block concurrency %>
concurrency:
Expand Down
62 changes: 25 additions & 37 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
name: Build [${{ join(matrix.config, '_') }}]
runs-on: ${{ matrix.build_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
image: glotzerlab/ci:2024.06.04-${{ matrix.config[0] }}
strategy:
matrix:
include:
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
needs: build
runs-on: ${{ matrix.test_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
image: glotzerlab/ci:2024.06.04-${{ matrix.config[0] }}
options: ${{ matrix.test_docker_options }} -e CUDA_VISIBLE_DEVICES
strategy:
matrix:
Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
needs: build
runs-on: ${{ matrix.test_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
image: glotzerlab/ci:2024.06.04-${{ matrix.config[0] }}
options: ${{ matrix.test_docker_options }} -e CUDA_VISIBLE_DEVICES
strategy:
matrix:
Expand Down Expand Up @@ -285,7 +285,7 @@ jobs:
needs: build
runs-on: ${{ matrix.test_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
image: glotzerlab/ci:2024.06.04-${{ matrix.config[0] }}
options: ${{ matrix.test_docker_options }} -e CUDA_VISIBLE_DEVICES
strategy:
matrix:
Expand Down Expand Up @@ -336,27 +336,23 @@ jobs:
name: Build [${{ join(matrix.config, '_') }}]
runs-on: ${{ matrix.build_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
image: glotzerlab/ci:2024.06.04-${{ matrix.config[0] }}
strategy:
matrix:
include:
- {config: [gcc12_py311], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang16_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang15_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang18_py312, mpi], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang17_py312, mpi], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang16_py312, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang15_py312, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang13_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang12_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang11_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc14_py312], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc12_py311], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc11_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc10_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [cuda118_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda117_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda116_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda115_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda114_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda113_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda112_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda111_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [clang10_py38, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }

if: ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
steps:
Expand Down Expand Up @@ -450,28 +446,24 @@ jobs:
needs: build_release
runs-on: ${{ matrix.test_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
image: glotzerlab/ci:2024.06.04-${{ matrix.config[0] }}
options: ${{ matrix.test_docker_options }} -e CUDA_VISIBLE_DEVICES
strategy:
matrix:
include:
- {config: [gcc12_py311], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang16_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang15_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang18_py312, mpi], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang17_py312, mpi], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang16_py312, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang15_py312, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang13_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang12_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang11_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc14_py312], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc12_py311], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc11_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc10_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [cuda118_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda117_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda116_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda115_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda114_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda113_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda112_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda111_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [clang10_py38, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }

if: ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
steps:
Expand Down Expand Up @@ -520,28 +512,24 @@ jobs:
needs: build_release
runs-on: ${{ matrix.test_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
image: glotzerlab/ci:2024.06.04-${{ matrix.config[0] }}
options: ${{ matrix.test_docker_options }} -e CUDA_VISIBLE_DEVICES
strategy:
matrix:
include:
- {config: [gcc12_py311], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang16_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang15_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang18_py312, mpi], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang17_py312, mpi], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang16_py312, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang15_py312, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang13_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang12_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang11_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc14_py312], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc12_py311], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc11_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc10_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [cuda118_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda117_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda116_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda115_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda114_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda113_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda112_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda111_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [clang10_py38, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }

if: ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
steps:
Expand Down
6 changes: 3 additions & 3 deletions BUILDING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ Install prerequisites
**General requirements:**

- C++17 capable compiler (tested with ``gcc`` 9 - 13 and ``clang`` 10 - 16)
- Python >= 3.8
- NumPy >= 1.17.3
- pybind11 >= 2.6
- Python >= 3.9
- NumPy >= 1.19
- pybind11 >= 2.12
- Eigen >= 3.2
- CMake >= 3.15

Expand Down
2 changes: 1 addition & 1 deletion CMake/hoomd/HOOMDPythonSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (Python_FOUND)
endif()
endif()

find_package(pybind11 2.2 CONFIG REQUIRED)
find_package(pybind11 2.12 CONFIG REQUIRED)

if (pybind11_FOUND)
find_package_message(pybind11 "Found pybind11: ${pybind11_DIR} ${pybind11_INCLUDE_DIR} (version ${pybind11_VERSION})" "[${pybind11_DIR}][${pybind11_INCLUDE_DIR}]")
Expand Down
2 changes: 1 addition & 1 deletion hoomd-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ set(PYTHON_SITE_INSTALL_DIR "@PYTHON_SITE_INSTALL_DIR@")
# configure python
set(Python_FIND_UNVERSIONED_NAMES "FIRST")
find_package(Python REQUIRED COMPONENTS Interpreter Development)
find_package(pybind11 2.2 CONFIG REQUIRED)
find_package(pybind11 2.12 CONFIG REQUIRED)
find_package_message(pybind11 "Found pybind11: ${pybind11_DIR} ${pybind11_INCLUDE_DIR} (version ${pybind11_VERSION})" "[${pybind11_DIR}][${pybind11_INCLUDE_DIR}]")

find_package(Eigen3 3.2 CONFIG REQUIRED)
Expand Down
19 changes: 13 additions & 6 deletions hoomd/md/pytest/test_custom_force.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,22 @@ def set_forces(self, timestep):
tags = local_snapshot.particles.tag
force_arrays.force[:] = np.stack((tags * 1, tags * 2, tags * 3),
axis=-1)
energy = local_snapshot.particles.tag * -10
energy = local_snapshot.particles.tag.astype(np.float64) * -10.0
force_arrays.potential_energy[:] = energy
tags_float = tags.astype(np.float64)
force_arrays.torque[:] = np.stack(
(tags * -3, tags * -2, tags * -1), axis=-1)
(tags_float * -3.0, tags_float * -2.0, tags_float * -1.0),
axis=-1)
if force_arrays.virial.shape[0] != 0:
force_arrays.virial[:] = np.stack(
(tags * 1, tags * -2, tags * -3, tags * 4, tags * -5,
tags * 6),
axis=-1)
force_arrays.virial[:] = np.stack((
tags_float * 1.0,
tags_float * -2.0,
tags_float * -3.0,
tags_float * 4.0,
tags_float * -5.0,
tags_float * 6.0,
),
axis=-1)


@pytest.mark.cpu
Expand Down

0 comments on commit 7725617

Please sign in to comment.