Skip to content

Commit 8050a59

Browse files
committed
Merge AMReX-Codes:development into ax3l:fix-pyproj-4
2 parents f97a3c8 + e310bff commit 8050a59

File tree

22 files changed

+437
-122
lines changed

22 files changed

+437
-122
lines changed

.github/workflows/dependencies/dependencies_clang6.sh renamed to .github/workflows/dependencies/dependencies_clang18.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ sudo apt-get update
1111

1212
sudo apt-get install -y \
1313
build-essential \
14-
clang-6.0
14+
clang-18 \
15+
lld \
16+
libc++-18-dev \
17+
libopenmpi-dev \
18+
openmpi-bin

.github/workflows/dependencies/gcc7.sh renamed to .github/workflows/dependencies/dependencies_gcc14.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ sudo apt-get update
1111

1212
sudo apt-get install -y --no-install-recommends\
1313
build-essential \
14-
g++-7 \
14+
g++-14 \
1515
libopenmpi-dev \
1616
openmpi-bin

.github/workflows/dependencies/dependencies_nvcc11.sh renamed to .github/workflows/dependencies/dependencies_nvcc12.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ sudo apt-get install -y \
1616
build-essential \
1717
ca-certificates \
1818
cmake \
19-
g++ \
20-
gfortran \
19+
g++-10 \
20+
gfortran-10 \
2121
gnupg \
2222
libopenmpi-dev \
2323
openmpi-bin \
@@ -29,12 +29,12 @@ echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x8
2929
| sudo tee /etc/apt/sources.list.d/cuda.list
3030
sudo apt-get update
3131
sudo apt-get install -y \
32-
cuda-command-line-tools-11-2 \
33-
cuda-compiler-11-2 \
34-
cuda-cupti-dev-11-2 \
35-
cuda-minimal-build-11-2 \
36-
cuda-nvml-dev-11-2 \
37-
cuda-nvtx-11-2 \
38-
libcurand-dev-11-2 \
39-
libcusparse-dev-11-2
40-
sudo ln -s cuda-11.2 /usr/local/cuda
32+
cuda-command-line-tools-12-2 \
33+
cuda-compiler-12-2 \
34+
cuda-cupti-dev-12-2 \
35+
cuda-minimal-build-12-2 \
36+
cuda-nvml-dev-12-2 \
37+
cuda-nvtx-12-2 \
38+
libcurand-dev-12-2 \
39+
libcusparse-dev-12-2
40+
sudo ln -s cuda-12.2 /usr/local/cuda

.github/workflows/dependencies/hip.sh

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/usr/bin/env bash
22
#
3-
# Copyright 2022 The AMReX Community
3+
# Copyright 2020 The AMReX Community
44
#
55
# License: BSD-3-Clause-LBNL
66
# Authors: Axel Huebl
77

8+
# search recursive inside a folder if a file contains tabs
9+
#
10+
# @result 0 if no files are found, else 1
11+
#
12+
813
set -eu -o pipefail
914

1015
# `man apt.conf`:
@@ -28,13 +33,16 @@ sudo apt-key add rocm.gpg.key
2833

2934
source /etc/os-release # set UBUNTU_CODENAME: focal or jammy or ...
3035

31-
echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${1-latest} ${UBUNTU_CODENAME} main" \
36+
VERSION=${1-6.3.2}
37+
38+
echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${VERSION} ${UBUNTU_CODENAME} main" \
3239
| sudo tee /etc/apt/sources.list.d/rocm.list
3340
echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' \
3441
| sudo tee -a /etc/profile.d/rocm.sh
3542

3643
# we should not need to export HIP_PATH=/opt/rocm/hip with those installs
3744

45+
sudo apt-get clean
3846
sudo apt-get update
3947

