diff --git a/.circleci/config.yml b/.circleci/config.yml index 0f4e63c0043..836c60b58e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -122,7 +122,7 @@ jobs: build-complex: docker: - - image: ghcr.io/fenics/test-env:latest-mpich + - image: ghcr.io/fenics/test-env:nightly-mpich environment: DEBIAN_FRONTEND: "noninteractive" PETSC_ARCH: "linux-gnu-complex-32" diff --git a/RELEASE.md b/RELEASE.md index 27ab5aaa9de..44a1f54c7a2 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -32,7 +32,10 @@ UFL still runs on the year-based release scheme. 1. Merge `main` into `release` resolving all conflicts in favour of `main`. - git merge -Xtheirs main + git checkout release + git merge --no-commit main + git checkout --theirs main . + git diff main 2. Update version numbers, e.g. @@ -50,7 +53,10 @@ UFL still runs on the year-based release scheme. 1. Merge `main` into `release` resolving all conflicts in favour of `main`. - git merge -Xtheirs main + git checkout release + git merge --no-commit main + git checkout --theirs main . + git diff main 2. Update the version number in `setup.cfg`, e.g. `2022.2.0`. @@ -62,7 +68,10 @@ UFL still runs on the year-based release scheme. 1. Merge `main` into `release` resolving all conflicts in favour of `main`. - git merge -Xtheirs main + git checkout release + git merge --no-commit main + git checkout --theirs main . + git diff main 2. Update the version number in `setup.cfg`, e.g. `0.5.0`. @@ -70,7 +79,7 @@ UFL still runs on the year-based release scheme. 4. If necessary, update the version number in `cmake/CMakeLists.txt`, e.g. `0.5.0`. -5. Update the version number macros in `ffcx/code_generation/ufcx.h`. Typically this +5. Update the version number macros in `ffcx/codegeneration/ufcx.h`. Typically this should match the Python version number. Remember to change the `UFCX_VERSION_RELEASE` to `1`. @@ -82,7 +91,10 @@ UFL still runs on the year-based release scheme. 1. Merge `main` into `release` resolving all conflicts in favour of `main`. - git merge -Xtheirs main + git checkout release + git merge --no-commit main + git checkout --theirs main . + git diff main 2. In `cpp/CMakeLists.txt` change the version number near the top of the file, e.g. `0.5.0`. @@ -92,7 +104,7 @@ UFL still runs on the year-based release scheme. there is no need to change anything here. However, if they don't match, you need to manually specify the appropriate UFCx version. -4. In `python/setup.cfg` change the `VERSION` variable to e.g. `0.5.0` and +4. In `python/setup.py` change the `VERSION` variable to e.g. `0.5.0` and update the depedency versions for `fenics-ffcx` and `fenics-ufl`. 5. Commit and push. diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index ac7a386e9e9..97cf19db1b4 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1,6 +1,6 @@ # ------------------------------------------------------------------------------ # Top level CMakeLists.txt file for DOLFINx -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.19) # ------------------------------------------------------------------------------ # Set project name and version number @@ -189,7 +189,7 @@ if(BASIX_PY_DIR) endif() endif() -find_package(Basix REQUIRED CONFIG HINTS ${BASIX_PY_DIR}) +find_package(Basix 0.6 REQUIRED CONFIG HINTS ${BASIX_PY_DIR}) set_package_properties( basix PROPERTIES TYPE REQUIRED diff --git a/cpp/cmake/modules/FindUFCx.cmake b/cpp/cmake/modules/FindUFCx.cmake index ebc21272426..a64e186a92c 100644 --- a/cpp/cmake/modules/FindUFCx.cmake +++ b/cpp/cmake/modules/FindUFCx.cmake @@ -72,5 +72,6 @@ mark_as_advanced(UFCX_VERSION UFCX_INCLUDE_DIRS UFCX_SIGNATURE) find_package_handle_standard_args( UFCx REQUIRED_VARS UFCX_INCLUDE_DIRS UFCX_SIGNATURE UFCX_VERSION - VERSION_VAR UFCX_VERSION REASON_FAILURE_MESSAGE "UFCx could not be found." + VERSION_VAR UFCX_VERSION HANDLE_VERSION_RANGE REASON_FAILURE_MESSAGE + "UFCx could not be found." ) diff --git a/cpp/cmake/scripts/generate-cmakefiles.py b/cpp/cmake/scripts/generate-cmakefiles.py index 138fe5cdfa0..9402c9d3ae4 100644 --- a/cpp/cmake/scripts/generate-cmakefiles.py +++ b/cpp/cmake/scripts/generate-cmakefiles.py @@ -12,7 +12,7 @@ # # python cmake/scripts/generate-cmakefiles from dolfinx/cpp # -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.19) set(PROJECT_NAME {project_name}) project(${{PROJECT_NAME}} LANGUAGES C CXX) @@ -118,7 +118,7 @@ # # python cmake/scripts/generate-cmakefiles from dolfinx/cpp # -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.19) set(PROJECT_NAME {project_name}) project(${{PROJECT_NAME}} LANGUAGES C CXX) diff --git a/cpp/dolfinx/CMakeLists.txt b/cpp/dolfinx/CMakeLists.txt index 04ba52e18ba..1124dc43f93 100644 --- a/cpp/dolfinx/CMakeLists.txt +++ b/cpp/dolfinx/CMakeLists.txt @@ -182,7 +182,7 @@ include(CMakePackageConfigHelpers) write_basic_package_version_file( ${CMAKE_BINARY_DIR}/dolfinx/DOLFINXConfigVersion.cmake VERSION ${DOLFINX_VERSION} - COMPATIBILITY ExactVersion + COMPATIBILITY AnyNewerVersion ) configure_package_config_file( diff --git a/cpp/dolfinx/mesh/Mesh.cpp b/cpp/dolfinx/mesh/Mesh.cpp index 277b56c3eb5..bd3418374f4 100644 --- a/cpp/dolfinx/mesh/Mesh.cpp +++ b/cpp/dolfinx/mesh/Mesh.cpp @@ -322,8 +322,11 @@ mesh::create_submesh(const Mesh& mesh, int dim, // NOTE: Unclear what this return for prisms const std::size_t num_entity_dofs = layout.num_entity_closure_dofs(dim); - std::vector geometry_indices(num_entity_dofs - * submesh_to_mesh_map.size()); + std::vector geometry_indices; + geometry_indices.reserve(num_entity_dofs * submesh_to_mesh_map.size()); + std::vector submesh_x_dofmap_offsets; + submesh_x_dofmap_offsets.reserve(submesh_to_mesh_map.size() + 1); + submesh_x_dofmap_offsets.push_back(0); { const graph::AdjacencyList& xdofs = geometry.dofmap(); const int tdim = topology.dim(); @@ -354,8 +357,9 @@ mesh::create_submesh(const Mesh& mesh, int dim, = closure_dofs[dim][local_entity]; auto xc = xdofs.links(cell); - for (std::size_t j = 0; j < num_entity_dofs; ++j) - geometry_indices[i * num_entity_dofs + j] = xc[entity_dofs[j]]; + for (std::int32_t entity_dof : entity_dofs) + geometry_indices.push_back(xc[entity_dof]); + submesh_x_dofmap_offsets.push_back(geometry_indices.size()); } } @@ -413,26 +417,18 @@ mesh::create_submesh(const Mesh& mesh, int dim, mesh_to_submesh_x_dof_map[submesh_to_mesh_x_dof_map[i]] = i; // Create submesh geometry dofmap - std::vector entity_x_dofs; std::vector submesh_x_dofmap_vec; submesh_x_dofmap_vec.reserve(geometry_indices.size()); - std::vector submesh_x_dofmap_offsets(1, 0); - submesh_x_dofmap_offsets.reserve(submesh_to_mesh_map.size() + 1); - for (std::size_t i = 0; i < submesh_to_mesh_map.size(); ++i) - { - // Get the mesh geometry dofs for ith entity in entities - auto it = std::next(geometry_indices.begin(), i * num_entity_dofs); - entity_x_dofs.assign(it, std::next(it, num_entity_dofs)); + std::transform(geometry_indices.cbegin(), geometry_indices.cend(), + std::back_inserter(submesh_x_dofmap_vec), + [&mesh_to_submesh_x_dof_map](auto x_dof) + { + std::int32_t x_dof_submesh + = mesh_to_submesh_x_dof_map[x_dof]; + assert(x_dof_submesh != -1); + return x_dof_submesh; + }); - // For each mesh dof of the entity, get the submesh dof - for (std::int32_t x_dof : entity_x_dofs) - { - std::int32_t x_dof_submesh = mesh_to_submesh_x_dof_map[x_dof]; - assert(x_dof_submesh != -1); - submesh_x_dofmap_vec.push_back(x_dof_submesh); - } - submesh_x_dofmap_offsets.push_back(submesh_x_dofmap_vec.size()); - } graph::AdjacencyList submesh_x_dofmap( std::move(submesh_x_dofmap_vec), std::move(submesh_x_dofmap_offsets)); diff --git a/docker/Dockerfile.oneapi b/docker/Dockerfile.oneapi index b5be1522638..b8430d5cb59 100644 --- a/docker/Dockerfile.oneapi +++ b/docker/Dockerfile.oneapi @@ -10,7 +10,7 @@ ARG HDF5_SERIES=1.12 ARG HDF5_PATCH=2 ARG PETSC_VERSION=3.17.5 ARG SLEPC_VERSION=3.17.2 -ARG PYBIND11_VERSION=2.10.1 +ARG PYBIND11_VERSION=2.10.2 ARG KAHIP_VERSION=3.14 WORKDIR /tmp @@ -20,6 +20,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get -qq update && \ apt-get -yq --with-new-pkgs -o Dpkg::Options::="--force-confold" upgrade && \ apt-get -y install \ + bzip2 \ cmake \ gnupg \ libboost-dev \ @@ -36,12 +37,10 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Install oneAPI libraries -RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \ - apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \ - echo "deb https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \ +RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \ + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \ apt-get update && \ - apt-get install -y intel-oneapi-common-vars intel-oneapi-compiler-dpcpp-cpp \ - intel-oneapi-mkl-devel intel-oneapi-mpi-devel intel-oneapi-python && \ + apt-get install -y libstdc++-11-dev intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel intel-oneapi-mpi-devel intel-oneapi-python && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -100,7 +99,6 @@ RUN . /opt/intel/oneapi/setvars.sh && \ --with-64-bit-indices=no \ --with-fortran-bindings=no \ --with-shared-libraries \ - --download-hypre \ --download-superlu_dist \ --with-scalar-type=real && \ make PETSC_DIR=/usr/local/petsc PETSC_ARCH=linux-gnu-real-32 ${MAKEFLAGS} all && \ @@ -110,7 +108,6 @@ RUN . /opt/intel/oneapi/setvars.sh && \ --with-64-bit-indices=no \ --with-fortran-bindings=no \ --with-shared-libraries \ - --download-hypre \ --download-superlu_dist \ --with-scalar-type=complex && \ make PETSC_DIR=/usr/local/petsc PETSC_ARCH=linux-gnu-complex-32 ${MAKEFLAGS} all && \ @@ -120,7 +117,6 @@ RUN . /opt/intel/oneapi/setvars.sh && \ --with-64-bit-indices=yes \ --with-fortran-bindings=no \ --with-shared-libraries \ - --download-hypre \ --download-superlu_dist \ --with-scalar-type=real && \ make PETSC_DIR=/usr/local/petsc PETSC_ARCH=linux-gnu-real-64 ${MAKEFLAGS} all && \ @@ -130,7 +126,6 @@ RUN . /opt/intel/oneapi/setvars.sh && \ --with-64-bit-indices=yes \ --with-fortran-bindings=no \ --with-shared-libraries \ - --download-hypre \ --download-superlu_dist \ --with-scalar-type=complex && \ make PETSC_DIR=/usr/local/petsc PETSC_ARCH=linux-gnu-complex-64 ${MAKEFLAGS} all && \ diff --git a/python/test/unit/common/test_timer.py b/python/test/unit/common/test_timer.py index f390715954d..0488041ece9 100644 --- a/python/test/unit/common/test_timer.py +++ b/python/test/unit/common/test_timer.py @@ -6,23 +6,14 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later -import random from time import sleep from dolfinx import common -# Seed random generator for determinism -random.seed(0) - - -def get_random_task_name(): - """Get pseudo-random string""" - return hex(random.randint(0, 1e32)) - def test_context_manager_named(): """Test that named Timer works as context manager""" - task = get_random_task_name() + task = "test_context_manager_named_str" # Execute task in the context manager t = common.Timer(task) diff --git a/python/test/unit/fem/test_function_space.py b/python/test/unit/fem/test_function_space.py index 7071f76d78a..a12ab18b84b 100644 --- a/python/test/unit/fem/test_function_space.py +++ b/python/test/unit/fem/test_function_space.py @@ -12,7 +12,6 @@ from dolfinx.mesh import create_mesh, create_unit_cube from ufl import (Cell, FiniteElement, Mesh, TestFunction, TrialFunction, VectorElement, grad, triangle) -from ufl.log import UFLException from mpi4py import MPI @@ -221,7 +220,7 @@ def test_argument_equality(mesh, V, V2, W, W2): def test_cell_mismatch(mesh): """Test that cell mismatch raises early enough from UFL""" element = FiniteElement("P", triangle, 1) - with pytest.raises(UFLException): + with pytest.raises(BaseException): FunctionSpace(mesh, element)