Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
jhale committed Jan 11, 2023
2 parents 8a9ba52 + 2773bcb commit ce1f803
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 18 additions & 6 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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`.

Expand All @@ -62,15 +68,18 @@ 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`.

3. Update the dependency versions for `fenics-basix` and `fenics-ufl` in `setup.cfg`.

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`.

Expand All @@ -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`.
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion cpp/cmake/modules/FindUFCx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
4 changes: 2 additions & 2 deletions cpp/cmake/scripts/generate-cmakefiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cpp/dolfinx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
38 changes: 17 additions & 21 deletions cpp/dolfinx/mesh/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::int32_t> geometry_indices(num_entity_dofs
* submesh_to_mesh_map.size());
std::vector<std::int32_t> geometry_indices;
geometry_indices.reserve(num_entity_dofs * submesh_to_mesh_map.size());
std::vector<std::int32_t> 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<std::int32_t>& xdofs = geometry.dofmap();
const int tdim = topology.dim();
Expand Down Expand Up @@ -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());
}
}

Expand Down Expand Up @@ -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<std::int32_t> entity_x_dofs;
std::vector<std::int32_t> submesh_x_dofmap_vec;
submesh_x_dofmap_vec.reserve(geometry_indices.size());
std::vector<std::int32_t> 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<std::int32_t> submesh_x_dofmap(
std::move(submesh_x_dofmap_vec), std::move(submesh_x_dofmap_offsets));

Expand Down
15 changes: 5 additions & 10 deletions docker/Dockerfile.oneapi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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/*

Expand Down Expand Up @@ -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 && \
Expand 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 && \
Expand 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 && \
Expand 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 && \
Expand Down
11 changes: 1 addition & 10 deletions python/test/unit/common/test_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions python/test/unit/fem/test_function_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)


Expand Down

0 comments on commit ce1f803

Please sign in to comment.