4048
# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#installing-development-packages-for-cross-compilation
@@ -46,25 +54,23 @@ sudo apt-get install -y --no-install-recommends \
4654
gfortran \
4755
libnuma-dev \
4856
libopenmpi-dev \
49-
ninja-build \
5057
openmpi-bin \
51-
rocm-dev \
52-
rocfft-dev \
53-
rocprim-dev \
54-
rocrand-dev \
55-
rocsparse-dev \
56-
hiprand-dev
58+
rocm-dev${VERSION} \
59+
roctracer-dev${VERSION} \
60+
rocprofiler-dev${VERSION} \
61+
rocrand-dev${VERSION} \
62+
rocfft-dev${VERSION} \
63+
rocprim-dev${VERSION} \
64+
rocsparse-dev${VERSION}
65+
66+
# hiprand-dev is a new package that does not exist in old versions
67+
sudo apt-get install -y --no-install-recommends hiprand-dev${VERSION} || true
5768

5869
# activate
5970
#
6071
source /etc/profile.d/rocm.sh
6172
hipcc --version
73+
hipconfig --full
6274
which clang
6375
which clang++
64-
65-
# cmake-easyinstall
66-
#
67-
sudo curl -L -o /usr/local/bin/cmake-easyinstall https://raw.githubusercontent.com/ax3l/cmake-easyinstall/main/cmake-easyinstall
68-
sudo chmod a+x /usr/local/bin/cmake-easyinstall
69-
export CEI_SUDO="sudo"
70-
export CEI_TMP="/tmp/cei"
76+
which flang

.github/workflows/hip.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ concurrency:
88

99
jobs:
1010
build_hip:
11-
name: ROCm HIP 6.1
12-
runs-on: ubuntu-20.04
11+
name: ROCm HIP 6.3.2
12+
runs-on: ubuntu-24.04
1313
env:
1414
CXXFLAGS: "-Werror -Wno-deprecated-declarations -Wno-error=pass-failed"
1515
CMAKE_GENERATOR: Ninja
@@ -18,7 +18,7 @@ jobs:
1818
- name: install dependencies
1919
shell: bash
2020
run: |
21-
.github/workflows/dependencies/hip.sh 6.1
21+
.github/workflows/dependencies/hip.sh 6.3.2
2222
.github/workflows/dependencies/dependencies_ccache.sh
2323
- name: Set Up Cache
2424
uses: actions/cache@v4
@@ -27,7 +27,7 @@ jobs:
2727
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
2828
restore-keys: |
2929
ccache-${{ github.workflow }}-${{ github.job }}-git-
30-
- name: build ImpactX
30+
- name: build pyAMReX
3131
shell: bash
3232
run: |
3333
export CCACHE_COMPRESS=1
@@ -46,15 +46,11 @@ jobs:
4646
python3 -m pip install -U build packaging setuptools[core] wheel
4747
python3 -m pip install -U cmake
4848
49-
# "mpic++ --showme" forgets open-pal in Ubuntu 20.04 + OpenMPI 4.0.3
50-
# https://bugs.launchpad.net/ubuntu/+source/openmpi/+bug/1941786
51-
# https://github.com/open-mpi/ompi/issues/9317
52-
export LDFLAGS="-lopen-pal"
53-
5449
cmake -S . -B build \
5550
-DCMAKE_VERBOSE_MAKEFILE=ON \
51+
-DpyAMReX_IPO=OFF \
5652
-DAMReX_GPU_BACKEND=HIP \
57-
-DAMReX_AMD_ARCH=gfx900 \
53+
-DAMReX_AMD_ARCH=gfx90a \
5854
-DAMReX_SPACEDIM="1;2;3"
5955
cmake --build build --target pip_install -j 4
6056

.github/workflows/ubuntu.yml

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ concurrency:
88

