Skip to content

Commit

Permalink
Merge branch 'main' into enhancement-remove_dimensionality_of_geoms
Browse files Browse the repository at this point in the history
  • Loading branch information
sandro-elsweijer authored Sep 6, 2024
2 parents 21b61aa + ce8365c commit d91b22e
Show file tree
Hide file tree
Showing 134 changed files with 3,353 additions and 2,241 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/mattermost_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,26 @@ jobs:
- name: debug_before_build
run: echo ${{ env.message_build}}
# build the message depending on different types of events and event actions. Message is written into mattermost.json
- name: dispatch_run
if: github.event_name == 'workflow_dispatch'
run: |
echo message_build=1 >> $GITHUB_ENV &&
echo message_content='User ${{github.actor}} triggered the workflow_dispatch' >> $GITHUB_ENV
- name: closed_message
if: github.event.action == 'closed'
run: |
echo message_build=1 >> $GITHUB_ENV &&
echo message_content='Issue ${{ github.event.issue.number }} has been closed. See ${{ github.event.issue.html_url }} for more details.' >> $GITHUB_ENV
# Would like to have this message read "User X closed issue ...".
# How can we get the user name? Tried ${{ github.event.issue.user.name }} and others, did not work.
echo message_content='User ${{ github.actor }} closed issue ${{ github.event.issue.number }}. See ${{ github.event.issue.html_url }} for more details.' >> $GITHUB_ENV
- name: opened_message
if: github.event.action == 'opened' || github.event.action == 'reopened'
if: github.event.action == 'opened'
run: |
echo message_build=1 >> $GITHUB_ENV &&
echo message_content='User ${{ github.actor }} opened issue ${{ github.event.issue.number }}. See ${{ github.event.issue.html_url }} for more details.' >> $GITHUB_ENV
- name: reopened_message
if: github.event.action == 'reopened'
run: |
echo message_build=1 >> $GITHUB_ENV &&
echo message_content='Issue ${{ github.event.issue.number }} was (re-)opened. See ${{ github.event.issue.html_url }} for more details.' >> $GITHUB_ENV
# Would like to have this message read "User X (re-)opened issue ...".
# How can we get the user name? Tried ${{ github.event.issue.user.name }} and others, did not work.
echo message_content='User ${{ github.actor }} reopened issue ${{ github.event.issue.number }}. See ${{ github.event.issue.html_url }} for more details.' >> $GITHUB_ENV
- name: debug_after_build
run: echo ${{ env.message_build }}
# if a message has been written send the message to the mattermost-channel described in the secrets
Expand Down
196 changes: 196 additions & 0 deletions .github/workflows/tests_cmake_preparation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
name: CMake tests preparation


# This file is part of t8code.
# t8code is a C library to manage a collection (a forest) of multiple
# connected adaptive space-trees of general element types in parallel.
#
# Copyright (C) 2024 the developers
#
# t8code is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# t8code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with t8code; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

on:
workflow_call:
inputs:
MAKEFLAGS:
required: true
type: string
description: 'Make flags to use for compilation (like -j4)'
IGNORE_CACHE:
required: false
type: boolean
default: false
description: 'Ignore cache and force recompilation'
CACHE_COUNTER:
required: true
type: number
description: 'Counter to force updating the cache'
MPI:
required: true
type: string
description: 'Use MPI for compilation (ON/OFF)'
outputs:
USED_CACHE:
description: "Whether the cache was used"
value: ${{ jobs.cmake_preparation.outputs.USED_CACHE }}

env:
USED_CACHE: ${{ !inputs.IGNORE_CACHE }}

