From 8c3c965a3be0a720436fccbaa35bdd3eb5b65243 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Tue, 20 Oct 2026 16:34:24 +0200 Subject: [PATCH 1/3] Port ghost-vector imports and build environments to deal.II 9.8.0 --- .github/workflows/indentation.yml | 1 + .github/workflows/tests.yml | 51 ++++++++-------------------- CMakeLists.txt | 2 +- README.md | 2 +- VERSION | 2 +- docker/Dockerfile | 2 +- docker/Dockerfile.ci | 16 +++++++++ docs/complex-robin.md | 41 ++++++++++++++++------ include/constrained_matrix.h | 2 +- include/constrained_matrix_complex.h | 4 +-- include/true_constrained_matrix.h | 2 +- scripts/docker.sh | 2 +- scripts/dr.sh | 2 +- scripts/run_docker.sh | 4 +-- source/bem_problem.cc | 6 ++-- 15 files changed, 78 insertions(+), 61 deletions(-) create mode 100644 docker/Dockerfile.ci diff --git a/.github/workflows/indentation.yml b/.github/workflows/indentation.yml index b9133bc..05e7744 100644 --- a/.github/workflows/indentation.yml +++ b/.github/workflows/indentation.yml @@ -11,6 +11,7 @@ jobs: runs-on: ubuntu-latest container: + # Formatting is pinned to clang-format 16.0.6 independently of deal.II. image: dealii/dealii:v9.7.1-noble options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 11e3e95..5afedf8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,42 +7,21 @@ on: branches: [ master ] jobs: - debug: - - runs-on: ubuntu-latest - - container: - image: dealii/dealii:v9.7.1-noble - options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 - - steps: - - uses: actions/checkout@v2 - - name: Test debug - run: | - rm -rf build_linux_debug - mkdir build_linux_debug - cd build_linux_debug - cmake .. -GNinja -DCMAKE_CXX_FLAGS=-Werror -DCMAKE_BUILD_TYPE=Debug - ninja - ctest -N - ctest --output-on-failure - - release: - + debug-and-release: runs-on: ubuntu-latest - - container: - image: dealii/dealii:v9.7.1-noble - options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 - steps: - - uses: actions/checkout@v2 - - name: Test release + - uses: actions/checkout@v4 + - name: Build deal.II 9.8.0 CI environment + run: docker build -f docker/Dockerfile.ci -t pi-bem-ci:9.8.0 . + - name: Test Debug and Release without compiler warnings run: | - rm -rf build_linux_release - mkdir build_linux_release - cd build_linux_release - cmake .. -GNinja -DCMAKE_CXX_FLAGS=-Werror -DCMAKE_BUILD_TYPE=Release - ninja - ctest -N - ctest --output-on-failure + docker run --rm \ + -e OMPI_ALLOW_RUN_AS_ROOT=1 -e OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \ + -v "$PWD:/workspace" -w /workspace pi-bem-ci:9.8.0 bash -lc ' + set -e + cmake -S . -B build-docker/9.8.0-ci -GNinja \ + -DCMAKE_BUILD_TYPE=DebugRelease -DCMAKE_CXX_FLAGS=-Werror + cmake --build build-docker/9.8.0-ci -j 2 + cd build-docker/9.8.0-ci + ctest --output-on-failure + ' diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d1c6cd..10b73cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ ENDIF() CMAKE_MINIMUM_REQUIRED(VERSION 3.13.4) -FIND_PACKAGE(deal.II 9.7.1 REQUIRED +FIND_PACKAGE(deal.II 9.8.0 REQUIRED HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR} ) diff --git a/README.md b/README.md index 38666fb..46dd1a2 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Just follow the [instructions](https://github.com/dealii/dealii/wiki/deal.II-in- We provide the possibility of using Docker as a tool to provide a fully operational environment for our library. To use such tool you need to install Docker following the [instructions](https://docs.docker.com/engine/installation/) provided by its authors. Then you can execute the following command line instruction ``` -docker run -v `pwd`:/pwd_to_your_own_directory/ -i -t dealii/dealii:v9.7.1-noble bash +docker run -v `pwd`:/pwd_to_your_own_directory/ -i -t dealii/dealii:v9.8.0-resolute-r1-arm64 bash ``` to retrieve the environment. In such a shell you can easily compile the pi-BEM library following its own instructions. diff --git a/VERSION b/VERSION index ff32e76..834eb3f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.7.1 +9.8.0 diff --git a/docker/Dockerfile b/docker/Dockerfile index 843512a..13032c7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM dealii/dealii:v9.7.1-noble +FROM dealii/dealii:v9.8.0-resolute-r1-arm64 # pi-BEM master image RUN git clone https://github.com/mathLab/pi-BEM/ &&\ diff --git a/docker/Dockerfile.ci b/docker/Dockerfile.ci new file mode 100644 index 0000000..050842d --- /dev/null +++ b/docker/Dockerfile.ci @@ -0,0 +1,16 @@ +# Bootstrap the exact 9.8.0 release for hosted CI while the versioned +# docker-files PR 90 image is available locally but not yet in Docker Hub. +FROM ubuntu:26.04 + +ARG DEAL_II_PACKAGE_VERSION=9.8.0-1~ubuntu26.04.1~ppa2 +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates software-properties-common \ + && add-apt-repository -y ppa:ginggs/deal.ii-9.8.0-backports \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + libdeal.ii-dev=${DEAL_II_PACKAGE_VERSION} \ + build-essential cmake ninja-build git numdiff \ + && rm -rf /var/lib/apt/lists/* +WORKDIR /workspace diff --git a/docs/complex-robin.md b/docs/complex-robin.md index f085ac0..54fdb41 100644 --- a/docs/complex-robin.md +++ b/docs/complex-robin.md @@ -1,16 +1,16 @@ # Multiple potentials, complex problems and Robin conditions -## Build and run with deal.II 9.7.1 +## Build and run with deal.II 9.8.0 From the repository root, build both configurations in the supplied container: ```sh docker run --rm -v "$PWD:/workspace" -w /workspace \ - dealii/dealii:v9.7.1-noble bash -lc ' - cmake -S . -B build-docker/9.7.1 -GNinja \ + dealii/dealii:v9.8.0-resolute-r1-arm64 bash -lc ' + cmake -S . -B build-docker/9.8.0 -GNinja \ -DCMAKE_BUILD_TYPE=DebugRelease -DCMAKE_CXX_FLAGS=-Werror && - cmake --build build-docker/9.7.1 -j 4 && - cd build-docker/9.7.1 && ctest --output-on-failure + cmake --build build-docker/9.8.0 -j 4 && + cd build-docker/9.8.0 && ctest --output-on-failure ' ``` @@ -24,13 +24,13 @@ The sphere examples use paths relative to `samples/`. Keep each run's output separate, and copy both the parameter file and its grid directory: ```sh -mkdir -p build-docker/9.7.1/example-complex -cp -R samples/grids build-docker/9.7.1/example-complex/ +mkdir -p build-docker/9.8.0/example-complex +cp -R samples/grids build-docker/9.8.0/example-complex/ cp samples/ref_params_sphere_complex_DR_direct.prm \ - build-docker/9.7.1/example-complex/parameters_bem_3.prm + build-docker/9.8.0/example-complex/parameters_bem_3.prm docker run --rm -v "$PWD:/workspace" \ - -w /workspace/build-docker/9.7.1/example-complex \ - dealii/dealii:v9.7.1-noble bash -lc ' + -w /workspace/build-docker/9.8.0/example-complex \ + dealii/dealii:v9.8.0-resolute-r1-arm64 bash -lc ' mpirun -np 2 ../bem_fma_3d 2 ' ``` @@ -42,6 +42,27 @@ The samples cover real/complex potentials, DN (Dirichlet/Neumann), DR `Direct` assembles integral matrices and uses an iterative solver; it does not mean a dense direct factorization. FMA is supported in 3D only. +## Hosted CI environment + +Local validation uses `dealii/dealii:v9.8.0-resolute-r1-arm64`, built from +the frozen recipes in [docker-files PR 90](https://github.com/dealii/docker-files/pull/90). +Until that image is published, hosted CI builds `docker/Dockerfile.ci` with the +exact deal.II 9.8.0 backports package on Ubuntu 26.04. This supports hosted AMD64 +runners without depending on a tag that currently exists only locally. +The formatting job retains clang-format 16.0.6 from its existing image. + +To reproduce the hosted environment locally, build it and substitute +`pi-bem-ci:9.8.0` for the image in the commands above: + +```sh +docker build -f docker/Dockerfile.ci -t pi-bem-ci:9.8.0 . +``` + +The deal.II 9.8 update replaces the removed three-argument Trilinos vector +`reinit(source,false,true)` with assignment into the already initialized +ghost layout. The assignment imports both locally owned and ghost values; +it must participate collectively on the vector communicator. + ## Components and boundary-function slots `Potential components` counts real-valued storage components. Each complex diff --git a/include/constrained_matrix.h b/include/constrained_matrix.h index 5542e2f..8128fa1 100644 --- a/include/constrained_matrix.h +++ b/include/constrained_matrix.h @@ -86,7 +86,7 @@ void ConstrainedOperator::vmult(VEC &dst, const VEC &src) const { VEC loc_src(constr_cpu_set); - loc_src.reinit(src, false, true); + loc_src = src; matrix.vmult(dst, src); diff --git a/include/constrained_matrix_complex.h b/include/constrained_matrix_complex.h index 0e63e4f..c0611d9 100644 --- a/include/constrained_matrix_complex.h +++ b/include/constrained_matrix_complex.h @@ -91,7 +91,7 @@ ConstrainedComplexOperator::vmult(VEC &dst, const VEC &src) const auto offset = matrix.this_cpu_set.size(); // store localized constrained values VEC loc_src(constr_cpu_set_complex); - loc_src.reinit(src, false, true); + loc_src = src; // split into real, imag c_src = 0; @@ -258,7 +258,7 @@ BlockConstrainedComplexOperator::vmult(VEC &dst, localized_src.reinit(parallel_partitioning, mpi_communicator); for (unsigned int i = 0; i < src.n_blocks(); ++i) { - localized_src.block(i).reinit(src.block(i), false, true); + localized_src.block(i) = src.block(i); } matrix.vmult(dst.block(0), dst.block(1), src.block(0), src.block(1)); diff --git a/include/true_constrained_matrix.h b/include/true_constrained_matrix.h index 0bbad2d..1cc568d 100644 --- a/include/true_constrained_matrix.h +++ b/include/true_constrained_matrix.h @@ -116,7 +116,7 @@ ConstrainedOperator::constraint_vmult(VEC &dst, const VEC &src) const { VEC loc_src(src.locally_owned_elements(), constr_cpu_set, mpi_communicator); - loc_src.reinit(src, false, true); + loc_src = src; for (unsigned int i = 0; i < dst.size(); ++i) { diff --git a/scripts/docker.sh b/scripts/docker.sh index 0671459..16b525b 100755 --- a/scripts/docker.sh +++ b/scripts/docker.sh @@ -1,3 +1,3 @@ #!/bin/sh # Open the supported deal.II environment in the current checkout. -exec docker run --rm -it -v "$PWD:/app" -w /app dealii/dealii:v9.7.1-noble bash +exec docker run --rm -it -v "$PWD:/app" -w /app dealii/dealii:v9.8.0-resolute-r1-arm64 bash diff --git a/scripts/dr.sh b/scripts/dr.sh index 6d6f0de..adf4ed5 100755 --- a/scripts/dr.sh +++ b/scripts/dr.sh @@ -1,4 +1,4 @@ #!/bin/sh # Run a shell command in the supported deal.II environment. exec docker run --user "$(id -u):$(id -g)" -it --rm \ - -v "$PWD:/app" -w /app dealii/dealii:v9.7.1-noble /bin/sh -c "$*" + -v "$PWD:/app" -w /app dealii/dealii:v9.8.0-resolute-r1-arm64 /bin/sh -c "$*" diff --git a/scripts/run_docker.sh b/scripts/run_docker.sh index 30fb1ac..d40802b 100755 --- a/scripts/run_docker.sh +++ b/scripts/run_docker.sh @@ -1,4 +1,4 @@ #!/bin/sh # Run the same warning-free Debug/Release checks used for releases. -exec docker run --rm -v "$PWD:/app" -w /app dealii/dealii:v9.7.1-noble \ - bash -lc 'set -e; cmake -S . -B build-docker/9.7.1 -GNinja -DCMAKE_BUILD_TYPE=DebugRelease -DCMAKE_CXX_FLAGS=-Werror; cmake --build build-docker/9.7.1 -j 4; cd build-docker/9.7.1; ctest --output-on-failure' +exec docker run --rm -v "$PWD:/app" -w /app dealii/dealii:v9.8.0-resolute-r1-arm64 \ + bash -lc 'set -e; cmake -S . -B build-docker/9.8.0 -GNinja -DCMAKE_BUILD_TYPE=DebugRelease -DCMAKE_CXX_FLAGS=-Werror; cmake --build build-docker/9.8.0 -j 4; cd build-docker/9.8.0; ctest --output-on-failure' diff --git a/source/bem_problem.cc b/source/bem_problem.cc index 73eaa3e..79f2bde 100644 --- a/source/bem_problem.cc +++ b/source/bem_problem.cc @@ -2990,9 +2990,9 @@ BEMProblem::compute_gradients( // We need the solution to be stored on a parallel vector with ghost // elements. We let Trilinos take care of it. TrilinosWrappers::MPI::Vector phi(ghosted_set); - phi.reinit(glob_phi, false, true); + phi = glob_phi; TrilinosWrappers::MPI::Vector dphi_dn(ghosted_set); - dphi_dn.reinit(glob_dphi_dn, false, true); + dphi_dn = glob_dphi_dn; // We reinit the gradient solution get_vector_gradients_solution().reinit(vector_this_cpu_set, mpi_communicator); @@ -3143,7 +3143,7 @@ BEMProblem::compute_surface_gradients( { Teuchos::TimeMonitor LocalTimer(*SurfaceGradientTime); TrilinosWrappers::MPI::Vector phi(ghosted_set); - phi.reinit(tmp_rhs, false, true); + phi = tmp_rhs; get_vector_surface_gradients_solution().reinit(vector_this_cpu_set, mpi_communicator); From 4030e291cd8b4e906ed52da51111286c378f4d0b Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Tue, 20 Oct 2026 16:36:00 +0200 Subject: [PATCH 2/3] Require both Debug and Release executables in hosted CI --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5afedf8..88f61ba 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,6 +22,8 @@ jobs: cmake -S . -B build-docker/9.8.0-ci -GNinja \ -DCMAKE_BUILD_TYPE=DebugRelease -DCMAKE_CXX_FLAGS=-Werror cmake --build build-docker/9.8.0-ci -j 2 + test -x build-docker/9.8.0-ci/bem_fma_3d + test -x build-docker/9.8.0-ci/bem_fma_3d.g cd build-docker/9.8.0-ci ctest --output-on-failure ' From 7b10b1a48bf3c23e9add440eca896106c04c73de Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Tue, 20 Oct 2026 16:59:08 +0200 Subject: [PATCH 3/3] Reuse the documented Docker build path and speed up CI linking --- .github/workflows/tests.yml | 4 +++- docker/Dockerfile.ci | 4 ++++ docs/complex-robin.md | 1 + scripts/run_docker.sh | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 88f61ba..0518c11 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,9 @@ jobs: -v "$PWD:/workspace" -w /workspace pi-bem-ci:9.8.0 bash -lc ' set -e cmake -S . -B build-docker/9.8.0-ci -GNinja \ - -DCMAKE_BUILD_TYPE=DebugRelease -DCMAKE_CXX_FLAGS=-Werror + -DCMAKE_BUILD_TYPE=DebugRelease -DCMAKE_CXX_FLAGS=-Werror \ + -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=mold \ + -DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=mold cmake --build build-docker/9.8.0-ci -j 2 test -x build-docker/9.8.0-ci/bem_fma_3d test -x build-docker/9.8.0-ci/bem_fma_3d.g diff --git a/docker/Dockerfile.ci b/docker/Dockerfile.ci index 050842d..6b0f7df 100644 --- a/docker/Dockerfile.ci +++ b/docker/Dockerfile.ci @@ -13,4 +13,8 @@ RUN apt-get update \ libdeal.ii-dev=${DEAL_II_PACKAGE_VERSION} \ build-essential cmake ninja-build git numdiff \ && rm -rf /var/lib/apt/lists/* +# Linking Debug deal.II consumers with the default linker dominates test time. +RUN apt-get update \ + && apt-get install -y --no-install-recommends mold \ + && rm -rf /var/lib/apt/lists/* WORKDIR /workspace diff --git a/docs/complex-robin.md b/docs/complex-robin.md index 54fdb41..5b3a794 100644 --- a/docs/complex-robin.md +++ b/docs/complex-robin.md @@ -49,6 +49,7 @@ the frozen recipes in [docker-files PR 90](https://github.com/dealii/docker-file Until that image is published, hosted CI builds `docker/Dockerfile.ci` with the exact deal.II 9.8.0 backports package on Ubuntu 26.04. This supports hosted AMD64 runners without depending on a tag that currently exists only locally. +The CI environment uses mold to link the large Debug libraries efficiently. The formatting job retains clang-format 16.0.6 from its existing image. To reproduce the hosted environment locally, build it and substitute diff --git a/scripts/run_docker.sh b/scripts/run_docker.sh index d40802b..fb845c6 100755 --- a/scripts/run_docker.sh +++ b/scripts/run_docker.sh @@ -1,4 +1,4 @@ #!/bin/sh # Run the same warning-free Debug/Release checks used for releases. -exec docker run --rm -v "$PWD:/app" -w /app dealii/dealii:v9.8.0-resolute-r1-arm64 \ +exec docker run --rm -v "$PWD:/workspace" -w /workspace dealii/dealii:v9.8.0-resolute-r1-arm64 \ bash -lc 'set -e; cmake -S . -B build-docker/9.8.0 -GNinja -DCMAKE_BUILD_TYPE=DebugRelease -DCMAKE_CXX_FLAGS=-Werror; cmake --build build-docker/9.8.0 -j 4; cd build-docker/9.8.0; ctest --output-on-failure'