99
jobs:
1010
# Build and install libamrex as AMReX CMake project
11-
gcc7:
12-
name: GNU@7.5
13-
runs-on: ubuntu-20.04
11+
gcc10:
12+
name: GNU@10.5 Release
13+
runs-on: ubuntu-24.04
1414
env:
15-
CC: gcc-7
16-
CXX: g++-7
15+
CC: gcc-10
16+
CXX: g++-10
1717
CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names -Wno-array-bounds"
1818
steps:
1919
- uses: actions/checkout@v4
@@ -23,7 +23,7 @@ jobs:
2323
python-version: '3.9'
2424
- name: Dependencies
2525
run: |
26-
.github/workflows/dependencies/gcc7.sh
26+
.github/workflows/dependencies/dependencies_gcc10.sh
2727
.github/workflows/dependencies/dependencies_ccache.sh
2828
- name: Set Up Cache
2929
uses: actions/cache@v4
@@ -56,15 +56,15 @@ jobs:
5656
run: |
5757
mpiexec -np 1 python3 -m pytest tests/
5858
59-
gcc10:
60-
name: GNU@10.5 Debug
61-
runs-on: ubuntu-22.04
59+
gcc14:
60+
name: GNU@14.5 Debug
61+
runs-on: ubuntu-24.04
6262
env: {CXXFLAGS: "-Werror -Wno-error=deprecated-declarations -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"}
6363
steps:
6464
- uses: actions/checkout@v4
6565
- name: Dependencies
6666
run: |
67-
.github/workflows/dependencies/dependencies_gcc10.sh
67+
.github/workflows/dependencies/dependencies_gcc14.sh
6868
.github/workflows/dependencies/dependencies_ccache.sh
6969
- name: Set Up Cache
7070
uses: actions/cache@v4
@@ -80,8 +80,8 @@ jobs:
8080
export CCACHE_MAXSIZE=600M
8181
ccache -z
8282
83-
export CC=$(which gcc-10)
84-
export CXX=$(which g++-10)
83+
export CC=$(which gcc-14)
84+
export CXX=$(which g++-14)
8585
python3 -m pip install -U pip
8686
python3 -m pip install -U build packaging setuptools[core] wheel
8787
python3 -m pip install -U cmake
@@ -108,15 +108,15 @@ jobs:
108108
rm -rf build
109109
python3 -m pytest tests
110110
111-
clang6:
112-
name: Clang@6.0 w/o MPI
113-
runs-on: ubuntu-20.04
111+
clang14:
112+
name: Clang@14.0 w/o MPI
113+
runs-on: ubuntu-24.04
114114
env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -fno-operator-names -Wno-pass-failed"}
115115
steps:
116116
- uses: actions/checkout@v4
117117
- name: Dependencies
118118
run: |
119-
.github/workflows/dependencies/dependencies_clang6.sh
119+
.github/workflows/dependencies/dependencies_clang14_libcpp.sh
120120
.github/workflows/dependencies/dependencies_ccache.sh
121121
- name: Set Up Cache
122122
uses: actions/cache@v4
@@ -134,8 +134,8 @@ jobs:
134134
135135
export CMAKE_BUILD_PARALLEL_LEVEL=4
136136
137-
export CC=$(which clang-6.0)
138-
export CXX=$(which clang++-6.0)
137+
export CC=$(which clang-14)
138+
export CXX=$(which clang++-14)
139139
python3 -m pip install -U pip
140140
python3 -m pip install -U build packaging setuptools[core] wheel
141141
python3 -m pip install -U cmake pytest
@@ -151,9 +151,9 @@ jobs:
151151
run: |
152152
python3 -m pytest tests/
153153
154-
clang14:
155-
name: Clang@14.0 w/ libc++ w/ MPI
156-
runs-on: ubuntu-22.04
154+
clang18:
155+
name: Clang@18.0 w/ libc++ w/ MPI
156+
runs-on: ubuntu-24.04
157157
env:
158158
CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -fno-operator-names -Wno-pass-failed -stdlib=libc++"
159159
LDFLAGS: "-fuse-ld=lld"
@@ -163,7 +163,7 @@ jobs:
163163
- uses: actions/checkout@v4
164164
- name: Dependencies
165165
run: |
166-
.github/workflows/dependencies/dependencies_clang14_libcpp.sh
166+
.github/workflows/dependencies/dependencies_clang18.sh
167167
.github/workflows/dependencies/dependencies_ccache.sh
168168
- name: Set Up Cache
169169
uses: actions/cache@v4
@@ -181,6 +181,8 @@ jobs:
181181
182182
export CMAKE_BUILD_PARALLEL_LEVEL=4
183183
184+
export CC=$(which clang-18)
185+
export CXX=$(which clang++-18)
184186
python3 -m pip install -U pip
185187
python3 -m pip install -U build packaging setuptools[core] wheel
186188
python3 -m pip install -U cmake
@@ -198,14 +200,14 @@ jobs:
198200
python3 -m pytest tests/
199201
200202
nvcc11:
201-
name: CUDA@11.2 GNU@9.4.0
202-
runs-on: ubuntu-20.04
203+
name: CUDA@12.2 GNU@10.5
204+
runs-on: ubuntu-24.04
203205
env: {CXXFLAGS: "-fno-operator-names"}
204206
steps:
205207
- uses: actions/checkout@v4
206208
- name: Dependencies
207209
run: |
208-
.github/workflows/dependencies/dependencies_nvcc11.sh
210+
.github/workflows/dependencies/dependencies_nvcc12.sh
209211
.github/workflows/dependencies/dependencies_ccache.sh
210212
- name: Set Up Cache
211213
uses: actions/cache@v4
@@ -225,9 +227,9 @@ jobs:
225227
export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
226228
which nvcc || echo "nvcc not in PATH!"
227229
228-
export CC=$(which gcc)
229-
export CXX=$(which g++)
230-
export CUDAHOSTCXX=$(which g++)
230+
export CC=$(which gcc-10)
231+
export CXX=$(which g++-10)
232+
export CUDAHOSTCXX=$(which g++-10)
231233
232234
python3 -m pip install -U pip
233235
python3 -m pip install -U build packaging setuptools[core] wheel

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ repos:
7474
# Python: Ruff linter & formatter
7575
# https://docs.astral.sh/ruff/
7676
- repo: https://github.com/astral-sh/ruff-pre-commit
77-
rev: v0.11.2
77+
rev: v0.11.8
7878
hooks:
7979
# Run the linter
8080
- id: ruff

