From daf56af0c648b0bc6662a3cc13a0312e38969c84 Mon Sep 17 00:00:00 2001 From: sdargavi Date: Tue, 20 Jun 2023 17:12:10 +0100 Subject: [PATCH 1/3] Some fixes for OMP that were removed in 5963c4c --- assemble/Advection_Diffusion_CG.F90 | 5 +++++ assemble/Advection_Diffusion_FV.F90 | 5 +++++ femtools/Colouring.F90 | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/assemble/Advection_Diffusion_CG.F90 b/assemble/Advection_Diffusion_CG.F90 index d288f8fe04..53a063592d 100644 --- a/assemble/Advection_Diffusion_CG.F90 +++ b/assemble/Advection_Diffusion_CG.F90 @@ -256,6 +256,11 @@ subroutine assemble_advection_diffusion_cg(t, matrix, rhs, state, dt, velocity_n integer :: clr, nnid, len, ele integer :: num_threads, thread_num +#ifdef _OPENMP + !! Did we successfully prepopulate the transform_to_physical_cache? + logical :: cache_valid +#endif + type(element_type), dimension(:), allocatable :: supg_element ewrite(1, *) "In assemble_advection_diffusion_cg" diff --git a/assemble/Advection_Diffusion_FV.F90 b/assemble/Advection_Diffusion_FV.F90 index 3aae469be2..f099d0da48 100644 --- a/assemble/Advection_Diffusion_FV.F90 +++ b/assemble/Advection_Diffusion_FV.F90 @@ -171,6 +171,11 @@ subroutine assemble_advection_diffusion_fv(t, matrix, rhs, state) integer :: clr, nnid, len, ele integer :: thread_num +#ifdef _OPENMP + !! Did we successfully prepopulate the transform_to_physical_cache? + logical :: cache_valid +#endif + ewrite(1,*) "In assemble_advection_diffusion_fv" coordinate => extract_vector_field(state, "Coordinate") diff --git a/femtools/Colouring.F90 b/femtools/Colouring.F90 index b4038034b9..14ee77e966 100644 --- a/femtools/Colouring.F90 +++ b/femtools/Colouring.F90 @@ -89,6 +89,13 @@ subroutine get_mesh_colouring(state, mesh, colouring_type, colouring) type(integer_set), dimension(:), pointer, intent(out) :: colouring type(mesh_type), pointer :: topology integer :: i +#ifdef _OPENMP + type(csr_sparsity), pointer :: sparsity + type(mesh_type) :: p0_mesh + integer :: ncolours + integer :: stat + type(scalar_field) :: element_colours +#endif topology => extract_mesh(state, topology_mesh_name) From ea5140fd7c1cb45e1c12bd233928b67697e8e3e3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:15:39 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- assemble/Advection_Diffusion_CG.F90 | 2 +- assemble/Advection_Diffusion_FV.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assemble/Advection_Diffusion_CG.F90 b/assemble/Advection_Diffusion_CG.F90 index 53a063592d..89ee5a3e53 100644 --- a/assemble/Advection_Diffusion_CG.F90 +++ b/assemble/Advection_Diffusion_CG.F90 @@ -259,7 +259,7 @@ subroutine assemble_advection_diffusion_cg(t, matrix, rhs, state, dt, velocity_n #ifdef _OPENMP !! Did we successfully prepopulate the transform_to_physical_cache? logical :: cache_valid -#endif +#endif type(element_type), dimension(:), allocatable :: supg_element diff --git a/assemble/Advection_Diffusion_FV.F90 b/assemble/Advection_Diffusion_FV.F90 index f099d0da48..3dd2d1e328 100644 --- a/assemble/Advection_Diffusion_FV.F90 +++ b/assemble/Advection_Diffusion_FV.F90 @@ -174,7 +174,7 @@ subroutine assemble_advection_diffusion_fv(t, matrix, rhs, state) #ifdef _OPENMP !! Did we successfully prepopulate the transform_to_physical_cache? logical :: cache_valid -#endif +#endif ewrite(1,*) "In assemble_advection_diffusion_fv" From f7cbe767bf5f26ec04797bd586eddf7e0be34315 Mon Sep 17 00:00:00 2001 From: Stephan Kramer Date: Tue, 20 Jun 2023 19:51:59 +0100 Subject: [PATCH 3/3] Add OPENMP build to CI --- .github/workflows/ubuntu.yml | 5 +++- docker/actions/Dockerfile.actions.jammy-omp | 27 +++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 docker/actions/Dockerfile.actions.jammy-omp diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index be6ae3dc32..e897f35cfa 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - name: [ "Build Bionic", "Build Focal", "Build Jammy" ] + name: [ "Build Bionic", "Build Focal", "Build Jammy", "Build Jammy OMP" ] include: - name: "Build Bionic" @@ -29,6 +29,9 @@ jobs: - name: "Build Jammy" release: jammy + - name: "Build Jammy OMP" + release: jammy-omp + steps: - name: Check Out Repo diff --git a/docker/actions/Dockerfile.actions.jammy-omp b/docker/actions/Dockerfile.actions.jammy-omp new file mode 100644 index 0000000000..6a50b5e084 --- /dev/null +++ b/docker/actions/Dockerfile.actions.jammy-omp @@ -0,0 +1,27 @@ +FROM fluidity/baseimages:jammy + +USER root + +RUN apt-get -y update && \ + apt-get -y dist-upgrade && \ + apt-get -y install sudo && \ + rm -rf /var/cache/apt/archives && \ + rm -rf /var/lib/apt/lists + +RUN adduser fluidity sudo +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +COPY . /home/fluidity +RUN chown -R fluidity /home/fluidity + +USER fluidity + +RUN ./configure --enable-2d-adaptivity --enable-omp +RUN make makefiles +RUN test -z "$(git status --porcelain */Makefile.dependencies)" +RUN make +RUN make fltools +RUN make manual + +# Python module 'assess' is required for some longtests +RUN python3 -m pip install assess