diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 410a5e453..deff41246 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 @@ -21,7 +21,7 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push Docker image of master - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v3 with: context: ./docker/ file: ./docker/Dockerfile.fsi-suite diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index e2cacd2b5..70b27e2b2 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -7,7 +7,9 @@ on: jobs: build: runs-on: ubuntu-latest - container: heltai/dealii:vscode + container: + image: heltai/dealii:vscode + options: --user root steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/indentation.yml b/.github/workflows/indentation.yml index ecc837ca2..4434f866e 100644 --- a/.github/workflows/indentation.yml +++ b/.github/workflows/indentation.yml @@ -1,19 +1,29 @@ name: Indent -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] +on: [push, pull_request] + +concurrency: + group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{github.event_name == 'pull_request'}} + +permissions: + contents: read jobs: - build: + indent: + # run the indent checks - runs-on: ubuntu-latest - container: heltai/dealii:vscode + name: indent + runs-on: [ubuntu-20.04] + container: + image: heltai/dealii:vscode + options: --user root steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + fetch-depth: 100 - name: Check indentation run: | - ./scripts/check_indentation.sh + git config --global --add safe.directory "$GITHUB_WORKSPACE" + ./scripts/check_indentation.sh \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 64802d388..9be5d054d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,10 +10,12 @@ jobs: debug: runs-on: ubuntu-latest - container: heltai/dealii:vscode + container: + image: heltai/dealii:vscode + options: --user root steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Build debug run: | rm -rf build_linux_debug @@ -31,10 +33,12 @@ jobs: release: runs-on: ubuntu-latest - container: heltai/dealii:vscode + container: + image: heltai/dealii:vscode + options: --user root steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Build release run: | rm -rf build_linux_release diff --git a/.vscode/settings.json b/.vscode/settings.json index b2f0b6fbe..a199d4cd1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -107,7 +107,8 @@ "titleBar.activeBackground": "#dd0531", "titleBar.activeForeground": "#e7e7e7", "titleBar.inactiveBackground": "#dd053199", - "titleBar.inactiveForeground": "#e7e7e799" + "titleBar.inactiveForeground": "#e7e7e799", + "commandCenter.border": "#e7e7e799" }, "editor.tokenColorCustomizations": { "textMateRules": [ diff --git a/docker/Dockerfile b/docker/Dockerfile index bedd59d95..c7a26e8c9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ # This image is pushed to heltai/dealii:vscode -FROM dealii/dealii:master-focal +FROM dealii/dealii:master-jammy LABEL maintainer="luca.heltai@gmail.com" @@ -12,7 +12,6 @@ RUN apt-get update \ doxygen \ gdb \ graphviz \ - libcgal-dev \ linux-tools-common \ linux-tools-generic \ valgrind \ @@ -21,23 +20,6 @@ RUN apt-get update \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN mkdir -p /root/.vscode-server/extensions \ - /root/.vscode-server-insiders/extensions - -ENV OMPI_ALLOW_RUN_AS_ROOT 1 - -ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM 1 - -ENV HOME /root - -RUN mkdir /root/.ssh - -ADD dotgdbinit.py /root/.gdbinit - -ADD build.sh copy_test.sh copy_output.sh d2check.sh cwdiff /usr/bin/ - -RUN mv /usr/local/bin/clang-format /usr/bin/clang-format - # Now install parmoonlith RUN cd /usr/src/ && \ git clone https://bitbucket.org/zulianp/par_moonolith.git && \ @@ -46,6 +28,29 @@ RUN cd /usr/src/ && \ cd build && \ cmake .. -G Ninja \ -DBUILD_SHARED_LIBS=ON && \ + sed -i '/#include /a #include ' _deps/benchmark-src/src/benchmark_register.h &&\ ninja && \ ninja install && \ cd ../ && rm -rf build + +RUN mkdir -p /root/.vscode-server/extensions \ + /root/.vscode-server-insiders/extensions + +ENV OMPI_ALLOW_RUN_AS_ROOT 1 + +ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM 1 + +ADD dotgdbinit.py /root/.gdbinit + +RUN mv /usr/local/bin/clang-format /usr/bin/clang-format + +ADD \ + build.sh \ + copy_output.sh \ + copy_test.sh \ + d2check.sh \ + cwdiff \ + newdocentry.sh \ + work_on_test.sh \ + /usr/bin/ + diff --git a/docker/Dockerfile.fsi-suite b/docker/Dockerfile.fsi-suite index bd1bb2ba7..44304a7ff 100644 --- a/docker/Dockerfile.fsi-suite +++ b/docker/Dockerfile.fsi-suite @@ -8,4 +8,5 @@ RUN cd /usr/local/src \ -DCMAKE_BUILD_TYPE=DebugRelease \ .. \ && ninja install \ - && cd ../ && rm -rf .git build \ No newline at end of file + && cd ../ && rm -rf .git build + diff --git a/docker/build.sh b/docker/build.sh index 39af5e02b..dac059b05 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -1,4 +1,4 @@ #!/bin/sh -docker pull dealii/dealii:master-focal +docker pull dealii/dealii:master-jammy docker build -t heltai/dealii:vscode . docker push heltai/dealii:vscode diff --git a/docker/copy_output.sh b/docker/copy_output.sh index cebf33120..d8c93788d 100755 --- a/docker/copy_output.sh +++ b/docker/copy_output.sh @@ -1,5 +1,10 @@ +#!/bin/bash +snippetdir=$SNIPPET_DIR +if [ -z "$snippetdir" ]; then + snippetdir=~/c++/snippets/ +fi echo copying -echo ~/c++/snippets/build/output +echo `pwd`/output echo to -echo `cat /workspace/snippets/.dealii_output_file` -sed 's/^JobId.*//g' ~/c++/snippets/build/output > `cat /workspace/snippets/.dealii_output_file` +echo `cat $snippetdir/.dealii_output_file` +sed 's/^JobId.*//g' `pwd`/output > `cat $snippetdir/.dealii_output_file` diff --git a/docker/copy_test.sh b/docker/copy_test.sh index cdbbdffdf..dc7b8a774 100755 --- a/docker/copy_test.sh +++ b/docker/copy_test.sh @@ -1,7 +1,13 @@ +#!/bin/bash oldtestrel=$1 newtestrel=$2 oldtest="$(cd "$(dirname "$oldtestrel")"; pwd)/$(basename "$oldtestrel")" newtest="$(cd "$(dirname "$newtestrel")"; pwd)/$(basename "$newtestrel")" +snippetdir=$SNIPPET_DIR +if [ -z "$snippetdir" ]; then + snippetdir=~/c++/snippets/ +fi +echo Using snippet dir: $snippetdir if [ -f $oldtest ]; then extension="" for option in "${@:3}"; do @@ -19,8 +25,8 @@ if [ -f $oldtest ]; then touch $output git add $newtest git add $output - echo $output > /workspace/snippets/.dealii_output_file - ln -sf $newtest /workspace/snippets/snippet.cc + echo $output > $SNIPPET_DIR/.dealii_output_file + ln -sf $newtest $SNIPPET_DIR/snippet.cc else echo File echo $oldtest diff --git a/docker/newdocentry.sh b/docker/newdocentry.sh new file mode 100755 index 000000000..683552efc --- /dev/null +++ b/docker/newdocentry.sh @@ -0,0 +1,22 @@ +#!/bin/sh +case $2 in +major) + type=major + ;; +incompatibilities) + type=incompatibilities + ;; +*) + type=minor + ;; +esac + +filename=../doc/news/changes/$type/`date "+%Y%m%d"`LucaHeltai + +echo Writing to $filename +message="$1 +
+(Luca Heltai, `date "+%Y/%m/%d"`)" + +echo "$message" > $filename +git add $filename diff --git a/docker/work_on_test.sh b/docker/work_on_test.sh new file mode 100755 index 000000000..696959ea0 --- /dev/null +++ b/docker/work_on_test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +newtestrel=$1 +newtest="$(cd "$(dirname "$newtestrel")"; pwd)/$(basename "$newtestrel")" +snippetdir=$SNIPPET_DIR +if [ -z "$snippetdir" ]; then + snippetdir=~/c++/snippets/ +fi +echo Using snippet dir: $snippetdir +if [ -f $newtest ]; then + ln -sf $newtest $snippetdir/snippet.cc + echo Linked + echo $newtest + echo to + echo $snippetdir/snippet.cc + echo + extension="" + for option in "${@:2}"; do + if [[ $option == *"mpirun"* ]]; then + extension=$extension.$option + else + extension=$extension.with_$option=on + fi + done + output=${newtest/\.cc/$extension.output} + if [ -f $output ]; then + echo $output > $snippetdir/.dealii_output_file + echo Stored output name + echo $output + echo in + echo $snippetdir/.dealii_output_file + else + echo Could not find $output file! Did not store its name anywhere + fi +else + echo File + echo $newtest + echo does not exist. Make sure you specify an existing test. +fi diff --git a/include/parsed_tools/grid_info.h b/include/parsed_tools/grid_info.h index c51df0781..27c9192e9 100644 --- a/include/parsed_tools/grid_info.h +++ b/include/parsed_tools/grid_info.h @@ -126,7 +126,7 @@ namespace dealii const dealii::Patterns::PatternBase &pattern = *Convert::to_pattern()) { - return dealii::internal::ReferenceCell::make_reference_cell_from_int( + return dealii::internal::make_reference_cell_from_int( Convert::to_value(s, pattern)); } }; @@ -203,36 +203,36 @@ namespace ParsedTools reference_cell_types = tria.get_reference_cells(); std::set m_ids; - for (const auto cell : tria.active_cell_iterators()) + for (const auto &cell : tria.active_cell_iterators()) m_ids.insert(cell->material_id()); material_ids.insert(material_ids.end(), m_ids.begin(), m_ids.end()); } if (info_level > 2) { - for (const auto id : boundary_ids) + for (const auto &id : boundary_ids) faces_per_boundary_id[id] = 0; - for (const auto id : material_ids) + for (const auto &id : material_ids) cells_per_material_id[id] = 0; - for (const auto id : manifold_ids) + for (const auto &id : manifold_ids) { faces_per_manifold_id[id] = 0; cells_per_manifold_id[id] = 0; } - for (const auto id : reference_cell_types) + for (const auto &id : reference_cell_types) cells_per_reference_cell_type[id] = 0; - for (const auto cell : tria.active_cell_iterators()) + for (const auto &cell : tria.active_cell_iterators()) { ++cells_per_material_id[cell->material_id()]; ++cells_per_manifold_id[cell->manifold_id()]; ++cells_per_reference_cell_type[cell->reference_cell()]; } - for (const auto f : tria.active_face_iterators()) + for (const auto &f : tria.active_face_iterators()) { if (f->at_boundary()) ++faces_per_boundary_id[f->boundary_id()]; diff --git a/include/parsed_tools/grid_refinement.h b/include/parsed_tools/grid_refinement.h index 3935cf96e..684a66262 100644 --- a/include/parsed_tools/grid_refinement.h +++ b/include/parsed_tools/grid_refinement.h @@ -282,7 +282,7 @@ namespace ParsedTools } } else if (strategy == RefinementStrategy::global) - for (const auto cell : tria.active_cell_iterators()) + for (const auto &cell : tria.active_cell_iterators()) cell->set_refine_flag(); else Assert(false, dealii::ExcInternalError()); @@ -338,7 +338,7 @@ namespace ParsedTools } else if (strategy == RefinementStrategy::global) { - for (const auto cell : tria.active_cell_iterators()) + for (const auto &cell : tria.active_cell_iterators()) if (cell->is_locally_owned()) cell->set_refine_flag(); } @@ -354,7 +354,7 @@ namespace ParsedTools GridRefinement::limit_levels(dealii::Triangulation &tria) const { if (min_level != 0 || max_level != 0) - for (const auto cell : tria.active_cell_iterators()) + for (const auto &cell : tria.active_cell_iterators()) if (cell->is_locally_owned()) { if (min_level != 0 && cell->level() < min_level)