jobs:
cmake_preparation:
runs-on: ubuntu-latest
container: dlramr/t8code-ubuntu:t8-dependencies
timeout-minutes: 10
outputs:
USED_CACHE: ${{ steps.used_cache.outputs.USED_CACHE }}
steps:
#
# Setup
#
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update packages
run: apt-get update && apt-get upgrade -y
# This seems to be necessary because of the docker container
- name: disable ownership checks
run: git config --global --add safe.directory '*'
- name: init submodules
run: git submodule init
- name: update submodules
run: git submodule update
- name: Get input vars
run: export MAKEFLAGS="${{ inputs.MAKEFLAGS }}"
&& export IGNORE_CACHE="${{ inputs.IGNORE_CACHE }}"
&& export CACHE_COUNTER="${{ inputs.CACHE_COUNTER }}"
&& export MPI="${{ inputs.MPI }}"
&& echo MAKEFLAGS="$MAKEFLAGS" >> $GITHUB_ENV
&& echo IGNORE_CACHE="$IGNORE_CACHE" >> $GITHUB_ENV
&& echo CACHE_COUNTER="$CACHE_COUNTER" >> $GITHUB_ENV
&& echo MPI="$MPI" >> $GITHUB_ENV
#
# SC installation
#
- name: store sc folders in var
run: echo SC_BUILD=$PWD/sc/build >> $GITHUB_ENV
&& echo SC_DEBUG=$PWD/sc/build/Debug >> $GITHUB_ENV
&& echo SC_RELEASE=$PWD/sc/build/Release >> $GITHUB_ENV
- name: Get sc commit hash
run: hash=`git rev-parse HEAD:sc` && echo sc_commit=$hash >> $GITHUB_ENV
- name: Check cache for previous sc installation
id: sc_cmake_cache
uses: actions/cache@v4
with:
path: |
${{ env.SC_DEBUG }}
${{ env.SC_RELEASE }}
# You can increase the counter at the end to force a new key and hence recomputing the cache
key: sc-cmake-MPI-${{ inputs.MPI }}-${{ env.sc_commit }}-${{ inputs.CACHE_COUNTER }}
- name: Log that no cache was found
run: echo USED_CACHE=0 >> $GITHUB_ENV
if: ${{ steps.sc_cmake_cache.outputs.cache-hit != 'true' }}
- name: Cache info
if: ${{ steps.sc_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
run: echo No cache found or cache will be ignored. IGNORE_CACHE=$IGNORE_CACHE
- name: if ignore cache, delete folders
if: ${{ inputs.IGNORE_CACHE == 1 }}
# The true at the end is to ignore errors that i.e. occur when the folders do not exist
run: rm -r $SC_BUILD || true
- name: make folders
run: mkdir -p $SC_DEBUG $SC_RELEASE
if: ${{ steps.sc_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
- name: install sc
run: echo "Install sc"
if: ${{ steps.sc_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
## sc debug
- name: sc cmake debug
run: cd $SC_DEBUG && cmake ../../ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$SC_DEBUG/install -Dmpi=$MPI -GNinja
if: ${{ steps.sc_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
- name: sc build debug
run: cd $SC_DEBUG && ninja $MAKEFLAGS && ninja $MAKEFLAGS install
if: ${{ steps.sc_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
## sc release
- name: sc cmake release
run: cd $SC_RELEASE && cmake ../../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$SC_RELEASE/install -Dmpi=$MPI -GNinja
if: ${{ steps.sc_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
- name: sc build release
run: cd $SC_RELEASE && ninja $MAKEFLAGS && ninja $MAKEFLAGS install
if: ${{ steps.sc_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
#
# P4EST
#
- name: store p4est folders in var
run: echo P4EST_BUILD=$PWD/p4est/build >> $GITHUB_ENV
&& echo P4EST_DEBUG=$PWD/p4est/build/Debug >> $GITHUB_ENV
&& echo P4EST_RELEASE=$PWD/p4est/build/Release >> $GITHUB_ENV
- name: Get p4est commit hash
run: hash=`git rev-parse HEAD:p4est` && echo p4est_commit=$hash >> $GITHUB_ENV
- name: Check cache for previous p4est installation
id: p4est_cmake_cache
uses: actions/cache@v4
with:
path: |
${{ env.P4EST_DEBUG }}
${{ env.P4EST_RELEASE }}
# You can increase the counter at the end to force a new key and hence recomputing the cache
key: p4est-cmake-MPI-${{ inputs.MPI }}-${{ env.p4est_commit }}-${{ env.sc_commit }}-${{ inputs.CACHE_COUNTER }}
- name: Log that no cache was found
run: echo USED_CACHE=0 >> $GITHUB_ENV
if: ${{ steps.p4est_cmake_cache.outputs.cache-hit != 'true' }}
- name: Cache info
if: ${{ steps.p4est_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
run: echo No cache found or cache will be ignored. IGNORE_CACHE=$IGNORE_CACHE
- name: install p4est
run: echo "Install p4est"
if: ${{ steps.p4est_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
- name: if ignore cache, delete folders
if: ${{ steps.p4est_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
# The true at the end is to ignore errors that i.e. occur when the folders do not exist
run: rm -r $P4EST_BUILD || true
- name: make folders
if: ${{ steps.p4est_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
run: mkdir -p $P4EST_DEBUG $P4EST_RELEASE
## p4est debug
- name: p4est cmake debug
run: cd $P4EST_DEBUG && cmake ../../ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$P4EST_DEBUG/install -DP4EST_USE_SYSTEM_SC=ON -DSC_DIR=$SC_DEBUG/install/cmake -DP4EST_ENABLE_MPI=$MPI -GNinja
if: ${{ steps.p4est_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
- name: p4est build debug
run: cd $P4EST_DEBUG && ninja $MAKEFLAGS && ninja $MAKEFLAGS install
if: ${{ steps.p4est_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
## p4est release
- name: p4est cmake release
run: cd $P4EST_RELEASE && cmake ../../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$P4EST_RELEASE/install -DP4EST_USE_SYSTEM_SC=ON -DSC_DIR=$SC_DEBUG/install/cmake -DP4EST_ENABLE_MPI=$MPI -GNinja
if: ${{ steps.p4est_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}
- name: p4est build release
run: cd $P4EST_RELEASE && ninja $MAKEFLAGS && ninja $MAKEFLAGS install
if: ${{ steps.p4est_cmake_cache.outputs.cache-hit != 'true' || inputs.IGNORE_CACHE == 1 }}

## output cache info
- name: output cache info
id: used_cache
run: echo "USED_CACHE=$USED_CACHE" >> $GITHUB_OUTPUT

## tar artifact to keep permissions: https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss
- name: Tar files
run: tar -cvf artifact.tar .

## upload artifacts
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: SC_P4EST_MPI_${{ inputs.MPI }}
path: ./artifact.tar
retention-days: 1
121 changes: 121 additions & 0 deletions .github/workflows/tests_cmake_sc_p4est.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: CMake tests sc and p4est


# This file is part of t8code.
# t8code is a C library to manage a collection (a forest) of multiple
# connected adaptive space-trees of general element types in parallel.
#
# Copyright (C) 2024 the developers
#
# t8code is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# t8code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with t8code; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

#
# This github CI script installs t8code and runs its tests for various configurations.
# We compile sc and p4est as thirdparty libraries and use caching to only trigger a
# new installation of them when their versions have changed in t8code.
#
# Note: To manually enforce sc and p4est installation, either increase the counter
# in the "key:" entries of the sc and p4est steps or set the variables
# SC_IGNORE_CACHE and P4EST_IGNORE_CACHE to 1 in the respective steps.

on:
workflow_call:
inputs:
MAKEFLAGS:
required: true
type: string
description: 'Make flags to use for compilation (like -j4)'
MPI:
required: true
type: string
description: 'Use MPI for compilation (ON/OFF)'

jobs:
sc_p4est_cmake_tests:
runs-on: ubuntu-latest
container: dlramr/t8code-ubuntu:t8-dependencies
timeout-minutes: 30
steps:
#
# Setup
#
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: SC_P4EST_MPI_${{ inputs.MPI }}
- name: untar artifact
run: tar -xf artifact.tar && rm artifact.tar
- name: Update packages
run: apt-get update && apt-get upgrade -y
# This seems to be necessary because of the docker container
- name: disable ownership checks
run: git config --global --add safe.directory '*'
- name: Get input vars
run: export MAKEFLAGS="${{ inputs.MAKEFLAGS }}"
&& export MPI="${{ inputs.MPI }}"
&& echo MPI="$MPI" >> $GITHUB_ENV
&& echo MAKEFLAGS="$MAKEFLAGS" >> $GITHUB_ENV
#
# SC tests
#
## save variables
- name: Save variables
run: export SC_DEBUG=$PWD/sc/build/Debug
&& export SC_RELEASE=$PWD/sc/build/Release
&& export P4EST_DEBUG=$PWD/p4est/build/Debug
&& export P4EST_RELEASE=$PWD/p4est/build/Release
&& echo SC_DEBUG="$SC_DEBUG" >> $GITHUB_ENV
&& echo SC_RELEASE="$SC_RELEASE" >> $GITHUB_ENV
&& echo P4EST_DEBUG="$P4EST_DEBUG" >> $GITHUB_ENV
&& echo P4EST_RELEASE="$P4EST_RELEASE" >> $GITHUB_ENV
## sc debug
- name: sc debug check
run: cd $SC_DEBUG && ninja test
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: sc_debug_MPI_${{ inputs.MPI }}.log
path: $SC_DEBUG/Testing/Temporary/LastTest.log
## sc release
- name: sc release check
run: cd $SC_RELEASE && ninja test
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: sc_release_MPI_${{ inputs.MPI }}.log
path: $SC_RELEASE/Testing/Temporary/LastTest.log
#
# P4EST tests
#
## p4est debug
- name: p4est debug check
run: cd $P4EST_DEBUG && ninja test
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: sp4est_debug_MPI_${{ inputs.MPI }}.log
path: $P4EST_DEBUG/Testing/Temporary/LastTest.log
## p4est release
- name: p4est release check
run: cd $P4EST_RELEASE && ninja test
- name: OnFailUploadLog
if: failure()
uses: actions/upload-artifact@v4
with:
name: sp4est_release_MPI_${{ inputs.MPI }}.log
path: $P4EST_RELEASE/Testing/Temporary/LastTest.log
Loading

0 comments on commit d91b22e

Please sign in to comment.