diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 603fde6b2f4..a7b4784be9d 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -86,6 +86,8 @@ jobs: ninja -j 4 -d explain mpirun -np 4 ./aspect-release --version ctest -VV -R performance + cd tests + .././aspect-release $GITHUB_WORKSPACE/feature/source/build/tests/performance_nsinker_gmg_idr.x.prm - name: Configure main run: | @@ -118,7 +120,7 @@ jobs: run: | rm -rf $GITHUB_WORKSPACE/performance_1_results/; mkdir -p $GITHUB_WORKSPACE/performance_1_results/ - - name: Run performance benchmark + - name: Run performance benchmark 1 shell: bash run: | cd $GITHUB_WORKSPACE/cbdr/; @@ -126,7 +128,19 @@ jobs: cat $GITHUB_WORKSPACE/result_1.csv; cat $GITHUB_WORKSPACE/result_1.csv | cargo run --release analyze --disable-dynamic-printing > $GITHUB_WORKSPACE/performance_1_results/analyze_1.log ||:; cat $GITHUB_WORKSPACE/performance_1_results/analyze_1.log + - name: Run performance benchmark 2 + shell: bash + run: | + cd $GITHUB_WORKSPACE/cbdr/; + time cargo run --release sample --timeout=1800s "main:$GITHUB_WORKSPACE/main/source/build/./aspect-release $GITHUB_WORKSPACE/feature/source/build/tests/performance_nsinker_gmg_idr.x.prm" "feature:$GITHUB_WORKSPACE/feature/source/build/./aspect-release $GITHUB_WORKSPACE/feature/source/build/tests/performance_nsinker_gmg_idr.x.prm" > $GITHUB_WORKSPACE/result_2.csv; + cat $GITHUB_WORKSPACE/result_2.csv; + cat $GITHUB_WORKSPACE/result_2.csv | cargo run --release analyze --disable-dynamic-printing > $GITHUB_WORKSPACE/performance_1_results/analyze_2.log ||:; + cat $GITHUB_WORKSPACE/performance_2_results/analyze_2.log - uses: actions/upload-artifact@v7 with: name: performance_1_results path: performance_1_results/ + - uses: actions/upload-artifact@v7 + with: + name: performance_2_results + path: performance_2_results/ diff --git a/.github/workflows/post_performance_results.yml b/.github/workflows/post_performance_results.yml index 3c2443f4b06..9c4f1770c51 100644 --- a/.github/workflows/post_performance_results.yml +++ b/.github/workflows/post_performance_results.yml @@ -43,7 +43,7 @@ jobs: per_page: 100, }); - const names = Array.from({ length: 1 }, (_, i) => `performance_${i + 1}_results`); + const names = Array.from({ length: 2 }, (_, i) => `performance_${i + 1}_results`); for (const name of names) { const artifact = data.artifacts.find(a => a.name === name); @@ -67,7 +67,7 @@ jobs: - name: Unzip artifacts run: | set -e - for i in $(seq 1 8); do + for i in $(seq 1 2); do f="performance_${i}_results.zip" if [ -f "$f" ]; then unzip -o "$f" @@ -96,6 +96,27 @@ jobs: echo "wall_time_1_CI_low=$(echo "$line" | sed 's/\[/ /g; s/\]/ /g' | awk '{print $8}')" echo "wall_time_1_CI_high=$(echo "$line" | sed 's/\[/ /g; s/\]/ /g' | awk '{print $10}')" } >> "$GITHUB_OUTPUT" + + - name: Retrieve performance benchmark 2 + id: retrieve_performance_2 + env: + benchmark_number: 2 + run: | + set -e + file="$GITHUB_WORKSPACE/performance_2_results/analyze_2.log" + cat "$file" + line=$(grep wall_time "$file" | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g') + samples=$(grep samples "$file" | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g') + { + echo "wall_time_2_main_mean=$(echo "$line" | awk '{print $2}')" + echo "wall_time_2_main_std_dev=$(echo "$line" | awk '{print $4}')" + echo "wall_time_2_main_samples=$(echo "$samples" | awk '{print $2}')" + echo "wall_time_2_feature_mean=$(echo "$line" | awk '{print $5}')" + echo "wall_time_2_feature_std_dev=$(echo "$line" | awk '{print $7}')" + echo "wall_time_2_feature_samples=$(echo "$samples" | awk '{print $3}')" + echo "wall_time_2_CI_low=$(echo "$line" | sed 's/\[/ /g; s/\]/ /g' | awk '{print $8}')" + echo "wall_time_2_CI_high=$(echo "$line" | sed 's/\[/ /g; s/\]/ /g' | awk '{print $10}')" + } >> "$GITHUB_OUTPUT" - name: Find Comment id: find_comment continue-on-error: true @@ -115,4 +136,5 @@ jobs: | Benchmark | Main | Feature | Difference (99.9% CI) | | --- | --- | --- | --- | | Continental extension | ${{ steps.retrieve_performance_1.outputs.wall_time_1_main_mean }} ± ${{ steps.retrieve_performance_1.outputs.wall_time_1_main_std_dev }} (s=${{ steps.retrieve_performance_1.outputs.wall_time_1_main_samples }})| ${{ steps.retrieve_performance_1.outputs.wall_time_1_feature_mean }} ± ${{ steps.retrieve_performance_1.outputs.wall_time_1_feature_std_dev }} (s=${{ steps.retrieve_performance_1.outputs.wall_time_1_feature_samples }})| ${{ steps.retrieve_performance_1.outputs.wall_time_1_CI_low }} .. ${{ steps.retrieve_performance_1.outputs.wall_time_1_CI_high }} | + | GMG nsinker | ${{ steps.retrieve_performance_2.outputs.wall_time_2_main_mean }} ± ${{ steps.retrieve_performance_2.outputs.wall_time_2_main_std_dev }} (s=${{ steps.retrieve_performance_2.outputs.wall_time_2_main_samples }})| ${{ steps.retrieve_performance_2.outputs.wall_time_2_feature_mean }} ± ${{ steps.retrieve_performance_2.outputs.wall_time_2_feature_std_dev }} (s=${{ steps.retrieve_performance_2.outputs.wall_time_2_feature_samples }})| ${{ steps.retrieve_performance_2.outputs.wall_time_2_CI_low }} .. ${{ steps.retrieve_performance_2.outputs.wall_time_2_CI_high }} | edit-mode: replace diff --git a/tests/performance_nsinker_gmg_idr.cc b/tests/performance_nsinker_gmg_idr.cc new file mode 100644 index 00000000000..3414e98ba87 --- /dev/null +++ b/tests/performance_nsinker_gmg_idr.cc @@ -0,0 +1,21 @@ +/* + Copyright (C) 2022 by the authors of the ASPECT code. + + This file is part of ASPECT. + + ASPECT 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, or (at your option) + any later version. + + ASPECT 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 ASPECT; see the file LICENSE. If not see + . +*/ + +#include "../benchmarks/nsinker/nsinker.cc" diff --git a/tests/performance_nsinker_gmg_idr.prm b/tests/performance_nsinker_gmg_idr.prm new file mode 100644 index 00000000000..7dce651ce6b --- /dev/null +++ b/tests/performance_nsinker_gmg_idr.prm @@ -0,0 +1,25 @@ +# MPI: 4 +# Nsinker benchmark using geometric multigrid preconditioner +# with an IDR(2) solver + +set Dimension = 3 + +include $ASPECT_SOURCE_DIR/benchmarks/nsinker/nsinker_gmg.prm + + +subsection Material model + set Material averaging = harmonic average only viscosity +end + +subsection Solver parameters + subsection Stokes solver parameters + set Stokes solver type = block GMG + set Krylov method for cheap solver steps = IDR(s) + set IDR(s) parameter = 2 + end +end + +subsection Mesh refinement + set Initial adaptive refinement = 0 + set Initial global refinement = 6 +end diff --git a/tests/performance_nsinker_gmg_idr/screen-output b/tests/performance_nsinker_gmg_idr/screen-output new file mode 100644 index 00000000000..e4a33a0d3e9 --- /dev/null +++ b/tests/performance_nsinker_gmg_idr/screen-output @@ -0,0 +1,24 @@ + +Loading shared library <./libperformance_nsinker_gmg_idr.release.so> + +Number of active cells: 262,144 (on 7 levels) +Number of degrees of freedom: 8,861,381 (6,440,067+274,625+2,146,689) + +*** Timestep 0: t=0 seconds, dt=0 seconds + Solving Stokes system (GMG)... + GMG coarse size A: 81, coarse size S: 8 + GMG levels: 7 + Viscosity range: 0.01 - 100 + GMG workload imbalance: 1.00001 + Stokes solver (IDR(2)): 12+0 iterations. + Schur complement preconditioner: 34+0 iterations. + A block preconditioner: 34+0 iterations. + + Postprocessing: + System matrix memory consumption: 25.77 MB + Writing graphical output: output-performance_nsinker_gmg_idr/solution/solution-00000 + +Termination requested by criterion: end time + + +