cmake/dependencies/AMReX.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ option(pyAMReX_amrex_internal "Download & build AMReX" ON)
8686
set(pyAMReX_amrex_repo "https://github.com/AMReX-Codes/amrex.git"
8787
CACHE STRING
8888
"Repository URI to pull and build AMReX from if(pyAMReX_amrex_internal)")
89-
set(pyAMReX_amrex_branch "25.04"
89+
set(pyAMReX_amrex_branch "793ea9f717590d66d178a86298b82aac244b77a7"
9090
CACHE STRING
9191
"Repository branch for pyAMReX_amrex_repo if(pyAMReX_amrex_internal)")
9292

src/Base/BoxArray.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,30 +120,27 @@ void init_BoxArray(py::module &m) {
120120
//! \brief Grow each Box in the BoxArray on the high end
121121
//! by n_cell cells in the idir direction.
122122
BoxArray& growHi (int idir, int n_cell);
123-
//! \brief Apply surroundingNodes(Box) to each Box in BoxArray.
124-
//! See the documentation of Box for details.
125-
BoxArray& surroundingNodes ();
126-
//!
123+
*/
124+
127125
//! \brief Apply surroundingNodes(Box,int) to each Box in
128126
//! BoxArray. See the documentation of Box for details.
129-
BoxArray& surroundingNodes (int dir);
130-
*/
127+
.def("surroundingNodes",
128+
py::overload_cast<>(&BoxArray::surroundingNodes))
129+
.def("surroundingNodes",
130+
py::overload_cast<int>(&BoxArray::surroundingNodes))
131131

132132
//! Apply Box::enclosedCells() to each Box in the BoxArray.
133133
.def("enclosed_cells",
134134
py::overload_cast<>(&BoxArray::enclosedCells))
135135
.def("enclosed_cells",
136136
py::overload_cast<int>(&BoxArray::enclosedCells))
137137

138+
//! Convert nodality of each box in the BoxArray
139+
.def("convert",
140+
py::overload_cast< IndexType >(&BoxArray::convert))
141+
.def("convert",
142+
py::overload_cast< IntVect const &>(&BoxArray::convert))
138143
/*
139-
//! Apply Box::convert(IndexType) to each Box in the BoxArray.
140-
BoxArray& convert (IndexType typ);
141-
142-
BoxArray& convert (const IntVect& typ);
143-
144-
//! Apply function (*fp)(Box) to each Box in the BoxArray.
145-
BoxArray& convert (Box (*fp)(const Box&));
146-
147144
//! Apply Box::shift(int,int) to each Box in the BoxArray.
148145
BoxArray& shift (int dir, int nzones);
149146

0 commit comments

Comments
 (0)