From 5cdb30180ebbefee1d5e6092dcac1d1e695c60fd Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Tue, 8 Jul 2025 22:35:19 -0400 Subject: [PATCH 01/14] first attempt with CB --- .github/workflows/cont-bench.yml | 75 ++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/cont-bench.yml diff --git a/.github/workflows/cont-bench.yml b/.github/workflows/cont-bench.yml new file mode 100644 index 000000000..0e6500ccb --- /dev/null +++ b/.github/workflows/cont-bench.yml @@ -0,0 +1,75 @@ +name: Continuous Benchmarking + +on: + pull_request: + pull_request_review: + types: [submitted] + workflow_dispatch: + + +permissions: + contents: write + deployments: write + +jobs: + file-changes: + name: Detect File Changes + runs-on: 'ubuntu-latest' + outputs: + checkall: ${{ steps.changes.outputs.checkall }} + steps: + - name: Clone + uses: actions/checkout@v4 + + - name: Detect Changes + uses: dorny/paths-filter@v3 + id: changes + with: + filters: ".github/file-filter.yml" + + self: + name: "Continuous Benchmarking" + if: ${{ github.repository == 'MFlowCode/MFC' && needs.file-changes.outputs.checkall == 'true' && ( + (github.event_name == 'pull_request_review' && github.event.review.state == 'approved') || + (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'sbryngelson') + ) }} + needs: file-changes + continue-on-error: true + runs-on: ubuntu-latest + steps: + - name: Clone - PR + uses: actions/checkout@v4 + with: + path: pr + + - name: Setup + run: | + sudo apt update -y + sudo apt install -y cmake gcc g++ python3 python3-dev hdf5-tools \ + libfftw3-dev libhdf5-dev openmpi-bin libopenmpi-dev + + - name: Run Fortran Benchmark + run: | + (cd pr && ./mfc.sh bench -o bench) + - name: Store benchmark result + uses: benchmark-action/github-action-benchmark@v1 + with: + name: Fortran Benchmark + tool: 'googlecpp' + output-file-path: pr/bench.json + github-token: ${{ secrets.GITHUB_TOKEN }} + auto-push: true + alert-threshold: '200%' + comment-on-alert: true + fail-on-alert: true + # alert-comment-cc-users: '@sbryngelson' + + - name: Archive Results + uses: actions/upload-artifact@v4 + if: always() + with: + path: | + pr/bench-* + pr/build/benchmarks/* + pr/bench.json + - uses: actions/checkout@v4 \ No newline at end of file From 3db57c0ca98234b9fc8bd5d0ed44173871d154c2 Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Wed, 9 Jul 2025 12:33:56 -0400 Subject: [PATCH 02/14] cont-bench testing --- .github/workflows/cont-bench.yml | 204 +++++++++++++++++++++++++++++-- 1 file changed, 194 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cont-bench.yml b/.github/workflows/cont-bench.yml index 0e6500ccb..b7257745f 100644 --- a/.github/workflows/cont-bench.yml +++ b/.github/workflows/cont-bench.yml @@ -5,11 +5,14 @@ on: pull_request_review: types: [submitted] workflow_dispatch: - + push: + branches: [main, master] permissions: contents: write deployments: write + pages: write + id-token: write jobs: file-changes: @@ -20,21 +23,24 @@ jobs: steps: - name: Clone uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Detect Changes uses: dorny/paths-filter@v3 id: changes with: filters: ".github/file-filter.yml" + base: ${{ github.event.repository.default_branch || 'main' }} self: name: "Continuous Benchmarking" - if: ${{ github.repository == 'MFlowCode/MFC' && needs.file-changes.outputs.checkall == 'true' && ( - (github.event_name == 'pull_request_review' && github.event.review.state == 'approved') || - (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'sbryngelson') - ) }} - needs: file-changes - continue-on-error: true + # if: ${{ github.repository == 'MFlowCode/MFC' && needs.file-changes.outputs.checkall == 'true' && ( + # (github.event_name == 'pull_request_review' && github.event.review.state == 'approved') || + # (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'sbryngelson') + # ) }} + # needs: file-changes + # continue-on-error: true runs-on: ubuntu-latest steps: - name: Clone - PR @@ -51,25 +57,203 @@ jobs: - name: Run Fortran Benchmark run: | (cd pr && ./mfc.sh bench -o bench) + - name: Store benchmark result uses: benchmark-action/github-action-benchmark@v1 with: name: Fortran Benchmark tool: 'googlecpp' - output-file-path: pr/bench.json + output-file-path: pr/bench-* github-token: ${{ secrets.GITHUB_TOKEN }} auto-push: true alert-threshold: '200%' comment-on-alert: true fail-on-alert: true + gh-pages-branch: 'gh-pages' + benchmark-data-dir-path: benchmarks # alert-comment-cc-users: '@sbryngelson' + + - name: Create Benchmark Documentation + run: | + mkdir -p pr/docs/documentation + cat > pr/docs/documentation/cont-bench.md << 'EOF' + # Continuous Benchmarking + + This page provides an overview of MFC's continuous benchmarking system and results. + + ## Overview + + The continuous benchmarking system automatically runs performance tests on every approved pull request and main branch commit to track performance regressions and improvements over time. + + ## Benchmark Results + + ### Live Dashboard + + View the interactive benchmark dashboard with historical performance data: + + **[🔗 Live Benchmark Results](https://mflowcode.github.io/MFC/benchmarks/)** + + ### Key Metrics + + Our benchmarking system tracks the following performance metrics: + + - **Execution Time**: Overall runtime of benchmark cases + - **Memory Usage**: Peak memory consumption during execution + - **Computational Efficiency**: Performance per computational unit + - **Scalability**: Performance across different problem sizes + + ### Benchmark Cases + + The benchmark suite includes: + + 1. **Standard Test Cases**: Representative fluid dynamics problems + 2. **Scaling Tests**: Performance evaluation across different core counts + 3. **Memory Tests**: Memory efficiency and usage patterns + 4. **Accuracy Tests**: Verification of numerical accuracy + + ## Performance Trends + + ```mermaid + graph LR + A[PR Submitted] --> B[Benchmark Run] + B --> C[Results Stored] + C --> D[Performance Comparison] + D --> E{Performance OK?} + E -->|Yes| F[PR Approved] + E -->|No| G[Alert Generated] + G --> H[Developer Notified] + ``` + + ## Alert System + + The system automatically: + + - 🚨 **Generates alerts** when performance degrades by more than 200% + - 📊 **Comments on PRs** with performance impact analysis + - 📈 **Tracks trends** to identify gradual performance changes + - 👥 **Notifies maintainers** of significant performance issues + + ## Configuration + + ### Benchmark Triggers + + Benchmarks are automatically triggered on: + + - ✅ Approved pull request reviews + - 🔄 Pull requests from trusted contributors + - 📦 Pushes to main/master branches + - 🎯 Manual workflow dispatch + + ### Performance Thresholds + + - **Alert Threshold**: 200% performance degradation + - **Fail Threshold**: Critical performance regressions + - **Comparison Base**: Previous main branch performance + + ## Interpreting Results + + ### Performance Metrics + + | Metric | Description | Good Trend | Bad Trend | + |--------|-------------|------------|-----------| + | Runtime | Execution time | ⬇️ Decreasing | ⬆️ Increasing | + | Memory | Peak memory usage | ⬇️ Decreasing | ⬆️ Increasing | + | Efficiency | Ops per second | ⬆️ Increasing | ⬇️ Decreasing | + + ### Reading the Dashboard + + 1. **Timeline View**: Shows performance evolution over time + 2. **Comparison View**: Compares current vs. baseline performance + 3. **Detailed Metrics**: Drill down into specific performance aspects + 4. **Regression Detection**: Automatically highlights performance issues + + ## Contributing to Benchmarks + + ### Adding New Benchmarks + + To add new benchmark cases: + + 1. Add test case to `benchmarks/` directory + 2. Update benchmark configuration + 3. Ensure proper performance metrics collection + 4. Test locally before submitting PR + + ### Best Practices + + - 🎯 **Focus on representative cases** that reflect real-world usage + - 📊 **Include scalability tests** for different problem sizes + - 🔄 **Maintain benchmark stability** to ensure reliable comparisons + - 📝 **Document benchmark purpose** and expected performance characteristics + + ## Troubleshooting + + ### Common Issues + + | Issue | Cause | Solution | + |-------|-------|----------| + | Benchmark timeout | Long-running test | Optimize test case or increase timeout | + | Memory errors | Insufficient resources | Check memory requirements | + | Inconsistent results | System variability | Multiple runs or statistical analysis | + + ### Getting Help + + - 📧 Contact: @sbryngelson for benchmark-related issues + - 🐛 Issues: Report problems via GitHub issues + - 📖 Documentation: Check MFC documentation for detailed guides + + --- + + *Last updated: $(date '+%Y-%m-%d %H:%M:%S UTC')* + *Generated automatically by the continuous benchmarking workflow* + EOF + + - name: Commit Documentation + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + cd pr + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add docs/documentation/cont-bench.md + if git diff --staged --quiet; then + echo "No changes to commit" + else + git commit -m "Update continuous benchmarking documentation [skip ci]" + git push + fi + - name: Archive Results uses: actions/upload-artifact@v4 if: always() with: + name: benchmark-results path: | pr/bench-* pr/build/benchmarks/* - pr/bench.json - - uses: actions/checkout@v4 \ No newline at end of file + pr/docs/documentation/cont-bench.md + + deploy-pages: + name: Deploy Benchmark Pages + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + needs: self + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: gh-pages + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: . + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3 From 85cd57c58a3cae0912642a38749e94bed06491b1 Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Wed, 9 Jul 2025 12:45:54 -0400 Subject: [PATCH 03/14] cont-bench testing --- .github/workflows/cont-bench.yml | 39 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/cont-bench.yml b/.github/workflows/cont-bench.yml index b7257745f..c929850ff 100644 --- a/.github/workflows/cont-bench.yml +++ b/.github/workflows/cont-bench.yml @@ -15,23 +15,23 @@ permissions: id-token: write jobs: - file-changes: - name: Detect File Changes - runs-on: 'ubuntu-latest' - outputs: - checkall: ${{ steps.changes.outputs.checkall }} - steps: - - name: Clone - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Detect Changes - uses: dorny/paths-filter@v3 - id: changes - with: - filters: ".github/file-filter.yml" - base: ${{ github.event.repository.default_branch || 'main' }} + # file-changes: + # name: Detect File Changes + # runs-on: 'ubuntu-latest' + # outputs: + # checkall: ${{ steps.changes.outputs.checkall }} + # steps: + # - name: Clone + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + + # - name: Detect Changes + # uses: dorny/paths-filter@v3 + # id: changes + # with: + # filters: ".github/file-filter.yml" + # base: ${{ github.event.repository.default_branch || 'main' }} self: name: "Continuous Benchmarking" @@ -64,7 +64,7 @@ jobs: name: Fortran Benchmark tool: 'googlecpp' output-file-path: pr/bench-* - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: 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 auto-push: true alert-threshold: '200%' comment-on-alert: true @@ -73,7 +73,6 @@ jobs: benchmark-data-dir-path: benchmarks # alert-comment-cc-users: '@sbryngelson' - - name: Create Benchmark Documentation run: | mkdir -p pr/docs/documentation @@ -218,7 +217,7 @@ jobs: if git diff --staged --quiet; then echo "No changes to commit" else - git commit -m "Update continuous benchmarking documentation [skip ci]" + git commit -m "Update continuous benchmarking documentation" git push fi From 93a093a2adfea00b87e4f7640d073108a5671fc4 Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Wed, 9 Jul 2025 12:50:38 -0400 Subject: [PATCH 04/14] cont-bench testing --- .github/workflows/cont-bench.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cont-bench.yml b/.github/workflows/cont-bench.yml index c929850ff..9d7743a72 100644 --- a/.github/workflows/cont-bench.yml +++ b/.github/workflows/cont-bench.yml @@ -64,7 +64,7 @@ jobs: name: Fortran Benchmark tool: 'googlecpp' output-file-path: pr/bench-* - github-token: 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 + github-token: ${{ secrets.TOKEN }} auto-push: true alert-threshold: '200%' comment-on-alert: true From d7d8e7af5d7e6f0e83709127ad5ae3a4f85d8caa Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Wed, 9 Jul 2025 15:41:37 -0400 Subject: [PATCH 05/14] test bench setup --- .github/workflows/cont-bench.yml | 334 +++++++++++++++---------------- 1 file changed, 156 insertions(+), 178 deletions(-) diff --git a/.github/workflows/cont-bench.yml b/.github/workflows/cont-bench.yml index 9d7743a72..ce5002604 100644 --- a/.github/workflows/cont-bench.yml +++ b/.github/workflows/cont-bench.yml @@ -2,8 +2,6 @@ name: Continuous Benchmarking on: pull_request: - pull_request_review: - types: [submitted] workflow_dispatch: push: branches: [main, master] @@ -15,32 +13,8 @@ permissions: id-token: write jobs: - # file-changes: - # name: Detect File Changes - # runs-on: 'ubuntu-latest' - # outputs: - # checkall: ${{ steps.changes.outputs.checkall }} - # steps: - # - name: Clone - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - - # - name: Detect Changes - # uses: dorny/paths-filter@v3 - # id: changes - # with: - # filters: ".github/file-filter.yml" - # base: ${{ github.event.repository.default_branch || 'main' }} - self: name: "Continuous Benchmarking" - # if: ${{ github.repository == 'MFlowCode/MFC' && needs.file-changes.outputs.checkall == 'true' && ( - # (github.event_name == 'pull_request_review' && github.event.review.state == 'approved') || - # (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'sbryngelson') - # ) }} - # needs: file-changes - # continue-on-error: true runs-on: ubuntu-latest steps: - name: Clone - PR @@ -53,206 +27,210 @@ jobs: sudo apt update -y sudo apt install -y cmake gcc g++ python3 python3-dev hdf5-tools \ libfftw3-dev libhdf5-dev openmpi-bin libopenmpi-dev + export TOKEN=$(gh auth token) + sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 + sudo chmod +x /usr/local/bin/yq + yq --version - name: Run Fortran Benchmark run: | - (cd pr && ./mfc.sh bench -o bench) - - - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@v1 - with: - name: Fortran Benchmark - tool: 'googlecpp' - output-file-path: pr/bench-* - github-token: ${{ secrets.TOKEN }} - auto-push: true - alert-threshold: '200%' - comment-on-alert: true - fail-on-alert: true - gh-pages-branch: 'gh-pages' - benchmark-data-dir-path: benchmarks - # alert-comment-cc-users: '@sbryngelson' + (cd pr && ./mfc.sh bench -o bench.yaml) + find pr/ -maxdepth 1 -name "*.yaml" -exec sh -c 'yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; + + # - name: Store benchmark result + # uses: benchmark-action/github-action-benchmark@v1 + # with: + # name: Fortran Benchmark + # tool: 'googlecpp' + # output-file-path: pr/bench*.json + # github-token: ${{ secrets.GITHUB_TOKEN }} + # auto-push: true + # alert-threshold: '200%' + # comment-on-alert: true + # fail-on-alert: true + # gh-pages-branch: 'gh-pages' + # benchmark-data-dir-path: benchmarks - - name: Create Benchmark Documentation - run: | - mkdir -p pr/docs/documentation - cat > pr/docs/documentation/cont-bench.md << 'EOF' - # Continuous Benchmarking + # - name: Create Benchmark Documentation + # run: | + # mkdir -p pr/docs/documentation + # cat > pr/docs/documentation/cont-bench.md << 'EOF' + # # Continuous Benchmarking - This page provides an overview of MFC's continuous benchmarking system and results. + # This page provides an overview of MFC's continuous benchmarking system and results. - ## Overview + # ## Overview - The continuous benchmarking system automatically runs performance tests on every approved pull request and main branch commit to track performance regressions and improvements over time. + # The continuous benchmarking system automatically runs performance tests on every approved pull request and main branch commit to track performance regressions and improvements over time. - ## Benchmark Results + # ## Benchmark Results - ### Live Dashboard + # ### Live Dashboard - View the interactive benchmark dashboard with historical performance data: + # View the interactive benchmark dashboard with historical performance data: - **[🔗 Live Benchmark Results](https://mflowcode.github.io/MFC/benchmarks/)** + # **[🔗 Live Benchmark Results](https://mflowcode.github.io/MFC/benchmarks/)** - ### Key Metrics + # ### Key Metrics - Our benchmarking system tracks the following performance metrics: + # Our benchmarking system tracks the following performance metrics: - - **Execution Time**: Overall runtime of benchmark cases - - **Memory Usage**: Peak memory consumption during execution - - **Computational Efficiency**: Performance per computational unit - - **Scalability**: Performance across different problem sizes + # - **Execution Time**: Overall runtime of benchmark cases + # - **Memory Usage**: Peak memory consumption during execution + # - **Computational Efficiency**: Performance per computational unit + # - **Scalability**: Performance across different problem sizes - ### Benchmark Cases + # ### Benchmark Cases - The benchmark suite includes: + # The benchmark suite includes: - 1. **Standard Test Cases**: Representative fluid dynamics problems - 2. **Scaling Tests**: Performance evaluation across different core counts - 3. **Memory Tests**: Memory efficiency and usage patterns - 4. **Accuracy Tests**: Verification of numerical accuracy + # 1. **Standard Test Cases**: Representative fluid dynamics problems + # 2. **Scaling Tests**: Performance evaluation across different core counts + # 3. **Memory Tests**: Memory efficiency and usage patterns + # 4. **Accuracy Tests**: Verification of numerical accuracy - ## Performance Trends + # ## Performance Trends - ```mermaid - graph LR - A[PR Submitted] --> B[Benchmark Run] - B --> C[Results Stored] - C --> D[Performance Comparison] - D --> E{Performance OK?} - E -->|Yes| F[PR Approved] - E -->|No| G[Alert Generated] - G --> H[Developer Notified] - ``` + # ```mermaid + # graph LR + # A[PR Submitted] --> B[Benchmark Run] + # B --> C[Results Stored] + # C --> D[Performance Comparison] + # D --> E{Performance OK?} + # E -->|Yes| F[PR Approved] + # E -->|No| G[Alert Generated] + # G --> H[Developer Notified] + # ``` - ## Alert System + # ## Alert System - The system automatically: + # The system automatically: - - 🚨 **Generates alerts** when performance degrades by more than 200% - - 📊 **Comments on PRs** with performance impact analysis - - 📈 **Tracks trends** to identify gradual performance changes - - 👥 **Notifies maintainers** of significant performance issues + # - 🚨 **Generates alerts** when performance degrades by more than 200% + # - 📊 **Comments on PRs** with performance impact analysis + # - 📈 **Tracks trends** to identify gradual performance changes + # - 👥 **Notifies maintainers** of significant performance issues - ## Configuration + # ## Configuration - ### Benchmark Triggers + # ### Benchmark Triggers - Benchmarks are automatically triggered on: + # Benchmarks are automatically triggered on: - - ✅ Approved pull request reviews - - 🔄 Pull requests from trusted contributors - - 📦 Pushes to main/master branches - - 🎯 Manual workflow dispatch + # - ✅ Approved pull request reviews + # - 🔄 Pull requests from trusted contributors + # - 📦 Pushes to main/master branches + # - 🎯 Manual workflow dispatch - ### Performance Thresholds + # ### Performance Thresholds - - **Alert Threshold**: 200% performance degradation - - **Fail Threshold**: Critical performance regressions - - **Comparison Base**: Previous main branch performance + # - **Alert Threshold**: 200% performance degradation + # - **Fail Threshold**: Critical performance regressions + # - **Comparison Base**: Previous main branch performance - ## Interpreting Results + # ## Interpreting Results - ### Performance Metrics + # ### Performance Metrics - | Metric | Description | Good Trend | Bad Trend | - |--------|-------------|------------|-----------| - | Runtime | Execution time | ⬇️ Decreasing | ⬆️ Increasing | - | Memory | Peak memory usage | ⬇️ Decreasing | ⬆️ Increasing | - | Efficiency | Ops per second | ⬆️ Increasing | ⬇️ Decreasing | + # | Metric | Description | Good Trend | Bad Trend | + # |--------|-------------|------------|-----------| + # | Runtime | Execution time | ⬇️ Decreasing | ⬆️ Increasing | + # | Memory | Peak memory usage | ⬇️ Decreasing | ⬆️ Increasing | + # | Efficiency | Ops per second | ⬆️ Increasing | ⬇️ Decreasing | - ### Reading the Dashboard + # ### Reading the Dashboard - 1. **Timeline View**: Shows performance evolution over time - 2. **Comparison View**: Compares current vs. baseline performance - 3. **Detailed Metrics**: Drill down into specific performance aspects - 4. **Regression Detection**: Automatically highlights performance issues + # 1. **Timeline View**: Shows performance evolution over time + # 2. **Comparison View**: Compares current vs. baseline performance + # 3. **Detailed Metrics**: Drill down into specific performance aspects + # 4. **Regression Detection**: Automatically highlights performance issues - ## Contributing to Benchmarks + # ## Contributing to Benchmarks - ### Adding New Benchmarks + # ### Adding New Benchmarks - To add new benchmark cases: + # To add new benchmark cases: - 1. Add test case to `benchmarks/` directory - 2. Update benchmark configuration - 3. Ensure proper performance metrics collection - 4. Test locally before submitting PR + # 1. Add test case to `benchmarks/` directory + # 2. Update benchmark configuration + # 3. Ensure proper performance metrics collection + # 4. Test locally before submitting PR - ### Best Practices + # ### Best Practices - - 🎯 **Focus on representative cases** that reflect real-world usage - - 📊 **Include scalability tests** for different problem sizes - - 🔄 **Maintain benchmark stability** to ensure reliable comparisons - - 📝 **Document benchmark purpose** and expected performance characteristics + # - 🎯 **Focus on representative cases** that reflect real-world usage + # - 📊 **Include scalability tests** for different problem sizes + # - 🔄 **Maintain benchmark stability** to ensure reliable comparisons + # - 📝 **Document benchmark purpose** and expected performance characteristics - ## Troubleshooting + # ## Troubleshooting - ### Common Issues + # ### Common Issues - | Issue | Cause | Solution | - |-------|-------|----------| - | Benchmark timeout | Long-running test | Optimize test case or increase timeout | - | Memory errors | Insufficient resources | Check memory requirements | - | Inconsistent results | System variability | Multiple runs or statistical analysis | + # | Issue | Cause | Solution | + # |-------|-------|----------| + # | Benchmark timeout | Long-running test | Optimize test case or increase timeout | + # | Memory errors | Insufficient resources | Check memory requirements | + # | Inconsistent results | System variability | Multiple runs or statistical analysis | - ### Getting Help + # ### Getting Help - - 📧 Contact: @sbryngelson for benchmark-related issues - - 🐛 Issues: Report problems via GitHub issues - - 📖 Documentation: Check MFC documentation for detailed guides + # - 📧 Contact: @sbryngelson for benchmark-related issues + # - 🐛 Issues: Report problems via GitHub issues + # - 📖 Documentation: Check MFC documentation for detailed guides - --- + # --- - *Last updated: $(date '+%Y-%m-%d %H:%M:%S UTC')* - *Generated automatically by the continuous benchmarking workflow* - EOF + # *Last updated: $(date '+%Y-%m-%d %H:%M:%S UTC')* + # *Generated automatically by the continuous benchmarking workflow* + # EOF - - name: Commit Documentation - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - run: | - cd pr - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add docs/documentation/cont-bench.md - if git diff --staged --quiet; then - echo "No changes to commit" - else - git commit -m "Update continuous benchmarking documentation" - git push - fi + # - name: Commit Documentation + # if: github.event_name == 'push' && github.ref == 'refs/heads/main' + # run: | + # cd pr + # git config --local user.email "action@github.com" + # git config --local user.name "GitHub Action" + # git add docs/documentation/cont-bench.md + # if git diff --staged --quiet; then + # echo "No changes to commit" + # else + # git commit -m "Update continuous benchmarking documentation" + # git push + # fi - - name: Archive Results - uses: actions/upload-artifact@v4 - if: always() - with: - name: benchmark-results - path: | - pr/bench-* - pr/build/benchmarks/* - pr/docs/documentation/cont-bench.md - - deploy-pages: - name: Deploy Benchmark Pages - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - needs: self - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: gh-pages + # - name: Archive Results + # uses: actions/upload-artifact@v4 + # if: always() + # with: + # name: benchmark-results + # path: | + # pr/bench-* + # pr/build/benchmarks/* + # pr/docs/documentation/cont-bench.md + + # deploy-pages: + # name: Deploy Benchmark Pages + # if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + # needs: self + # runs-on: ubuntu-latest + # environment: + # name: github-pages + # url: ${{ steps.deployment.outputs.page_url }} + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # ref: gh-pages - - name: Setup Pages - uses: actions/configure-pages@v4 + # - name: Setup Pages + # uses: actions/configure-pages@v4 - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - path: . + # - name: Upload artifact + # uses: actions/upload-pages-artifact@v2 + # with: + # path: . - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v3 + # - name: Deploy to GitHub Pages + # id: deployment + # uses: actions/deploy-pages@v3 From eeffaa4cfcbfeb4a2238f3f0562aa81fa679c791 Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Wed, 9 Jul 2025 15:45:32 -0400 Subject: [PATCH 06/14] another test --- .github/workflows/cont-bench.yml | 203 +------------------------------ 1 file changed, 1 insertion(+), 202 deletions(-) diff --git a/.github/workflows/cont-bench.yml b/.github/workflows/cont-bench.yml index ce5002604..84008dc62 100644 --- a/.github/workflows/cont-bench.yml +++ b/.github/workflows/cont-bench.yml @@ -2,9 +2,6 @@ name: Continuous Benchmarking on: pull_request: - workflow_dispatch: - push: - branches: [main, master] permissions: contents: write @@ -35,202 +32,4 @@ jobs: - name: Run Fortran Benchmark run: | (cd pr && ./mfc.sh bench -o bench.yaml) - find pr/ -maxdepth 1 -name "*.yaml" -exec sh -c 'yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; - - # - name: Store benchmark result - # uses: benchmark-action/github-action-benchmark@v1 - # with: - # name: Fortran Benchmark - # tool: 'googlecpp' - # output-file-path: pr/bench*.json - # github-token: ${{ secrets.GITHUB_TOKEN }} - # auto-push: true - # alert-threshold: '200%' - # comment-on-alert: true - # fail-on-alert: true - # gh-pages-branch: 'gh-pages' - # benchmark-data-dir-path: benchmarks - - # - name: Create Benchmark Documentation - # run: | - # mkdir -p pr/docs/documentation - # cat > pr/docs/documentation/cont-bench.md << 'EOF' - # # Continuous Benchmarking - - # This page provides an overview of MFC's continuous benchmarking system and results. - - # ## Overview - - # The continuous benchmarking system automatically runs performance tests on every approved pull request and main branch commit to track performance regressions and improvements over time. - - # ## Benchmark Results - - # ### Live Dashboard - - # View the interactive benchmark dashboard with historical performance data: - - # **[🔗 Live Benchmark Results](https://mflowcode.github.io/MFC/benchmarks/)** - - # ### Key Metrics - - # Our benchmarking system tracks the following performance metrics: - - # - **Execution Time**: Overall runtime of benchmark cases - # - **Memory Usage**: Peak memory consumption during execution - # - **Computational Efficiency**: Performance per computational unit - # - **Scalability**: Performance across different problem sizes - - # ### Benchmark Cases - - # The benchmark suite includes: - - # 1. **Standard Test Cases**: Representative fluid dynamics problems - # 2. **Scaling Tests**: Performance evaluation across different core counts - # 3. **Memory Tests**: Memory efficiency and usage patterns - # 4. **Accuracy Tests**: Verification of numerical accuracy - - # ## Performance Trends - - # ```mermaid - # graph LR - # A[PR Submitted] --> B[Benchmark Run] - # B --> C[Results Stored] - # C --> D[Performance Comparison] - # D --> E{Performance OK?} - # E -->|Yes| F[PR Approved] - # E -->|No| G[Alert Generated] - # G --> H[Developer Notified] - # ``` - - # ## Alert System - - # The system automatically: - - # - 🚨 **Generates alerts** when performance degrades by more than 200% - # - 📊 **Comments on PRs** with performance impact analysis - # - 📈 **Tracks trends** to identify gradual performance changes - # - 👥 **Notifies maintainers** of significant performance issues - - # ## Configuration - - # ### Benchmark Triggers - - # Benchmarks are automatically triggered on: - - # - ✅ Approved pull request reviews - # - 🔄 Pull requests from trusted contributors - # - 📦 Pushes to main/master branches - # - 🎯 Manual workflow dispatch - - # ### Performance Thresholds - - # - **Alert Threshold**: 200% performance degradation - # - **Fail Threshold**: Critical performance regressions - # - **Comparison Base**: Previous main branch performance - - # ## Interpreting Results - - # ### Performance Metrics - - # | Metric | Description | Good Trend | Bad Trend | - # |--------|-------------|------------|-----------| - # | Runtime | Execution time | ⬇️ Decreasing | ⬆️ Increasing | - # | Memory | Peak memory usage | ⬇️ Decreasing | ⬆️ Increasing | - # | Efficiency | Ops per second | ⬆️ Increasing | ⬇️ Decreasing | - - # ### Reading the Dashboard - - # 1. **Timeline View**: Shows performance evolution over time - # 2. **Comparison View**: Compares current vs. baseline performance - # 3. **Detailed Metrics**: Drill down into specific performance aspects - # 4. **Regression Detection**: Automatically highlights performance issues - - # ## Contributing to Benchmarks - - # ### Adding New Benchmarks - - # To add new benchmark cases: - - # 1. Add test case to `benchmarks/` directory - # 2. Update benchmark configuration - # 3. Ensure proper performance metrics collection - # 4. Test locally before submitting PR - - # ### Best Practices - - # - 🎯 **Focus on representative cases** that reflect real-world usage - # - 📊 **Include scalability tests** for different problem sizes - # - 🔄 **Maintain benchmark stability** to ensure reliable comparisons - # - 📝 **Document benchmark purpose** and expected performance characteristics - - # ## Troubleshooting - - # ### Common Issues - - # | Issue | Cause | Solution | - # |-------|-------|----------| - # | Benchmark timeout | Long-running test | Optimize test case or increase timeout | - # | Memory errors | Insufficient resources | Check memory requirements | - # | Inconsistent results | System variability | Multiple runs or statistical analysis | - - # ### Getting Help - - # - 📧 Contact: @sbryngelson for benchmark-related issues - # - 🐛 Issues: Report problems via GitHub issues - # - 📖 Documentation: Check MFC documentation for detailed guides - - # --- - - # *Last updated: $(date '+%Y-%m-%d %H:%M:%S UTC')* - # *Generated automatically by the continuous benchmarking workflow* - # EOF - - # - name: Commit Documentation - # if: github.event_name == 'push' && github.ref == 'refs/heads/main' - # run: | - # cd pr - # git config --local user.email "action@github.com" - # git config --local user.name "GitHub Action" - # git add docs/documentation/cont-bench.md - # if git diff --staged --quiet; then - # echo "No changes to commit" - # else - # git commit -m "Update continuous benchmarking documentation" - # git push - # fi - - # - name: Archive Results - # uses: actions/upload-artifact@v4 - # if: always() - # with: - # name: benchmark-results - # path: | - # pr/bench-* - # pr/build/benchmarks/* - # pr/docs/documentation/cont-bench.md - - # deploy-pages: - # name: Deploy Benchmark Pages - # if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - # needs: self - # runs-on: ubuntu-latest - # environment: - # name: github-pages - # url: ${{ steps.deployment.outputs.page_url }} - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # ref: gh-pages - - # - name: Setup Pages - # uses: actions/configure-pages@v4 - - # - name: Upload artifact - # uses: actions/upload-pages-artifact@v2 - # with: - # path: . - - # - name: Deploy to GitHub Pages - # id: deployment - # uses: actions/deploy-pages@v3 + find pr/ -maxdepth 1 -name "*.yaml" -exec sh -c 'yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; \ No newline at end of file From 68d3733bf77d68140c8adac0a6bfecbf5aa36f82 Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Wed, 9 Jul 2025 15:46:43 -0400 Subject: [PATCH 07/14] another way --- .github/workflows/cont-bench.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cont-bench.yml b/.github/workflows/cont-bench.yml index 84008dc62..e50ee256c 100644 --- a/.github/workflows/cont-bench.yml +++ b/.github/workflows/cont-bench.yml @@ -1,7 +1,6 @@ name: Continuous Benchmarking -on: - pull_request: +on: [push, pull_request, workflow_dispatch] permissions: contents: write From 82fa00402868b4dae4f356a597dfac5671b1fe36 Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Wed, 9 Jul 2025 15:56:34 -0400 Subject: [PATCH 08/14] added detect file change --- .github/workflows/cont-bench.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cont-bench.yml b/.github/workflows/cont-bench.yml index e50ee256c..2de64924c 100644 --- a/.github/workflows/cont-bench.yml +++ b/.github/workflows/cont-bench.yml @@ -9,8 +9,28 @@ permissions: id-token: write jobs: + file-changes: + name: Detect File Changes + runs-on: 'ubuntu-latest' + outputs: + checkall: ${{ steps.changes.outputs.checkall }} + steps: + - name: Clone + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Detect Changes + uses: dorny/paths-filter@v3 + id: changes + with: + filters: ".github/file-filter.yml" + base: ${{ github.event.repository.default_branch || 'main' }} + self: name: "Continuous Benchmarking" + needs: file-changes + continue-on-error: true runs-on: ubuntu-latest steps: - name: Clone - PR @@ -28,7 +48,7 @@ jobs: sudo chmod +x /usr/local/bin/yq yq --version - - name: Run Fortran Benchmark + - name: Run Benchmark Cases run: | (cd pr && ./mfc.sh bench -o bench.yaml) find pr/ -maxdepth 1 -name "*.yaml" -exec sh -c 'yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; \ No newline at end of file From 963aff2ea6b9db5512f036f51c941bb8298d60bb Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Wed, 9 Jul 2025 16:00:39 -0400 Subject: [PATCH 09/14] addedArchive Results --- .github/workflows/cont-bench.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cont-bench.yml b/.github/workflows/cont-bench.yml index 2de64924c..6bcdf7c86 100644 --- a/.github/workflows/cont-bench.yml +++ b/.github/workflows/cont-bench.yml @@ -51,4 +51,14 @@ jobs: - name: Run Benchmark Cases run: | (cd pr && ./mfc.sh bench -o bench.yaml) - find pr/ -maxdepth 1 -name "*.yaml" -exec sh -c 'yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; \ No newline at end of file + find pr/ -maxdepth 1 -name "*.yaml" -exec sh -c 'yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; + + - name: Archive Results + uses: actions/upload-artifact@v4 + if: always() + with: + name: benchmark-results + path: | + pr/bench* + pr/build/benchmarks/* + pr/docs/documentation/cont-bench.md From 14066f2e150d8c17840b84a05f0765da991a9c7b Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Wed, 9 Jul 2025 16:14:37 -0400 Subject: [PATCH 10/14] added Benchmark Documentation --- .github/workflows/cont-bench.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cont-bench.yml b/.github/workflows/cont-bench.yml index 6bcdf7c86..df2b30e14 100644 --- a/.github/workflows/cont-bench.yml +++ b/.github/workflows/cont-bench.yml @@ -51,7 +51,30 @@ jobs: - name: Run Benchmark Cases run: | (cd pr && ./mfc.sh bench -o bench.yaml) - find pr/ -maxdepth 1 -name "*.yaml" -exec sh -c 'yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; + find pr -maxdepth 1 -name "*.yaml" -exec sh -c 'yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; + + - name: Create Benchmark Documentation + run: | + mkdir -p pr/docs/documentation + cat > pr/docs/documentation/cont-bench.md << 'EOF' + # Continuous Benchmarking + + ## Overview + + The continuous benchmarking system automatically runs performance tests on every approved pull request and main branch commit to track performance regressions and improvements over time. + + ## Benchmark Results + + ### Live Dashboard + + View the interactive benchmark dashboard with historical performance data: + + **[🔗 Live Benchmark Results](https://mflowcode.github.io/MFC/benchmarks/)** + + *Last updated: $(date '+%Y-%m-%d %H:%M:%S UTC')* + *Generated automatically by the continuous benchmarking workflow* + EOF + - name: Archive Results uses: actions/upload-artifact@v4 From d7b8ed46cee41c0147b312d1669b38d8d40facda Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Wed, 9 Jul 2025 20:38:08 -0400 Subject: [PATCH 11/14] all files --- .env | 2 + .github/workflows/bench/test.yaml | 2 + .github/workflows/cont-bench.yml | 90 ++++++++++-- .github/workflows/mfc.sh | 6 + .github/workflows/test-components.sh | 48 ++++++ .github/workflows/test-cont-bench.yml | 201 ++++++++++++++++++++++++++ bench | 153 ++++++++++++++++++++ bench-google.json | 69 +++++++++ bench.json | 195 +++++++++++++++++++++++++ bench.yaml | 153 ++++++++++++++++++++ docs/documentation/cont-bench.md | 11 ++ test-components.sh | 48 ++++++ 12 files changed, 964 insertions(+), 14 deletions(-) create mode 100644 .env create mode 100644 .github/workflows/bench/test.yaml create mode 100755 .github/workflows/mfc.sh create mode 100755 .github/workflows/test-components.sh create mode 100644 .github/workflows/test-cont-bench.yml create mode 100644 bench create mode 100644 bench-google.json create mode 100644 bench.json create mode 100644 bench.yaml create mode 100644 docs/documentation/cont-bench.md create mode 100755 test-components.sh diff --git a/.env b/.env new file mode 100644 index 000000000..88bf9f148 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +TOKEN=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 +GITHUB_TOKEN=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 diff --git a/.github/workflows/bench/test.yaml b/.github/workflows/bench/test.yaml new file mode 100644 index 000000000..1e82c56d4 --- /dev/null +++ b/.github/workflows/bench/test.yaml @@ -0,0 +1,2 @@ +name: test_benchmark +time: 1.23 diff --git a/.github/workflows/cont-bench.yml b/.github/workflows/cont-bench.yml index df2b30e14..9fe93b3d0 100644 --- a/.github/workflows/cont-bench.yml +++ b/.github/workflows/cont-bench.yml @@ -53,28 +53,90 @@ jobs: (cd pr && ./mfc.sh bench -o bench.yaml) find pr -maxdepth 1 -name "*.yaml" -exec sh -c 'yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; - - name: Create Benchmark Documentation + + - name: Convert MFC to Google Benchmark Format run: | - mkdir -p pr/docs/documentation - cat > pr/docs/documentation/cont-bench.md << 'EOF' - # Continuous Benchmarking + python3 << 'EOF' + import json + from datetime import datetime + + # Read the MFC benchmark data + with open('bench.json', 'r') as f: + mfc_data = json.load(f) - ## Overview + # Convert to Google Benchmark format + benchmarks = [] - The continuous benchmarking system automatically runs performance tests on every approved pull request and main branch commit to track performance regressions and improvements over time. + for case_name, case_data in mfc_data['cases'].items(): + output_summary = case_data['output_summary'] + + # Simulation execution time + if 'simulation' in output_summary and 'exec' in output_summary['simulation']: + benchmarks.append({ + "name": f"{case_name}/simulation_time", + "family_index": len(benchmarks), + "per_family_instance_index": 0, + "run_name": f"{case_name}/simulation_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": output_summary['simulation']['exec'] * 1e9, + "cpu_time": output_summary['simulation']['exec'] * 1e9, + "time_unit": "ns" + }) + + # Simulation grind time + if 'simulation' in output_summary and 'grind' in output_summary['simulation']: + benchmarks.append({ + "name": f"{case_name}/grind_time", + "family_index": len(benchmarks), + "per_family_instance_index": 0, + "run_name": f"{case_name}/grind_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": output_summary['simulation']['grind'], + "cpu_time": output_summary['simulation']['grind'], + "time_unit": "ns" + }) - ## Benchmark Results + # Create Google Benchmark format + google_benchmark_data = { + "context": { + "date": datetime.now().isoformat(), + "host_name": "github-runner", + "executable": "mfc_benchmark", + "num_cpus": 2, + "mhz_per_cpu": 2000, + "cpu_scaling_enabled": False, + "caches": [] + }, + "benchmarks": benchmarks + } - ### Live Dashboard - - View the interactive benchmark dashboard with historical performance data: - - **[🔗 Live Benchmark Results](https://mflowcode.github.io/MFC/benchmarks/)** + # Write the converted data + with open('bench-google.json', 'w') as f: + json.dump(google_benchmark_data, f, indent=2) - *Last updated: $(date '+%Y-%m-%d %H:%M:%S UTC')* - *Generated automatically by the continuous benchmarking workflow* + print(f"✓ Converted {len(benchmarks)} benchmark measurements") EOF + - name: Store benchmark result + uses: benchmark-action/github-action-benchmark@v1 + with: + name: C++ Benchmark + tool: 'googlecpp' + output-file-path: bench-google.json + github-token: ${{ secrets.GITHUB_TOKEN }} + auto-push: true + alert-threshold: '200%' + comment-on-alert: true + fail-on-alert: true + alert-comment-cc-users: '@Malmahrouqi' - name: Archive Results uses: actions/upload-artifact@v4 diff --git a/.github/workflows/mfc.sh b/.github/workflows/mfc.sh new file mode 100755 index 000000000..33dd401fa --- /dev/null +++ b/.github/workflows/mfc.sh @@ -0,0 +1,6 @@ +#!/bin/bash +echo "Mock benchmark running..." +mkdir -p bench +echo "name: test_benchmark" > bench/test.yaml +echo "time: 1.23" >> bench/test.yaml +echo "Mock benchmark completed" diff --git a/.github/workflows/test-components.sh b/.github/workflows/test-components.sh new file mode 100755 index 000000000..14fab2518 --- /dev/null +++ b/.github/workflows/test-components.sh @@ -0,0 +1,48 @@ +#!/bin/bash +set -e + +echo "=== Testing Individual Components ===" + +# Test 1: Check if mfc.sh exists and is executable +echo "1. Testing mfc.sh..." +if [ -f "./mfc.sh" ]; then + chmod +x ./mfc.sh + echo "✓ mfc.sh found and made executable" +else + echo "✗ mfc.sh not found - creating mock for testing" + cat > ./mfc.sh << 'MOCK' +#!/bin/bash +echo "Mock benchmark running..." +mkdir -p bench +echo "name: test_benchmark" > bench/test.yaml +echo "time: 1.23" >> bench/test.yaml +echo "Mock benchmark completed" +MOCK + chmod +x ./mfc.sh +fi + +# Test 2: Run benchmark command +echo "2. Testing benchmark execution..." +./mfc.sh bench -o bench || echo "Benchmark failed, continuing with mock data" + +# Test 3: Check yq installation and YAML to JSON conversion +echo "3. Testing YAML to JSON conversion..." +if ! command -v yq &> /dev/null; then + echo "Installing yq..." + sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 + sudo chmod +x /usr/local/bin/yq +fi + +# Convert any YAML files found +find . -maxdepth 1 -name "*.yaml" -exec sh -c 'echo "Converting $1"; yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; + +# Test 4: Check JSON output format +echo "4. Validating JSON format..." +for json_file in *.json; do + if [ -f "$json_file" ]; then + echo "Checking $json_file:" + python3 -c "import json; json.load(open('$json_file')); print('✓ Valid JSON')" || echo "✗ Invalid JSON" + fi +done + +echo "=== Component Testing Complete ===" diff --git a/.github/workflows/test-cont-bench.yml b/.github/workflows/test-cont-bench.yml new file mode 100644 index 000000000..3af2985bc --- /dev/null +++ b/.github/workflows/test-cont-bench.yml @@ -0,0 +1,201 @@ +name: Continuous Benchmarking + +on: [push, pull_request, workflow_dispatch] + +permissions: + contents: write + deployments: write + pages: write + id-token: write + +jobs: + self: + name: "Store benchmark result" + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Convert MFC to Google Benchmark Format + run: | + python3 << 'EOF' + import json + from datetime import datetime + + # Read the MFC benchmark data + with open('bench.json', 'r') as f: + mfc_data = json.load(f) + + # Convert to Google Benchmark format + benchmarks = [] + + for case_name, case_data in mfc_data['cases'].items(): + output_summary = case_data['output_summary'] + + # Simulation execution time + if 'simulation' in output_summary and 'exec' in output_summary['simulation']: + benchmarks.append({ + "name": f"{case_name}/simulation_time", + "family_index": len(benchmarks), + "per_family_instance_index": 0, + "run_name": f"{case_name}/simulation_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": output_summary['simulation']['exec'] * 1e9, + "cpu_time": output_summary['simulation']['exec'] * 1e9, + "time_unit": "ns" + }) + + # Simulation grind time + if 'simulation' in output_summary and 'grind' in output_summary['simulation']: + benchmarks.append({ + "name": f"{case_name}/grind_time", + "family_index": len(benchmarks), + "per_family_instance_index": 0, + "run_name": f"{case_name}/grind_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": output_summary['simulation']['grind'], + "cpu_time": output_summary['simulation']['grind'], + "time_unit": "ns" + }) + + # Create Google Benchmark format + google_benchmark_data = { + "context": { + "date": datetime.now().isoformat(), + "host_name": "github-runner", + "executable": "mfc_benchmark", + "num_cpus": 2, + "mhz_per_cpu": 2000, + "cpu_scaling_enabled": False, + "caches": [] + }, + "benchmarks": benchmarks + } + + # Write the converted data + with open('bench-google.json', 'w') as f: + json.dump(google_benchmark_data, f, indent=2) + + print(f"✓ Converted {len(benchmarks)} benchmark measurements") + EOF + + - name: Create report generator script + run: | + cat > generate_report.py << 'SCRIPT' + import json + import os + from datetime import datetime + + def generate_markdown_report(): + # Read benchmark data + with open('bench-google.json', 'r') as f: + data = json.load(f) + + # Create directory + os.makedirs('docs/documentation', exist_ok=True) + + # Start building content + lines = [] + lines.append("# Continuouscl Benchmarking Results") + lines.append("") + lines.append(f"Generated on: {datetime.now().strftime('%Y-%m-%d %H:%M:%S UTC')}") + lines.append("") + lines.append("## System Information") + lines.append(f"- Host: {data['context']['host_name']}") + lines.append(f"- CPUs: {data['context']['num_cpus']}") + lines.append(f"- MHz per CPU: {data['context']['mhz_per_cpu']}") + lines.append("") + lines.append("## Benchmark Results") + lines.append("") + lines.append("| Test Case | Metric | Time (seconds) | Time (nanoseconds) |") + lines.append("|-----------|--------|----------------|-------------------|") + + # Add benchmark data + for benchmark in data['benchmarks']: + name_parts = benchmark['name'].split('/') + case_name = name_parts[0] + metric_name = name_parts[1] if len(name_parts) > 1 else 'unknown' + time_seconds = benchmark['real_time'] / 1e9 + time_ns = benchmark['real_time'] + lines.append(f"| {case_name} | {metric_name} | {time_seconds:.6f} | {time_ns:.0f} |") + + lines.append("") + lines.append("## Raw Data") + lines.append("") + lines.append("```json") + lines.append(json.dumps(data, indent=2)) + lines.append("```") + lines.append("") + lines.append("---") + lines.append(f"*Last updated: {datetime.now().isoformat()}*") + + # Write file + with open('docs/documentation/cont-bench.md', 'w') as f: + f.write('\n'.join(lines)) + + print("✓ Generated Markdown report at docs/documentation/cont-bench.md") + + if __name__ == "__main__": + generate_markdown_report() + SCRIPT + + - name: Generate Markdown Report + run: python3 generate_report.py + + - name: Commit and Push Results + run: | + git config --local user.email "mohdsaid497566@gmail.com" + git config --local user.name "Malmahrouqi3" + + # Fetch latest changes from the remote branch + git fetch origin cont-bench || true + + # Stage the generated file + git add docs/documentation/cont-bench.md + + # Commit changes to have a clean working tree + git commit -m "Update continuous benchmarking results" || true + + # Check if we're behind the remote branch + if git rev-list HEAD..origin/cont-bench --count | grep -q "^[1-9]"; then + echo "Branch is behind remote, resolving..." + + # Save our changes to a temporary branch + git branch temp-benchmark-updates + + # Get up to date with the remote branch + git reset --hard origin/cont-bench + + # Regenerate the report with the latest code + python3 generate_report.py + + # Add the newly generated report + git add docs/documentation/cont-bench.md + + # Commit the changes + git commit -m "Update continuous benchmarking results" || true + fi + + # Push the changes, forcing if necessary + git push origin HEAD:cont-bench || git push -f origin HEAD:cont-bench + + - name: Store benchmark result + uses: benchmark-action/github-action-benchmark@v1 + with: + name: C++ Benchmark + tool: 'googlecpp' + output-file-path: bench-google.json + github-token: ${{ secrets.GITHUB_TOKEN }} + auto-push: false + alert-threshold: '200%' + comment-on-alert: true + fail-on-alert: true + alert-comment-cc-users: '@Malmahrouqi' diff --git a/bench b/bench new file mode 100644 index 000000000..40207a9f8 --- /dev/null +++ b/bench @@ -0,0 +1,153 @@ +cases: + 5eq_rk3_weno3_hllc: + description: + args: [] + path: /home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py + slug: 5eq_rk3_weno3_hllc + output_summary: + invocation: + - run + - /home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py + - --case-optimization + - --targets + - pre_process + - simulation + - post_process + - --output-summary + - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/5eq_rk3_weno3_hllc.yaml + - -- + - --gbpp + - '1' + lock: + debug: false + gcov: false + gpu: false + mpi: true + single: false + unified: false + post_process: + exec: 2.6731925 + pre_process: + exec: 0.945057 + simulation: + exec: 553.7461466 + grind: 311.46590698 + syscheck: + exec: 0.5911245 + hypo_hll: + description: + args: [] + path: /home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py + slug: hypo_hll + output_summary: + invocation: + - run + - /home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py + - --case-optimization + - --targets + - pre_process + - simulation + - post_process + - --output-summary + - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/hypo_hll.yaml + - -- + - --gbpp + - '1' + lock: + debug: false + gcov: false + gpu: false + mpi: true + single: false + unified: false + post_process: + exec: 4.6181798 + pre_process: + exec: 28.0626009 + simulation: + exec: 1158.0062294 + grind: 373.3648501 + syscheck: + exec: 0.5746224 + ibm: + description: + args: [] + path: /home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py + slug: ibm + output_summary: + invocation: + - run + - /home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py + - --case-optimization + - --targets + - pre_process + - simulation + - post_process + - --output-summary + - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/ibm.yaml + - -- + - --gbpp + - '1' + lock: + debug: false + gcov: false + gpu: false + mpi: true + single: false + unified: false + post_process: + exec: 2.7696633 + pre_process: + exec: 0.6595922 + simulation: + exec: 1560.6666524 + grind: 1329.41865639 + syscheck: + exec: 0.350557 + viscous_weno5_sgb_acoustic: + description: + args: [] + path: /home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py + slug: viscous_weno5_sgb_acoustic + output_summary: + invocation: + - run + - /home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py + - --case-optimization + - --targets + - pre_process + - simulation + - post_process + - --output-summary + - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/viscous_weno5_sgb_acoustic.yaml + - -- + - --gbpp + - '1' + lock: + debug: false + gcov: false + gpu: false + mpi: true + single: false + unified: false + post_process: + exec: 1.7293213 + pre_process: + exec: 0.7582608 + simulation: + exec: 968.760392 + grind: 1051.98369313 + syscheck: + exec: 0.6131606 +metadata: + invocation: + - bench + - -o + - bench + lock: + debug: false + gcov: false + gpu: false + mpi: true + single: false + unified: false diff --git a/bench-google.json b/bench-google.json new file mode 100644 index 000000000..258ff5933 --- /dev/null +++ b/bench-google.json @@ -0,0 +1,69 @@ +{ + "context": { + "date": "2025-07-09T16:51:13.791064", + "host_name": "test", + "executable": "mfc_benchmark", + "num_cpus": 2, + "mhz_per_cpu": 2000, + "cpu_scaling_enabled": false, + "caches": [] + }, + "benchmarks": [ + { + "name": "5eq_rk3_weno3_hllc/simulation_time", + "family_index": 0, + "per_family_instance_index": 0, + "run_name": "5eq_rk3_weno3_hllc/simulation_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 553746146600.0, + "cpu_time": 553746146600.0, + "time_unit": "ns" + }, + { + "name": "hypo_hll/simulation_time", + "family_index": 1, + "per_family_instance_index": 0, + "run_name": "hypo_hll/simulation_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 1158006229400.0, + "cpu_time": 1158006229400.0, + "time_unit": "ns" + }, + { + "name": "ibm/simulation_time", + "family_index": 2, + "per_family_instance_index": 0, + "run_name": "ibm/simulation_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 1560666652400.0, + "cpu_time": 1560666652400.0, + "time_unit": "ns" + }, + { + "name": "viscous_weno5_sgb_acoustic/simulation_time", + "family_index": 3, + "per_family_instance_index": 0, + "run_name": "viscous_weno5_sgb_acoustic/simulation_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 968760392000.0, + "cpu_time": 968760392000.0, + "time_unit": "ns" + } + ] +} \ No newline at end of file diff --git a/bench.json b/bench.json new file mode 100644 index 000000000..51457d2dc --- /dev/null +++ b/bench.json @@ -0,0 +1,195 @@ +{ + "cases": { + "5eq_rk3_weno3_hllc": { + "description": { + "args": [], + "path": "/home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py", + "slug": "5eq_rk3_weno3_hllc" + }, + "output_summary": { + "invocation": [ + "run", + "/home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py", + "--case-optimization", + "--targets", + "pre_process", + "simulation", + "post_process", + "--output-summary", + "/home/mohammed/Desktop/cont-bench/build/benchmarks/6462/5eq_rk3_weno3_hllc.yaml", + "--", + "--gbpp", + "1" + ], + "lock": { + "debug": false, + "gcov": false, + "gpu": false, + "mpi": true, + "single": false, + "unified": false + }, + "post_process": { + "exec": 2.6731925 + }, + "pre_process": { + "exec": 0.945057 + }, + "simulation": { + "exec": 553.7461466, + "grind": 311.46590698 + }, + "syscheck": { + "exec": 0.5911245 + } + } + }, + "hypo_hll": { + "description": { + "args": [], + "path": "/home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py", + "slug": "hypo_hll" + }, + "output_summary": { + "invocation": [ + "run", + "/home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py", + "--case-optimization", + "--targets", + "pre_process", + "simulation", + "post_process", + "--output-summary", + "/home/mohammed/Desktop/cont-bench/build/benchmarks/6462/hypo_hll.yaml", + "--", + "--gbpp", + "1" + ], + "lock": { + "debug": false, + "gcov": false, + "gpu": false, + "mpi": true, + "single": false, + "unified": false + }, + "post_process": { + "exec": 4.6181798 + }, + "pre_process": { + "exec": 28.0626009 + }, + "simulation": { + "exec": 1158.0062294, + "grind": 373.3648501 + }, + "syscheck": { + "exec": 0.5746224 + } + } + }, + "ibm": { + "description": { + "args": [], + "path": "/home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py", + "slug": "ibm" + }, + "output_summary": { + "invocation": [ + "run", + "/home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py", + "--case-optimization", + "--targets", + "pre_process", + "simulation", + "post_process", + "--output-summary", + "/home/mohammed/Desktop/cont-bench/build/benchmarks/6462/ibm.yaml", + "--", + "--gbpp", + "1" + ], + "lock": { + "debug": false, + "gcov": false, + "gpu": false, + "mpi": true, + "single": false, + "unified": false + }, + "post_process": { + "exec": 2.7696633 + }, + "pre_process": { + "exec": 0.6595922 + }, + "simulation": { + "exec": 1560.6666524, + "grind": 1329.41865639 + }, + "syscheck": { + "exec": 0.350557 + } + } + }, + "viscous_weno5_sgb_acoustic": { + "description": { + "args": [], + "path": "/home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py", + "slug": "viscous_weno5_sgb_acoustic" + }, + "output_summary": { + "invocation": [ + "run", + "/home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py", + "--case-optimization", + "--targets", + "pre_process", + "simulation", + "post_process", + "--output-summary", + "/home/mohammed/Desktop/cont-bench/build/benchmarks/6462/viscous_weno5_sgb_acoustic.yaml", + "--", + "--gbpp", + "1" + ], + "lock": { + "debug": false, + "gcov": false, + "gpu": false, + "mpi": true, + "single": false, + "unified": false + }, + "post_process": { + "exec": 1.7293213 + }, + "pre_process": { + "exec": 0.7582608 + }, + "simulation": { + "exec": 968.760392, + "grind": 1051.98369313 + }, + "syscheck": { + "exec": 0.6131606 + } + } + } + }, + "metadata": { + "invocation": [ + "bench", + "-o", + "bench" + ], + "lock": { + "debug": false, + "gcov": false, + "gpu": false, + "mpi": true, + "single": false, + "unified": false + } + } +} diff --git a/bench.yaml b/bench.yaml new file mode 100644 index 000000000..40207a9f8 --- /dev/null +++ b/bench.yaml @@ -0,0 +1,153 @@ +cases: + 5eq_rk3_weno3_hllc: + description: + args: [] + path: /home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py + slug: 5eq_rk3_weno3_hllc + output_summary: + invocation: + - run + - /home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py + - --case-optimization + - --targets + - pre_process + - simulation + - post_process + - --output-summary + - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/5eq_rk3_weno3_hllc.yaml + - -- + - --gbpp + - '1' + lock: + debug: false + gcov: false + gpu: false + mpi: true + single: false + unified: false + post_process: + exec: 2.6731925 + pre_process: + exec: 0.945057 + simulation: + exec: 553.7461466 + grind: 311.46590698 + syscheck: + exec: 0.5911245 + hypo_hll: + description: + args: [] + path: /home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py + slug: hypo_hll + output_summary: + invocation: + - run + - /home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py + - --case-optimization + - --targets + - pre_process + - simulation + - post_process + - --output-summary + - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/hypo_hll.yaml + - -- + - --gbpp + - '1' + lock: + debug: false + gcov: false + gpu: false + mpi: true + single: false + unified: false + post_process: + exec: 4.6181798 + pre_process: + exec: 28.0626009 + simulation: + exec: 1158.0062294 + grind: 373.3648501 + syscheck: + exec: 0.5746224 + ibm: + description: + args: [] + path: /home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py + slug: ibm + output_summary: + invocation: + - run + - /home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py + - --case-optimization + - --targets + - pre_process + - simulation + - post_process + - --output-summary + - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/ibm.yaml + - -- + - --gbpp + - '1' + lock: + debug: false + gcov: false + gpu: false + mpi: true + single: false + unified: false + post_process: + exec: 2.7696633 + pre_process: + exec: 0.6595922 + simulation: + exec: 1560.6666524 + grind: 1329.41865639 + syscheck: + exec: 0.350557 + viscous_weno5_sgb_acoustic: + description: + args: [] + path: /home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py + slug: viscous_weno5_sgb_acoustic + output_summary: + invocation: + - run + - /home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py + - --case-optimization + - --targets + - pre_process + - simulation + - post_process + - --output-summary + - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/viscous_weno5_sgb_acoustic.yaml + - -- + - --gbpp + - '1' + lock: + debug: false + gcov: false + gpu: false + mpi: true + single: false + unified: false + post_process: + exec: 1.7293213 + pre_process: + exec: 0.7582608 + simulation: + exec: 968.760392 + grind: 1051.98369313 + syscheck: + exec: 0.6131606 +metadata: + invocation: + - bench + - -o + - bench + lock: + debug: false + gcov: false + gpu: false + mpi: true + single: false + unified: false diff --git a/docs/documentation/cont-bench.md b/docs/documentation/cont-bench.md new file mode 100644 index 000000000..e12bb3406 --- /dev/null +++ b/docs/documentation/cont-bench.md @@ -0,0 +1,11 @@ +# Continuous Benchmarking + +## Overview + +The continuous benchmarking framework automatically runs performance tests on select performance-critical approved pull request and main branch commit to track performance regressions and improvements over time. + +## Benchmark Results + +View historical performance data: + +**[Live Benchmark Results](https://mflowcode.github.io/MFC/benchmarks/)** \ No newline at end of file diff --git a/test-components.sh b/test-components.sh new file mode 100755 index 000000000..14fab2518 --- /dev/null +++ b/test-components.sh @@ -0,0 +1,48 @@ +#!/bin/bash +set -e + +echo "=== Testing Individual Components ===" + +# Test 1: Check if mfc.sh exists and is executable +echo "1. Testing mfc.sh..." +if [ -f "./mfc.sh" ]; then + chmod +x ./mfc.sh + echo "✓ mfc.sh found and made executable" +else + echo "✗ mfc.sh not found - creating mock for testing" + cat > ./mfc.sh << 'MOCK' +#!/bin/bash +echo "Mock benchmark running..." +mkdir -p bench +echo "name: test_benchmark" > bench/test.yaml +echo "time: 1.23" >> bench/test.yaml +echo "Mock benchmark completed" +MOCK + chmod +x ./mfc.sh +fi + +# Test 2: Run benchmark command +echo "2. Testing benchmark execution..." +./mfc.sh bench -o bench || echo "Benchmark failed, continuing with mock data" + +# Test 3: Check yq installation and YAML to JSON conversion +echo "3. Testing YAML to JSON conversion..." +if ! command -v yq &> /dev/null; then + echo "Installing yq..." + sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 + sudo chmod +x /usr/local/bin/yq +fi + +# Convert any YAML files found +find . -maxdepth 1 -name "*.yaml" -exec sh -c 'echo "Converting $1"; yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; + +# Test 4: Check JSON output format +echo "4. Validating JSON format..." +for json_file in *.json; do + if [ -f "$json_file" ]; then + echo "Checking $json_file:" + python3 -c "import json; json.load(open('$json_file')); print('✓ Valid JSON')" || echo "✗ Invalid JSON" + fi +done + +echo "=== Component Testing Complete ===" From 433caf26f59c2259e3b7b99115c93219105a3760 Mon Sep 17 00:00:00 2001 From: Malmahrouqi3 Date: Thu, 10 Jul 2025 00:46:19 +0000 Subject: [PATCH 12/14] Update continuous benchmarking results --- docs/documentation/cont-bench.md | 153 ++++++++++++++++++++++++++++++- 1 file changed, 148 insertions(+), 5 deletions(-) diff --git a/docs/documentation/cont-bench.md b/docs/documentation/cont-bench.md index e12bb3406..60399103d 100644 --- a/docs/documentation/cont-bench.md +++ b/docs/documentation/cont-bench.md @@ -1,11 +1,154 @@ -# Continuous Benchmarking +# Continuouscl Benchmarking Results -## Overview +Generated on: 2025-07-10 00:46:18 UTC -The continuous benchmarking framework automatically runs performance tests on select performance-critical approved pull request and main branch commit to track performance regressions and improvements over time. +## System Information +- Host: github-runner +- CPUs: 2 +- MHz per CPU: 2000 ## Benchmark Results -View historical performance data: +| Test Case | Metric | Time (seconds) | Time (nanoseconds) | +|-----------|--------|----------------|-------------------| +| 5eq_rk3_weno3_hllc | simulation_time | 553.746147 | 553746146600 | +| 5eq_rk3_weno3_hllc | grind_time | 0.000000 | 311 | +| hypo_hll | simulation_time | 1158.006229 | 1158006229400 | +| hypo_hll | grind_time | 0.000000 | 373 | +| ibm | simulation_time | 1560.666652 | 1560666652400 | +| ibm | grind_time | 0.000001 | 1329 | +| viscous_weno5_sgb_acoustic | simulation_time | 968.760392 | 968760392000 | +| viscous_weno5_sgb_acoustic | grind_time | 0.000001 | 1052 | -**[Live Benchmark Results](https://mflowcode.github.io/MFC/benchmarks/)** \ No newline at end of file +## Raw Data + +```json +{ + "context": { + "date": "2025-07-10T00:46:18.506114", + "host_name": "github-runner", + "executable": "mfc_benchmark", + "num_cpus": 2, + "mhz_per_cpu": 2000, + "cpu_scaling_enabled": false, + "caches": [] + }, + "benchmarks": [ + { + "name": "5eq_rk3_weno3_hllc/simulation_time", + "family_index": 0, + "per_family_instance_index": 0, + "run_name": "5eq_rk3_weno3_hllc/simulation_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 553746146600.0, + "cpu_time": 553746146600.0, + "time_unit": "ns" + }, + { + "name": "5eq_rk3_weno3_hllc/grind_time", + "family_index": 1, + "per_family_instance_index": 0, + "run_name": "5eq_rk3_weno3_hllc/grind_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 311.46590698, + "cpu_time": 311.46590698, + "time_unit": "ns" + }, + { + "name": "hypo_hll/simulation_time", + "family_index": 2, + "per_family_instance_index": 0, + "run_name": "hypo_hll/simulation_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 1158006229400.0, + "cpu_time": 1158006229400.0, + "time_unit": "ns" + }, + { + "name": "hypo_hll/grind_time", + "family_index": 3, + "per_family_instance_index": 0, + "run_name": "hypo_hll/grind_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 373.3648501, + "cpu_time": 373.3648501, + "time_unit": "ns" + }, + { + "name": "ibm/simulation_time", + "family_index": 4, + "per_family_instance_index": 0, + "run_name": "ibm/simulation_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 1560666652400.0, + "cpu_time": 1560666652400.0, + "time_unit": "ns" + }, + { + "name": "ibm/grind_time", + "family_index": 5, + "per_family_instance_index": 0, + "run_name": "ibm/grind_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 1329.41865639, + "cpu_time": 1329.41865639, + "time_unit": "ns" + }, + { + "name": "viscous_weno5_sgb_acoustic/simulation_time", + "family_index": 6, + "per_family_instance_index": 0, + "run_name": "viscous_weno5_sgb_acoustic/simulation_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 968760392000.0, + "cpu_time": 968760392000.0, + "time_unit": "ns" + }, + { + "name": "viscous_weno5_sgb_acoustic/grind_time", + "family_index": 7, + "per_family_instance_index": 0, + "run_name": "viscous_weno5_sgb_acoustic/grind_time", + "run_type": "iteration", + "repetitions": 1, + "repetition_index": 0, + "threads": 1, + "iterations": 1, + "real_time": 1051.98369313, + "cpu_time": 1051.98369313, + "time_unit": "ns" + } + ] +} +``` + +--- +*Last updated: 2025-07-10T00:46:18.566505* \ No newline at end of file From 052bb5d405f05e6b6296475d04b2d2fb5d0770b3 Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Fri, 11 Jul 2025 16:10:34 -0400 Subject: [PATCH 13/14] premature version of workflow file --- .github/workflows/bench.yml | 110 ----------- .github/workflows/bench/test.yaml | 2 - .github/workflows/cleanliness.yml | 127 ------------- .github/workflows/coverage.yml | 48 ----- .github/workflows/docs.yml | 76 -------- .github/workflows/formatting.yml | 19 -- .github/workflows/frontier/bench.sh | 16 -- .github/workflows/frontier/build.sh | 17 -- .github/workflows/frontier/submit-bench.sh | 54 ------ .github/workflows/frontier/submit.sh | 55 ------ .github/workflows/frontier/test.sh | 10 - .github/workflows/line-count.yml | 54 ------ .github/workflows/lint-source.yml | 55 ------ .github/workflows/lint-toolchain.yml | 17 -- .github/workflows/mfc.sh | 6 - .github/workflows/phoenix/bench.sh | 27 --- .github/workflows/phoenix/submit-bench.sh | 64 ------- .github/workflows/phoenix/submit.sh | 64 ------- .github/workflows/phoenix/test.sh | 21 --- .github/workflows/pmd.yml | 131 -------------- .github/workflows/spelling.yml | 17 -- .github/workflows/test-components.sh | 48 ----- .github/workflows/test-cont-bench.yml | 201 --------------------- .github/workflows/test.yml | 131 -------------- 24 files changed, 1370 deletions(-) delete mode 100644 .github/workflows/bench.yml delete mode 100644 .github/workflows/bench/test.yaml delete mode 100644 .github/workflows/cleanliness.yml delete mode 100644 .github/workflows/coverage.yml delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/formatting.yml delete mode 100644 .github/workflows/frontier/bench.sh delete mode 100644 .github/workflows/frontier/build.sh delete mode 100644 .github/workflows/frontier/submit-bench.sh delete mode 100644 .github/workflows/frontier/submit.sh delete mode 100644 .github/workflows/frontier/test.sh delete mode 100644 .github/workflows/line-count.yml delete mode 100644 .github/workflows/lint-source.yml delete mode 100644 .github/workflows/lint-toolchain.yml delete mode 100755 .github/workflows/mfc.sh delete mode 100644 .github/workflows/phoenix/bench.sh delete mode 100644 .github/workflows/phoenix/submit-bench.sh delete mode 100644 .github/workflows/phoenix/submit.sh delete mode 100644 .github/workflows/phoenix/test.sh delete mode 100644 .github/workflows/pmd.yml delete mode 100644 .github/workflows/spelling.yml delete mode 100755 .github/workflows/test-components.sh delete mode 100644 .github/workflows/test-cont-bench.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml deleted file mode 100644 index b5e89a2b5..000000000 --- a/.github/workflows/bench.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: 'Benchmark' - -on: - pull_request: - pull_request_review: - types: [submitted] - workflow_dispatch: - -jobs: - file-changes: - name: Detect File Changes - runs-on: 'ubuntu-latest' - outputs: - checkall: ${{ steps.changes.outputs.checkall }} - steps: - - name: Clone - uses: actions/checkout@v4 - - - name: Detect Changes - uses: dorny/paths-filter@v3 - id: changes - with: - filters: ".github/file-filter.yml" - - self: - name: "${{ matrix.name }} (${{ matrix.device }})" - if: ${{ github.repository == 'MFlowCode/MFC' && needs.file-changes.outputs.checkall == 'true' && ( - (github.event_name == 'pull_request_review' && github.event.review.state == 'approved') || - (github.event_name == 'pull_request' && github.event.pull_request.user.login == 'sbryngelson') - ) }} - needs: file-changes - strategy: - fail-fast: false - matrix: - include: - - cluster: phoenix - name: Georgia Tech | Phoenix (NVHPC) - group: phoenix - labels: gt - flag: p - device: cpu - build_script: "" - - cluster: phoenix - name: Georgia Tech | Phoenix (NVHPC) - group: phoenix - labels: gt - flag: p - device: gpu - build_script: "" - - cluster: frontier - name: Oak Ridge | Frontier (CCE) - group: phoenix - labels: frontier - flag: f - device: gpu - build_script: "bash .github/workflows/frontier/build.sh gpu bench" - runs-on: - group: ${{ matrix.group }} - labels: ${{ matrix.labels }} - timeout-minutes: 1400 - env: - ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16 - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true - steps: - - name: Clone - PR - uses: actions/checkout@v4 - with: - path: pr - - - name: Clone - Master - uses: actions/checkout@v4 - with: - repository: MFlowCode/MFC - ref: master - path: master - - - name: Setup & Build - if: matrix.build_script != '' - run: | - (cd pr && ${{ matrix.build_script }}) & - (cd master && ${{ matrix.build_script }}) & - wait %1 && wait %2 - - - name: Bench (Master v. PR) - run: | - (cd pr && bash .github/workflows/${{ matrix.cluster }}/submit-bench.sh .github/workflows/${{ matrix.cluster }}/bench.sh ${{ matrix.device }}) & - (cd master && bash .github/workflows/${{ matrix.cluster }}/submit-bench.sh .github/workflows/${{ matrix.cluster }}/bench.sh ${{ matrix.device }}) & - wait %1 && wait %2 - - - name: Generate & Post Comment - run: | - (cd pr && . ./mfc.sh load -c ${{ matrix.flag }} -m g) - (cd pr && ./mfc.sh bench_diff ../master/bench-${{ matrix.device }}.yaml ../pr/bench-${{ matrix.device }}.yaml) - - - name: Print Logs - if: always() - run: | - cat pr/bench-${{ matrix.device }}.* 2>/dev/null || true - cat master/bench-${{ matrix.device }}.* 2>/dev/null || true - - - name: Archive Logs - uses: actions/upload-artifact@v4 - if: always() - with: - name: ${{ matrix.cluster }}-${{ matrix.device }} - path: | - pr/bench-${{ matrix.device }}.* - pr/build/benchmarks/* - master/bench-${{ matrix.device }}.* - master/build/benchmarks/* diff --git a/.github/workflows/bench/test.yaml b/.github/workflows/bench/test.yaml deleted file mode 100644 index 1e82c56d4..000000000 --- a/.github/workflows/bench/test.yaml +++ /dev/null @@ -1,2 +0,0 @@ -name: test_benchmark -time: 1.23 diff --git a/.github/workflows/cleanliness.yml b/.github/workflows/cleanliness.yml deleted file mode 100644 index ec472dce9..000000000 --- a/.github/workflows/cleanliness.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: Cleanliness - -on: [push, pull_request, workflow_dispatch] - -jobs: - file-changes: - name: Detect File Changes - runs-on: 'ubuntu-latest' - outputs: - checkall: ${{ steps.changes.outputs.checkall }} - steps: - - name: Clone - uses: actions/checkout@v4 - - - name: Detect Changes - uses: dorny/paths-filter@v3 - id: changes - with: - filters: ".github/file-filter.yml" - - cleanliness: - name: Code Cleanliness Check - if: needs.file-changes.outputs.checkall == 'true' - needs: file-changes - runs-on: "ubuntu-latest" - env: - pr_everything: 0 - master_everything: 0 - steps: - - name: Clone - PR - uses: actions/checkout@v4 - with: - path: pr - - name: Clone - Master - uses: actions/checkout@v4 - with: - repository: MFlowCode/MFC - ref: master - path: master - - - name: Setup Ubuntu - run: | - sudo apt update -y - sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev - - - name: Build - run: | - (cd pr && /bin/bash mfc.sh build -j $(nproc) --debug 2> ../pr.txt) - (cd master && /bin/bash mfc.sh build -j $(nproc) --debug 2> ../master.txt) - sed -i '/\/pr\//d' pr.txt - sed -i '/\/master\//d' master.txt - - - name: Unused Variables Diff - continue-on-error: true - run: | - grep -F 'Wunused-variable' master.txt > mUnused.txt - grep -F 'Wunused-variable' pr.txt > prUnused.txt - diff prUnused.txt mUnused.txt - - - name: Unused Dummy Arguments Diff - continue-on-error: true - run: | - grep -F 'Wunused-dummy-argument' pr.txt > prDummy.txt - grep -F 'Wunused-dummy-argument' master.txt > mDummy.txt - diff prDummy.txt mDummy.txt - - - name: Unused Value Diff - continue-on-error: true - run: | - grep -F 'Wunused-value' pr.txt > prUnused_val.txt - grep -F 'Wunused-value' master.txt > mUnused_val.txt - diff prUnused_val.txt mUnused_val.txt - - - name: Maybe Uninitialized Variables Diff - continue-on-error: true - run: | - grep -F 'Wmaybe-uninitialized' pr.txt > prMaybe.txt - grep -F 'Wmaybe-uninitialized' master.txt > mMaybe.txt - diff prMaybe.txt mMaybe.txt - - - - name: Everything Diff - continue-on-error: true - run: | - grep '\-W' pr.txt > pr_every.txt - grep '\-W' master.txt > m_every.txt - diff pr_every.txt m_every.txt - - - name: List of Warnings - run: | - cat pr_every.txt - - - - name: Summary - continue-on-error: true - run: | - pr_variable=$(grep -c -F 'Wunused-variable' pr.txt) - pr_argument=$(grep -c -F 'Wunused-dummy-argument' pr.txt) - pr_value=$(grep -c -F 'Wunused-value' pr.txt) - pr_uninit=$(grep -c -F 'Wmaybe-uninitialized' pr.txt) - pr_everything=$(grep -c '\-W' pr.txt) - - master_variable=$(grep -c -F 'Wunused-variable' master.txt) - master_argument=$(grep -c -F 'Wunused-dummy-argument' master.txt) - master_value=$(grep -c -F 'Wunused-value' master.txt) - master_uninit=$(grep -c -F 'Wmaybe-uninitialized' master.txt) - master_everything=$(grep -c '\-W' master.txt ) - - echo "pr_everything=$pr_everything" >> $GITHUB_ENV - echo "master_everything=$master_everything" >> $GITHUB_ENV - - echo "Difference is how many warnings were added or removed from master to PR." - echo "Negative numbers are better since you are removing warnings." - echo " " - echo "Unused Variable Count: $pr_variable, Difference: $((pr_variable - master_variable))" - echo "Unused Dummy Argument: $pr_argument, Difference: $((pr_argument - master_argument))" - echo "Unused Value: $pr_value, Difference: $((pr_value - master_value))" - echo "Maybe Uninitialized: $pr_uninit, Difference: $((pr_uninit - master_uninit))" - echo "Everything: $pr_everything, Difference: $((pr_everything - master_everything))" - - - - name: Check Differences - if: env.pr_everything > env.master_everything - run: | - echo "Difference between warning count in PR is greater than in master." - - diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 7487d8e55..000000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Coverage Check - -on: [push, pull_request, workflow_dispatch] - -jobs: - file-changes: - name: Detect File Changes - runs-on: 'ubuntu-latest' - outputs: - checkall: ${{ steps.changes.outputs.checkall }} - steps: - - name: Clone - uses: actions/checkout@v4 - - - name: Detect Changes - uses: dorny/paths-filter@v3 - id: changes - with: - filters: ".github/file-filter.yml" - - run: - name: Coverage Test on CodeCov - if: needs.file-changes.outputs.checkall == 'true' - needs: file-changes - runs-on: "ubuntu-latest" - steps: - - name: Checkouts - uses: actions/checkout@v4 - - - name: Setup Ubuntu - run: | - sudo apt update -y - sudo apt install -y tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev - - - name: Build - run: /bin/bash mfc.sh build -j $(nproc) --gcov - - - name: Test - run: /bin/bash mfc.sh test -a -j $(nproc) - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: false - verbose: true - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index d161d8034..000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Documentation - -on: - schedule: - - cron: '0 0 * * *' # This runs every day at midnight UTC - workflow_dispatch: - push: - pull_request: - -jobs: - docs: - name: Build & Publish - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - # We build doxygen from source because of - # https://github.com/doxygen/doxygen/issues/9016 - - name: Build Doxygen - run: | - sudo apt update -y - sudo apt install -y cmake ninja-build graphviz graphviz - git clone https://github.com/doxygen/doxygen.git ../doxygen - cd ../doxygen - git checkout 26b5403 - cd - - cmake -S ../doxygen -B ../doxygen/build -G Ninja - sudo ninja -C ../doxygen/build install - - - name: Build Documentation - run: | - pip3 install fypp - cmake -S . -B build -G Ninja --install-prefix=$(pwd)/build/install -D MFC_DOCUMENTATION=ON - ninja -C build install - - # From here https://github.com/cicirello/generate-sitemap - - name: Generate the sitemap - id: sitemap - uses: cicirello/generate-sitemap@v1 - with: - base-url-path: https://mflowcode.github.io/ - path-to-root: build/install/docs/mfc - include-pdf: false - sitemap-format: txt - - - name: Output stats - run: | - echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}" - echo "url-count = ${{ steps.sitemap.outputs.url-count }}" - echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}" - - - name: Linkcheck - Lychee - uses: lycheeverse/lychee-action@v2 - with: - args: -c .lychee.toml build/install/docs/mfc/ - fail: false - - - name: Publish Documentation - if: github.repository == 'MFlowCode/MFC' && github.ref == 'refs/heads/master' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' ) - run: | - set +e - git ls-remote "${{ secrets.DOC_PUSH_URL }}" -q - if [ "$?" -ne "0" ]; then exit 0; fi - set -e - git config --global user.name 'MFC Action' - git config --global user.email '<>' - git clone "${{ secrets.DOC_PUSH_URL }}" ../www - rm -rf ../www/* - mv build/install/docs/mfc/* ../www/ - git -C ../www add -A - git -C ../www commit -m "Docs @ ${GITHUB_SHA::7}" || true - git -C ../www push - -# DOC_PUSH_URL should be of the format: -# --> https://:@github.com// diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml deleted file mode 100644 index 16043daa9..000000000 --- a/.github/workflows/formatting.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Pretty - -on: [push, pull_request, workflow_dispatch] - -jobs: - docs: - name: Formatting - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: MFC Python setup - run: ./mfc.sh init - - - name: Check formatting - run: | - ./mfc.sh format -j $(nproc) - git diff --exit-code diff --git a/.github/workflows/frontier/bench.sh b/.github/workflows/frontier/bench.sh deleted file mode 100644 index 31a514d45..000000000 --- a/.github/workflows/frontier/bench.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -n_ranks=12 - -if [ "$job_device" = "gpu" ]; then - gpus=$(rocm-smi --showid | awk '{print $1}' | grep -Eo '[0-9]+' | uniq | tr '\n' ' ') - n_ranks=$(echo "$gpus" | wc -w) # number of GPUs on node - gpu_ids=$(echo "$gpus" | tr ' ' '\n' | tr '\n' ' ' | sed 's/ $//') # GPU IDs from rocm-smi - device_opts="--gpu -g $gpu_ids" -fi - -if [ "$job_device" = "gpu" ]; then - ./mfc.sh bench --mem 12 -j $n_ranks -o "$job_slug.yaml" -- -c frontier $device_opts -n $n_ranks -else - ./mfc.sh bench --mem 1 -j $(nproc) -o "$job_slug.yaml" -- -c frontier $device_opts -n $n_ranks -fi diff --git a/.github/workflows/frontier/build.sh b/.github/workflows/frontier/build.sh deleted file mode 100644 index c2e189342..000000000 --- a/.github/workflows/frontier/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -build_opts="" -if [ "$1" = "gpu" ]; then - build_opts="--gpu" -fi - -. ./mfc.sh load -c f -m g - -if [ "$2" == "bench" ]; then - for dir in benchmarks/*/; do - dirname=$(basename "$dir") - ./mfc.sh run "$dir/case.py" --case-optimization -j 8 --dry-run $build_opts - done -else - ./mfc.sh test --dry-run -j 8 $build_opts -fi diff --git a/.github/workflows/frontier/submit-bench.sh b/.github/workflows/frontier/submit-bench.sh deleted file mode 100644 index 4e498a609..000000000 --- a/.github/workflows/frontier/submit-bench.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -set -e - -usage() { - echo "Usage: $0 [script.sh] [cpu|gpu]" -} - -if [ ! -z "$1" ]; then - sbatch_script_contents=`cat $1` -else - usage - exit 1 -fi - -if [ "$2" = "cpu" ]; then - sbatch_device_opts="\ -#SBATCH -n 32 # Number of cores required" -elif [ "$2" = "gpu" ]; then - sbatch_device_opts="\ -#SBATCH -n 8 # Number of cores required" -else - usage; exit 1 -fi - - -job_slug="`basename "$1" | sed 's/\.sh$//' | sed 's/[^a-zA-Z0-9]/-/g'`-$2" - -sbatch < tmp.txt - ./mfc.sh count_diff - diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml deleted file mode 100644 index 68c07d6c1..000000000 --- a/.github/workflows/lint-source.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Lint Source - -on: [push, pull_request, workflow_dispatch] - -jobs: - file-changes: - name: Detect File Changes - runs-on: 'ubuntu-latest' - outputs: - checkall: ${{ steps.changes.outputs.checkall }} - steps: - - name: Clone - uses: actions/checkout@v4 - - - name: Detect Changes - uses: dorny/paths-filter@v3 - id: changes - with: - filters: ".github/file-filter.yml" - - lint-source: - name: Lint Source - runs-on: 'ubuntu-latest' - - steps: - - uses: actions/checkout@v4 - - - name: Initialize MFC - run: ./mfc.sh init - - - name: Lint the full source - run: | - source build/venv/bin/activate - find ./src -type f -not -name '*nvtx*' -exec sh -c 'fortitude check "$1" | grep -v E001' _ {} \; - find ./src -type f -not -name '*nvtx*' -exec sh -c 'fortitude check "$1" | grep -v E001' _ {} \; | wc -l | xargs -I{} sh -c '[ {} -gt 0 ] && exit 1 || exit 0' - - - name: No double precision intrinsics - run: | - ! grep -iR 'double_precision\|dsqrt\|dexp\|dlog\|dble\|dabs\|double\ precision\|real(8)\|real(4)\|dprod\|dmin\|dmax\|dfloat\|dreal\|dcos\|dsin\|dtan\|dsign\|dtanh\|dsinh\|dcosh\|d0' --exclude-dir=syscheck --exclude="*nvtx*" --exclude="*precision_select*" ./src/* - - - name: Looking for junk code - run: | - ! grep -iR -e '\.\.\.' -e '\-\-\-' -e '===' ./src/* - - - name: Looking for false integers - run: | - ! grep -onRP '(? bench/test.yaml -echo "time: 1.23" >> bench/test.yaml -echo "Mock benchmark completed" diff --git a/.github/workflows/phoenix/bench.sh b/.github/workflows/phoenix/bench.sh deleted file mode 100644 index f58ef4472..000000000 --- a/.github/workflows/phoenix/bench.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -n_ranks=12 - -if [ "$job_device" = "gpu" ]; then - n_ranks=$(nvidia-smi -L | wc -l) # number of GPUs on node - gpu_ids=$(seq -s ' ' 0 $(($n_ranks-1))) # 0,1,2,...,gpu_count-1 - device_opts="--gpu -g $gpu_ids" -fi - -tmpbuild=/storage/scratch1/6/sbryngelson3/mytmp_build -currentdir=$tmpbuild/run-$(( RANDOM % 900 )) -mkdir -p $tmpbuild -mkdir -p $currentdir - -export TMPDIR=$currentdir - -if [ "$job_device" = "gpu" ]; then - ./mfc.sh bench --mem 12 -j $(nproc) -o "$job_slug.yaml" -- -c phoenix-bench $device_opts -n $n_ranks -else - ./mfc.sh bench --mem 1 -j $(nproc) -o "$job_slug.yaml" -- -c phoenix-bench $device_opts -n $n_ranks -fi - -sleep 10 -rm -rf "$currentdir" || true - -unset TMPDIR diff --git a/.github/workflows/phoenix/submit-bench.sh b/.github/workflows/phoenix/submit-bench.sh deleted file mode 100644 index e8b6dd348..000000000 --- a/.github/workflows/phoenix/submit-bench.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -set -e - -usage() { - echo "Usage: $0 [script.sh] [cpu|gpu]" -} - -if [ ! -z "$1" ]; then - sbatch_script_contents=`cat $1` -else - usage - exit 1 -fi - -sbatch_cpu_opts="\ -#SBATCH -p cpu-small # partition -#SBATCH --ntasks-per-node=24 # Number of cores per node required -#SBATCH --mem-per-cpu=2G # Memory per core\ -" - -sbatch_gpu_opts="\ -#SBATCH -CL40S -#SBATCH --ntasks-per-node=4 # Number of cores per node required -#SBATCH -G2\ -" - -if [ "$2" = "cpu" ]; then - sbatch_device_opts="$sbatch_cpu_opts" -elif [ "$2" = "gpu" ]; then - sbatch_device_opts="$sbatch_gpu_opts" -else - usage - exit 1 -fi - -job_slug="`basename "$1" | sed 's/\.sh$//' | sed 's/[^a-zA-Z0-9]/-/g'`-$2" - -sbatch </g - s/\[[[:space:]]*/=[[:space:]]*/>/g - s/[[:space:]]*<[[:space:]]*/[[:space:]]*/>/g - s/[[:space:]]*==[[:space:]]*/==/g - - # Remove full-line comments - /^\s*!/d - /^[cC*dD]/d - /^[ \t]*[cC*dD]/d - /^[[:space:]]*$/d - - # Remove end-of-line comments, preserving quoted strings - s/([^"'\''\\]*("[^"]*")?('\''[^'\'']*'\''?)?[^"'\''\\]*)[!].*$/\1/ - ' "$file" > "$TMP_FILE" - - if cmp -s "$file" "$TMP_FILE"; then - rm "$TMP_FILE" - else - # Overwrite the original file with the processed content - mv "$TMP_FILE" "$file" - fi - done - - "${PMD_HOME}/bin/pmd" cpd \ - --dir src \ - --language fortran \ - --minimum-tokens=20 \ - --no-fail-on-violation \ - --no-fail-on-error diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml deleted file mode 100644 index accdc9628..000000000 --- a/.github/workflows/spelling.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Spell Check - -on: [push, pull_request, workflow_dispatch] - -jobs: - run: - name: Spell Check - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: MFC Python Setup - run: ./mfc.sh init - - - name: Spell Check - run: ./mfc.sh spelling diff --git a/.github/workflows/test-components.sh b/.github/workflows/test-components.sh deleted file mode 100755 index 14fab2518..000000000 --- a/.github/workflows/test-components.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -set -e - -echo "=== Testing Individual Components ===" - -# Test 1: Check if mfc.sh exists and is executable -echo "1. Testing mfc.sh..." -if [ -f "./mfc.sh" ]; then - chmod +x ./mfc.sh - echo "✓ mfc.sh found and made executable" -else - echo "✗ mfc.sh not found - creating mock for testing" - cat > ./mfc.sh << 'MOCK' -#!/bin/bash -echo "Mock benchmark running..." -mkdir -p bench -echo "name: test_benchmark" > bench/test.yaml -echo "time: 1.23" >> bench/test.yaml -echo "Mock benchmark completed" -MOCK - chmod +x ./mfc.sh -fi - -# Test 2: Run benchmark command -echo "2. Testing benchmark execution..." -./mfc.sh bench -o bench || echo "Benchmark failed, continuing with mock data" - -# Test 3: Check yq installation and YAML to JSON conversion -echo "3. Testing YAML to JSON conversion..." -if ! command -v yq &> /dev/null; then - echo "Installing yq..." - sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 - sudo chmod +x /usr/local/bin/yq -fi - -# Convert any YAML files found -find . -maxdepth 1 -name "*.yaml" -exec sh -c 'echo "Converting $1"; yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; - -# Test 4: Check JSON output format -echo "4. Validating JSON format..." -for json_file in *.json; do - if [ -f "$json_file" ]; then - echo "Checking $json_file:" - python3 -c "import json; json.load(open('$json_file')); print('✓ Valid JSON')" || echo "✗ Invalid JSON" - fi -done - -echo "=== Component Testing Complete ===" diff --git a/.github/workflows/test-cont-bench.yml b/.github/workflows/test-cont-bench.yml deleted file mode 100644 index 3af2985bc..000000000 --- a/.github/workflows/test-cont-bench.yml +++ /dev/null @@ -1,201 +0,0 @@ -name: Continuous Benchmarking - -on: [push, pull_request, workflow_dispatch] - -permissions: - contents: write - deployments: write - pages: write - id-token: write - -jobs: - self: - name: "Store benchmark result" - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Convert MFC to Google Benchmark Format - run: | - python3 << 'EOF' - import json - from datetime import datetime - - # Read the MFC benchmark data - with open('bench.json', 'r') as f: - mfc_data = json.load(f) - - # Convert to Google Benchmark format - benchmarks = [] - - for case_name, case_data in mfc_data['cases'].items(): - output_summary = case_data['output_summary'] - - # Simulation execution time - if 'simulation' in output_summary and 'exec' in output_summary['simulation']: - benchmarks.append({ - "name": f"{case_name}/simulation_time", - "family_index": len(benchmarks), - "per_family_instance_index": 0, - "run_name": f"{case_name}/simulation_time", - "run_type": "iteration", - "repetitions": 1, - "repetition_index": 0, - "threads": 1, - "iterations": 1, - "real_time": output_summary['simulation']['exec'] * 1e9, - "cpu_time": output_summary['simulation']['exec'] * 1e9, - "time_unit": "ns" - }) - - # Simulation grind time - if 'simulation' in output_summary and 'grind' in output_summary['simulation']: - benchmarks.append({ - "name": f"{case_name}/grind_time", - "family_index": len(benchmarks), - "per_family_instance_index": 0, - "run_name": f"{case_name}/grind_time", - "run_type": "iteration", - "repetitions": 1, - "repetition_index": 0, - "threads": 1, - "iterations": 1, - "real_time": output_summary['simulation']['grind'], - "cpu_time": output_summary['simulation']['grind'], - "time_unit": "ns" - }) - - # Create Google Benchmark format - google_benchmark_data = { - "context": { - "date": datetime.now().isoformat(), - "host_name": "github-runner", - "executable": "mfc_benchmark", - "num_cpus": 2, - "mhz_per_cpu": 2000, - "cpu_scaling_enabled": False, - "caches": [] - }, - "benchmarks": benchmarks - } - - # Write the converted data - with open('bench-google.json', 'w') as f: - json.dump(google_benchmark_data, f, indent=2) - - print(f"✓ Converted {len(benchmarks)} benchmark measurements") - EOF - - - name: Create report generator script - run: | - cat > generate_report.py << 'SCRIPT' - import json - import os - from datetime import datetime - - def generate_markdown_report(): - # Read benchmark data - with open('bench-google.json', 'r') as f: - data = json.load(f) - - # Create directory - os.makedirs('docs/documentation', exist_ok=True) - - # Start building content - lines = [] - lines.append("# Continuouscl Benchmarking Results") - lines.append("") - lines.append(f"Generated on: {datetime.now().strftime('%Y-%m-%d %H:%M:%S UTC')}") - lines.append("") - lines.append("## System Information") - lines.append(f"- Host: {data['context']['host_name']}") - lines.append(f"- CPUs: {data['context']['num_cpus']}") - lines.append(f"- MHz per CPU: {data['context']['mhz_per_cpu']}") - lines.append("") - lines.append("## Benchmark Results") - lines.append("") - lines.append("| Test Case | Metric | Time (seconds) | Time (nanoseconds) |") - lines.append("|-----------|--------|----------------|-------------------|") - - # Add benchmark data - for benchmark in data['benchmarks']: - name_parts = benchmark['name'].split('/') - case_name = name_parts[0] - metric_name = name_parts[1] if len(name_parts) > 1 else 'unknown' - time_seconds = benchmark['real_time'] / 1e9 - time_ns = benchmark['real_time'] - lines.append(f"| {case_name} | {metric_name} | {time_seconds:.6f} | {time_ns:.0f} |") - - lines.append("") - lines.append("## Raw Data") - lines.append("") - lines.append("```json") - lines.append(json.dumps(data, indent=2)) - lines.append("```") - lines.append("") - lines.append("---") - lines.append(f"*Last updated: {datetime.now().isoformat()}*") - - # Write file - with open('docs/documentation/cont-bench.md', 'w') as f: - f.write('\n'.join(lines)) - - print("✓ Generated Markdown report at docs/documentation/cont-bench.md") - - if __name__ == "__main__": - generate_markdown_report() - SCRIPT - - - name: Generate Markdown Report - run: python3 generate_report.py - - - name: Commit and Push Results - run: | - git config --local user.email "mohdsaid497566@gmail.com" - git config --local user.name "Malmahrouqi3" - - # Fetch latest changes from the remote branch - git fetch origin cont-bench || true - - # Stage the generated file - git add docs/documentation/cont-bench.md - - # Commit changes to have a clean working tree - git commit -m "Update continuous benchmarking results" || true - - # Check if we're behind the remote branch - if git rev-list HEAD..origin/cont-bench --count | grep -q "^[1-9]"; then - echo "Branch is behind remote, resolving..." - - # Save our changes to a temporary branch - git branch temp-benchmark-updates - - # Get up to date with the remote branch - git reset --hard origin/cont-bench - - # Regenerate the report with the latest code - python3 generate_report.py - - # Add the newly generated report - git add docs/documentation/cont-bench.md - - # Commit the changes - git commit -m "Update continuous benchmarking results" || true - fi - - # Push the changes, forcing if necessary - git push origin HEAD:cont-bench || git push -f origin HEAD:cont-bench - - - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@v1 - with: - name: C++ Benchmark - tool: 'googlecpp' - output-file-path: bench-google.json - github-token: ${{ secrets.GITHUB_TOKEN }} - auto-push: false - alert-threshold: '200%' - comment-on-alert: true - fail-on-alert: true - alert-comment-cc-users: '@Malmahrouqi' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 2948b1133..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: 'Test Suite' - -on: [push, pull_request, workflow_dispatch] - -jobs: - file-changes: - name: Detect File Changes - runs-on: 'ubuntu-latest' - outputs: - checkall: ${{ steps.changes.outputs.checkall }} - steps: - - name: Clone - uses: actions/checkout@v4 - - - name: Detect Changes - uses: dorny/paths-filter@v3 - id: changes - with: - filters: ".github/file-filter.yml" - - github: - name: Github - if: needs.file-changes.outputs.checkall == 'true' - needs: file-changes - strategy: - matrix: - os: ['ubuntu', 'macos'] - mpi: ['mpi'] - precision: [''] - debug: ['debug', 'no-debug'] - intel: [true, false] - exclude: - - os: macos - intel: true - - include: - - os: ubuntu - mpi: no-mpi - precision: single - debug: no-debug - intel: false - - fail-fast: false - continue-on-error: true - runs-on: ${{ matrix.os }}-latest - - steps: - - name: Clone - uses: actions/checkout@v4 - - - name: Setup MacOS - if: matrix.os == 'macos' - run: | - brew update - brew upgrade - brew install coreutils python cmake fftw hdf5 gcc@15 boost open-mpi - echo "FC=gfortran-15" >> $GITHUB_ENV - echo "BOOST_INCLUDE=/opt/homebrew/include/" >> $GITHUB_ENV - - - name: Setup Ubuntu - if: matrix.os == 'ubuntu' && matrix.intel == false - run: | - sudo apt update -y - sudo apt install -y cmake gcc g++ python3 python3-dev hdf5-tools \ - libfftw3-dev libhdf5-dev openmpi-bin libopenmpi-dev - - - name: Setup Ubuntu (Intel) - if: matrix.os == 'ubuntu' && matrix.intel == true - run: | - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" - sudo apt-get update - sudo apt-get install -y intel-oneapi-compiler-fortran intel-oneapi-mpi intel-oneapi-mpi-devel - source /opt/intel/oneapi/setvars.sh - printenv >> $GITHUB_ENV - - - - name: Build - run: | - /bin/bash mfc.sh test --dry-run -j $(nproc) --${{ matrix.debug }} --${{ matrix.mpi }} --${{ matrix.precision }} - - - name: Test - run: | - /bin/bash mfc.sh test --max-attempts 3 -j $(nproc) $OPT1 $OPT2 - env: - OPT1: ${{ matrix.mpi == 'mpi' && '--test-all' || '' }} - OPT2: ${{ matrix.debug == 'debug' && '-% 20' || '' }} - - self: - name: Self Hosted - if: github.repository == 'MFlowCode/MFC' && needs.file-changes.outputs.checkall == 'true' - needs: file-changes - continue-on-error: false - timeout-minutes: 1400 - strategy: - matrix: - device: ['cpu', 'gpu'] - lbl: ['gt', 'frontier'] - runs-on: - group: phoenix - labels: ${{ matrix.lbl }} - env: - ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16 - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true - steps: - - name: Clone - uses: actions/checkout@v4 - - - name: Build & Test - if: matrix.lbl == 'gt' - run: bash .github/workflows/phoenix/submit.sh .github/workflows/phoenix/test.sh ${{ matrix.device }} - - - name: Build - if: matrix.lbl == 'frontier' - run: bash .github/workflows/frontier/build.sh ${{ matrix.device }} - - - name: Test - if: matrix.lbl == 'frontier' - run: bash .github/workflows/frontier/submit.sh .github/workflows/frontier/test.sh ${{matrix.device}} - - - name: Print Logs - if: always() - run: cat test-${{ matrix.device }}.out - - - name: Archive Logs - uses: actions/upload-artifact@v4 - if: always() - with: - name: logs-${{ strategy.job-index }}-${{ matrix.device }} - path: test-${{ matrix.device }}.out From 4a95eb10b9c5f0dae41b7fc25e1a8ab2c0f25174 Mon Sep 17 00:00:00 2001 From: malmahrouqi3 Date: Fri, 11 Jul 2025 16:54:04 -0400 Subject: [PATCH 14/14] removed junk --- bench | 153 ---------- bench-google.json | 69 ----- bench.json | 195 ------------- bench.yaml | 153 ---------- benchmarks/5eq_rk3_weno3_hllc/case.py | 276 ------------------ benchmarks/hypo_hll/case.py | 121 -------- benchmarks/ibm/case.py | 115 -------- benchmarks/viscous_weno5_sgb_acoustic/case.py | 225 -------------- test-components.sh | 48 --- 9 files changed, 1355 deletions(-) delete mode 100644 bench delete mode 100644 bench-google.json delete mode 100644 bench.json delete mode 100644 bench.yaml delete mode 100644 benchmarks/5eq_rk3_weno3_hllc/case.py delete mode 100644 benchmarks/hypo_hll/case.py delete mode 100644 benchmarks/ibm/case.py delete mode 100644 benchmarks/viscous_weno5_sgb_acoustic/case.py delete mode 100755 test-components.sh diff --git a/bench b/bench deleted file mode 100644 index 40207a9f8..000000000 --- a/bench +++ /dev/null @@ -1,153 +0,0 @@ -cases: - 5eq_rk3_weno3_hllc: - description: - args: [] - path: /home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py - slug: 5eq_rk3_weno3_hllc - output_summary: - invocation: - - run - - /home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py - - --case-optimization - - --targets - - pre_process - - simulation - - post_process - - --output-summary - - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/5eq_rk3_weno3_hllc.yaml - - -- - - --gbpp - - '1' - lock: - debug: false - gcov: false - gpu: false - mpi: true - single: false - unified: false - post_process: - exec: 2.6731925 - pre_process: - exec: 0.945057 - simulation: - exec: 553.7461466 - grind: 311.46590698 - syscheck: - exec: 0.5911245 - hypo_hll: - description: - args: [] - path: /home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py - slug: hypo_hll - output_summary: - invocation: - - run - - /home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py - - --case-optimization - - --targets - - pre_process - - simulation - - post_process - - --output-summary - - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/hypo_hll.yaml - - -- - - --gbpp - - '1' - lock: - debug: false - gcov: false - gpu: false - mpi: true - single: false - unified: false - post_process: - exec: 4.6181798 - pre_process: - exec: 28.0626009 - simulation: - exec: 1158.0062294 - grind: 373.3648501 - syscheck: - exec: 0.5746224 - ibm: - description: - args: [] - path: /home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py - slug: ibm - output_summary: - invocation: - - run - - /home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py - - --case-optimization - - --targets - - pre_process - - simulation - - post_process - - --output-summary - - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/ibm.yaml - - -- - - --gbpp - - '1' - lock: - debug: false - gcov: false - gpu: false - mpi: true - single: false - unified: false - post_process: - exec: 2.7696633 - pre_process: - exec: 0.6595922 - simulation: - exec: 1560.6666524 - grind: 1329.41865639 - syscheck: - exec: 0.350557 - viscous_weno5_sgb_acoustic: - description: - args: [] - path: /home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py - slug: viscous_weno5_sgb_acoustic - output_summary: - invocation: - - run - - /home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py - - --case-optimization - - --targets - - pre_process - - simulation - - post_process - - --output-summary - - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/viscous_weno5_sgb_acoustic.yaml - - -- - - --gbpp - - '1' - lock: - debug: false - gcov: false - gpu: false - mpi: true - single: false - unified: false - post_process: - exec: 1.7293213 - pre_process: - exec: 0.7582608 - simulation: - exec: 968.760392 - grind: 1051.98369313 - syscheck: - exec: 0.6131606 -metadata: - invocation: - - bench - - -o - - bench - lock: - debug: false - gcov: false - gpu: false - mpi: true - single: false - unified: false diff --git a/bench-google.json b/bench-google.json deleted file mode 100644 index 258ff5933..000000000 --- a/bench-google.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "context": { - "date": "2025-07-09T16:51:13.791064", - "host_name": "test", - "executable": "mfc_benchmark", - "num_cpus": 2, - "mhz_per_cpu": 2000, - "cpu_scaling_enabled": false, - "caches": [] - }, - "benchmarks": [ - { - "name": "5eq_rk3_weno3_hllc/simulation_time", - "family_index": 0, - "per_family_instance_index": 0, - "run_name": "5eq_rk3_weno3_hllc/simulation_time", - "run_type": "iteration", - "repetitions": 1, - "repetition_index": 0, - "threads": 1, - "iterations": 1, - "real_time": 553746146600.0, - "cpu_time": 553746146600.0, - "time_unit": "ns" - }, - { - "name": "hypo_hll/simulation_time", - "family_index": 1, - "per_family_instance_index": 0, - "run_name": "hypo_hll/simulation_time", - "run_type": "iteration", - "repetitions": 1, - "repetition_index": 0, - "threads": 1, - "iterations": 1, - "real_time": 1158006229400.0, - "cpu_time": 1158006229400.0, - "time_unit": "ns" - }, - { - "name": "ibm/simulation_time", - "family_index": 2, - "per_family_instance_index": 0, - "run_name": "ibm/simulation_time", - "run_type": "iteration", - "repetitions": 1, - "repetition_index": 0, - "threads": 1, - "iterations": 1, - "real_time": 1560666652400.0, - "cpu_time": 1560666652400.0, - "time_unit": "ns" - }, - { - "name": "viscous_weno5_sgb_acoustic/simulation_time", - "family_index": 3, - "per_family_instance_index": 0, - "run_name": "viscous_weno5_sgb_acoustic/simulation_time", - "run_type": "iteration", - "repetitions": 1, - "repetition_index": 0, - "threads": 1, - "iterations": 1, - "real_time": 968760392000.0, - "cpu_time": 968760392000.0, - "time_unit": "ns" - } - ] -} \ No newline at end of file diff --git a/bench.json b/bench.json deleted file mode 100644 index 51457d2dc..000000000 --- a/bench.json +++ /dev/null @@ -1,195 +0,0 @@ -{ - "cases": { - "5eq_rk3_weno3_hllc": { - "description": { - "args": [], - "path": "/home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py", - "slug": "5eq_rk3_weno3_hllc" - }, - "output_summary": { - "invocation": [ - "run", - "/home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py", - "--case-optimization", - "--targets", - "pre_process", - "simulation", - "post_process", - "--output-summary", - "/home/mohammed/Desktop/cont-bench/build/benchmarks/6462/5eq_rk3_weno3_hllc.yaml", - "--", - "--gbpp", - "1" - ], - "lock": { - "debug": false, - "gcov": false, - "gpu": false, - "mpi": true, - "single": false, - "unified": false - }, - "post_process": { - "exec": 2.6731925 - }, - "pre_process": { - "exec": 0.945057 - }, - "simulation": { - "exec": 553.7461466, - "grind": 311.46590698 - }, - "syscheck": { - "exec": 0.5911245 - } - } - }, - "hypo_hll": { - "description": { - "args": [], - "path": "/home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py", - "slug": "hypo_hll" - }, - "output_summary": { - "invocation": [ - "run", - "/home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py", - "--case-optimization", - "--targets", - "pre_process", - "simulation", - "post_process", - "--output-summary", - "/home/mohammed/Desktop/cont-bench/build/benchmarks/6462/hypo_hll.yaml", - "--", - "--gbpp", - "1" - ], - "lock": { - "debug": false, - "gcov": false, - "gpu": false, - "mpi": true, - "single": false, - "unified": false - }, - "post_process": { - "exec": 4.6181798 - }, - "pre_process": { - "exec": 28.0626009 - }, - "simulation": { - "exec": 1158.0062294, - "grind": 373.3648501 - }, - "syscheck": { - "exec": 0.5746224 - } - } - }, - "ibm": { - "description": { - "args": [], - "path": "/home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py", - "slug": "ibm" - }, - "output_summary": { - "invocation": [ - "run", - "/home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py", - "--case-optimization", - "--targets", - "pre_process", - "simulation", - "post_process", - "--output-summary", - "/home/mohammed/Desktop/cont-bench/build/benchmarks/6462/ibm.yaml", - "--", - "--gbpp", - "1" - ], - "lock": { - "debug": false, - "gcov": false, - "gpu": false, - "mpi": true, - "single": false, - "unified": false - }, - "post_process": { - "exec": 2.7696633 - }, - "pre_process": { - "exec": 0.6595922 - }, - "simulation": { - "exec": 1560.6666524, - "grind": 1329.41865639 - }, - "syscheck": { - "exec": 0.350557 - } - } - }, - "viscous_weno5_sgb_acoustic": { - "description": { - "args": [], - "path": "/home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py", - "slug": "viscous_weno5_sgb_acoustic" - }, - "output_summary": { - "invocation": [ - "run", - "/home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py", - "--case-optimization", - "--targets", - "pre_process", - "simulation", - "post_process", - "--output-summary", - "/home/mohammed/Desktop/cont-bench/build/benchmarks/6462/viscous_weno5_sgb_acoustic.yaml", - "--", - "--gbpp", - "1" - ], - "lock": { - "debug": false, - "gcov": false, - "gpu": false, - "mpi": true, - "single": false, - "unified": false - }, - "post_process": { - "exec": 1.7293213 - }, - "pre_process": { - "exec": 0.7582608 - }, - "simulation": { - "exec": 968.760392, - "grind": 1051.98369313 - }, - "syscheck": { - "exec": 0.6131606 - } - } - } - }, - "metadata": { - "invocation": [ - "bench", - "-o", - "bench" - ], - "lock": { - "debug": false, - "gcov": false, - "gpu": false, - "mpi": true, - "single": false, - "unified": false - } - } -} diff --git a/bench.yaml b/bench.yaml deleted file mode 100644 index 40207a9f8..000000000 --- a/bench.yaml +++ /dev/null @@ -1,153 +0,0 @@ -cases: - 5eq_rk3_weno3_hllc: - description: - args: [] - path: /home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py - slug: 5eq_rk3_weno3_hllc - output_summary: - invocation: - - run - - /home/mohammed/Desktop/cont-bench/benchmarks/5eq_rk3_weno3_hllc/case.py - - --case-optimization - - --targets - - pre_process - - simulation - - post_process - - --output-summary - - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/5eq_rk3_weno3_hllc.yaml - - -- - - --gbpp - - '1' - lock: - debug: false - gcov: false - gpu: false - mpi: true - single: false - unified: false - post_process: - exec: 2.6731925 - pre_process: - exec: 0.945057 - simulation: - exec: 553.7461466 - grind: 311.46590698 - syscheck: - exec: 0.5911245 - hypo_hll: - description: - args: [] - path: /home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py - slug: hypo_hll - output_summary: - invocation: - - run - - /home/mohammed/Desktop/cont-bench/benchmarks/hypo_hll/case.py - - --case-optimization - - --targets - - pre_process - - simulation - - post_process - - --output-summary - - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/hypo_hll.yaml - - -- - - --gbpp - - '1' - lock: - debug: false - gcov: false - gpu: false - mpi: true - single: false - unified: false - post_process: - exec: 4.6181798 - pre_process: - exec: 28.0626009 - simulation: - exec: 1158.0062294 - grind: 373.3648501 - syscheck: - exec: 0.5746224 - ibm: - description: - args: [] - path: /home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py - slug: ibm - output_summary: - invocation: - - run - - /home/mohammed/Desktop/cont-bench/benchmarks/ibm/case.py - - --case-optimization - - --targets - - pre_process - - simulation - - post_process - - --output-summary - - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/ibm.yaml - - -- - - --gbpp - - '1' - lock: - debug: false - gcov: false - gpu: false - mpi: true - single: false - unified: false - post_process: - exec: 2.7696633 - pre_process: - exec: 0.6595922 - simulation: - exec: 1560.6666524 - grind: 1329.41865639 - syscheck: - exec: 0.350557 - viscous_weno5_sgb_acoustic: - description: - args: [] - path: /home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py - slug: viscous_weno5_sgb_acoustic - output_summary: - invocation: - - run - - /home/mohammed/Desktop/cont-bench/benchmarks/viscous_weno5_sgb_acoustic/case.py - - --case-optimization - - --targets - - pre_process - - simulation - - post_process - - --output-summary - - /home/mohammed/Desktop/cont-bench/build/benchmarks/6462/viscous_weno5_sgb_acoustic.yaml - - -- - - --gbpp - - '1' - lock: - debug: false - gcov: false - gpu: false - mpi: true - single: false - unified: false - post_process: - exec: 1.7293213 - pre_process: - exec: 0.7582608 - simulation: - exec: 968.760392 - grind: 1051.98369313 - syscheck: - exec: 0.6131606 -metadata: - invocation: - - bench - - -o - - bench - lock: - debug: false - gcov: false - gpu: false - mpi: true - single: false - unified: false diff --git a/benchmarks/5eq_rk3_weno3_hllc/case.py b/benchmarks/5eq_rk3_weno3_hllc/case.py deleted file mode 100644 index 5233ef93f..000000000 --- a/benchmarks/5eq_rk3_weno3_hllc/case.py +++ /dev/null @@ -1,276 +0,0 @@ -#!/usr/bin/env python3 -# Benchmark model_equations_2_time_stepper_3_weno_order_3_riemann_solver_2 -# Additional Benchmarked Features -# - model_equations : 2 -# - time_stepper : 3 -# - weno_order : 3 -# - riemann_solver : 2 - -import json, math, argparse - -parser = argparse.ArgumentParser(prog="Benchmarking Case 1", description="This MFC case was created for the purposes of benchmarking MFC.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) - -parser.add_argument("--mfc", type=json.loads, default="{}", metavar="DICT", help="MFC's toolchain's internal state.") -parser.add_argument("--gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.") - -ARGS = vars(parser.parse_args()) -DICT = ARGS["mfc"] - -size = 1 if DICT["gpu"] else 0 - -ppg = 8000000 / 16.0 -procs = DICT["nodes"] * DICT["tasks_per_node"] -ncells = math.floor(ppg * procs * ARGS["gbpp"]) -s = math.floor((ncells / 2.0) ** (1 / 3)) -Nx, Ny, Nz = 2 * s, s, s - -# athmospheric pressure - Pa (used as reference value) -patm = 101325 - -# Initial Droplet Diameter / Reference length - m -D0 = 1.0e-3 - -# cavity to droplet ratio -CtD = 0.06 - -# cavity relative eccentricity (distance between radii) -ecc = 0.564 - -# initial shock distance from the y axis. Note that the droplet center is located at y = 0. Thus, the distance from the shock to -# the droplet is about D0/8 -ISD = 5.0 / 8 * D0 - -## pre-shock properties - AIR - -# pressure - Pa -p0a = patm - -# density - kg/m3 -rho0a = 1.204 - -# gamma -gama = 1.40 - -# pi infinity - Pa -pia = 0 - -# speed of sound - M/s -c_a = math.sqrt(gama * (p0a + pia) / rho0a) - -## Droplet - WATER - -# surface tension - N / m -st = 0.00e0 - -# Delta Pressure - Pa -DP = -st * 4 / D0 - -# initial pressure inside the droplet - Pa -p0w = p0a - DP - -# density - kg/m3 -rho0w = 1000 - -# gama -gamw = 6.12 - -# pi infty - Pa -piw = 3.43e08 - -# speed of sound - m/s -c_w = math.sqrt(gamw * (p0w + piw) / rho0w) - -# Shock Mach number of interest. Note that the post-shock properties can be defined in terms of either -# Min or psOp0a. Just comment/uncomment appropriatelly -Min = 2.4 - -## Pos to pre shock ratios - AIR - -# pressure -psOp0a = (Min**2 - 1) * 2 * gama / (gama + 1) + 1 -# psOp0a = 4.5 - -# density -rhosOrho0a = (1 + (gama + 1) / (gama - 1) * psOp0a) / ((gama + 1) / (gama - 1) + psOp0a) - -# Mach number of the shocked region - just a checker, as it must return "Min" -Ms = math.sqrt((gama + 1.0) / (2.0 * gama) * (psOp0a - 1.0) * (p0a / (p0a + pia)) + 1.0) - -# shock speed of sound - m/s -ss = Ms * c_a - -## post-shock - AIR - -# pressure - Pa -ps = psOp0a * p0a - -# density - kg / m3 -rhos = rhosOrho0a * rho0a - -# post shock speed of sound - m/s -c_s = math.sqrt(gama * (ps + pia) / rhos) - -# velocity at the post shock - m/s -vel = c_a / gama * (psOp0a - 1.0) * p0a / (p0a + pia) / Ms - -## Domain boundaries - m - -# x direction -xb = -8.4707 * D0 -xe = 9.6226 * D0 - -# xb = -10 * D0 -# xe = 10 * D0 - -# y direction -yb = 0 * D0 -ye = 10 * D0 - -# y direction -zb = 0 * D0 -ze = 10 * D0 - -# Stretching factor, to make sure the domaing is sufficiently large after the mesh stretch -StF = 4.0 - -# grid delta x if mesh were uniform in x direction - m. Note that I do not need a measure for dy -dx = (xe - xb) / Nx - -# I calculate tend twice; first is an estimate, second is -# the actual value used. This is because I am getting errors in the -# post process part every time I approximate the actual Nt by an integer -# number (think of a smarter way). - -# dimensionless time -ttilde = 1.92 - -# auxiliary simulation physical time - s. This is not YET the total simulation time, as it will be corrected so as to avoid -# mismatches in simulation and post_process parts. Note that I wrote it this way so I have better control over the # of autosaves -tendA = ttilde * D0 / vel - -cfl = 0.1 - -# time-step - s -dt = dx * cfl / ss - -# Save Frequency. Note that the number of autosaves will be SF + 1, as th IC (0.dat) is also saved -SF = 400 - -## making Nt divisible by SF -# 1 - ensure NtA goes slightly beyond tendA -NtA = int(tendA // dt + 1) - -# Array of saves. It is the same as Nt/Sf = t_step_save -AS = int(NtA // SF + 1) - -# Nt = total number of steps. Note that Nt >= NtA (so at least tendA is completely simulated) -Nt = AS * SF - -# total simulation time - s. Note that tend >= tendA -tend = Nt * dt - -# Configuring case dictionary -print( - json.dumps( - { - # Logistics - "run_time_info": "F", - # Computational Domain Parameters - "x_domain%beg": xb, - "x_domain%end": xe, - "y_domain%beg": yb, - "y_domain%end": ye, - "z_domain%beg": zb, - "z_domain%end": ze, - "m": Nx, - "n": Ny, - "p": Nz, - "cyl_coord": "F", - "dt": dt, - "t_step_start": 0, - "t_step_stop": int(30 * (95 * size + 5)), - "t_step_save": int(30 * (95 * size + 5)), - # Simulation Algorithm Parameters - "num_patches": 3, - "model_eqns": 2, - "alt_soundspeed": "F", - "num_fluids": 2, - "mpp_lim": "T", - "mixture_err": "T", - "time_stepper": 3, - "weno_order": 3, - "weno_eps": 1.0e-16, - "weno_Re_flux": "F", - "weno_avg": "F", - "mapped_weno": "T", - "riemann_solver": 2, - "wave_speeds": 1, - "avg_state": 2, - "bc_x%beg": -6, - "bc_x%end": -6, - "bc_y%beg": -2, - "bc_y%end": -3, - "bc_z%beg": -2, - "bc_z%end": -3, - # Formatted Database Files Structure Parameters - "format": 1, - "precision": 2, - "prim_vars_wrt": "T", - "parallel_io": "T", - # I will use 1 for WATER properties, and 2 for AIR properties - # Patch 1: Background (AIR - 2) - "patch_icpp(1)%geometry": 9, - "patch_icpp(1)%x_centroid": (xb + xe) / 2 * StF, - "patch_icpp(1)%y_centroid": (yb + ye) / 2 * StF, - "patch_icpp(1)%z_centroid": (yb + ye) / 2 * StF, - "patch_icpp(1)%length_x": (xe - xb) * StF, - "patch_icpp(1)%length_y": (ye - yb) * StF, - "patch_icpp(1)%length_z": (ze - zb) * StF, - "patch_icpp(1)%vel(1)": 0.0e00, - "patch_icpp(1)%vel(2)": 0.0e00, - "patch_icpp(1)%vel(3)": 0.0e00, - "patch_icpp(1)%pres": p0a, - "patch_icpp(1)%alpha_rho(1)": 0.0e00, - "patch_icpp(1)%alpha_rho(2)": rho0a, - "patch_icpp(1)%alpha(1)": 0.0e00, - "patch_icpp(1)%alpha(2)": 1.0e00, - # Patch 2: Shocked state (AIR - 2) - "patch_icpp(2)%geometry": 9, - "patch_icpp(2)%alter_patch(1)": "T", - "patch_icpp(2)%x_centroid": -ISD - (xe - xb) / 2 * StF, - "patch_icpp(2)%y_centroid": (yb + ye) / 2 * StF, - "patch_icpp(2)%z_centroid": (zb + ze) / 2 * StF, - "patch_icpp(2)%length_x": (xe - xb) * StF, - "patch_icpp(2)%length_y": (ye - yb) * StF, - "patch_icpp(2)%length_z": (ze - zb) * StF, - "patch_icpp(2)%vel(1)": vel, - "patch_icpp(2)%vel(2)": 0.0e00, - "patch_icpp(2)%vel(3)": 0.0e00, - "patch_icpp(2)%pres": ps, - "patch_icpp(2)%alpha_rho(1)": 0.0e00, - "patch_icpp(2)%alpha_rho(2)": rhos, - "patch_icpp(2)%alpha(1)": 0.0e00, - "patch_icpp(2)%alpha(2)": 1.0e00, - # Patch 3: Droplet (WATER - 1) - "patch_icpp(3)%geometry": 8, - "patch_icpp(3)%x_centroid": 0.0e00, - "patch_icpp(3)%y_centroid": 0.0e00, - "patch_icpp(3)%z_centroid": 0.0e00, - "patch_icpp(3)%radius": D0 / 2, - "patch_icpp(3)%alter_patch(1)": "T", - "patch_icpp(3)%vel(1)": 0.0e00, - "patch_icpp(3)%vel(2)": 0.0e00, - "patch_icpp(3)%vel(3)": 0.0e00, - "patch_icpp(3)%pres": p0w, - "patch_icpp(3)%alpha_rho(1)": rho0w, - "patch_icpp(3)%alpha_rho(2)": 0.0e00, - "patch_icpp(3)%alpha(1)": 1.0e00, - "patch_icpp(3)%alpha(2)": 0.0e00, - # Fluids Physical Parameters - "fluid_pp(1)%gamma": 1.0e00 / (gamw - 1), - "fluid_pp(1)%pi_inf": gamw * piw / (gamw - 1), - "fluid_pp(2)%gamma": 1.0e00 / (gama - 1), - "fluid_pp(2)%pi_inf": gama * pia / (gama - 1), - } - ) -) diff --git a/benchmarks/hypo_hll/case.py b/benchmarks/hypo_hll/case.py deleted file mode 100644 index e9b4188b2..000000000 --- a/benchmarks/hypo_hll/case.py +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env python3 -# Benchmark hypoelasticity_T_riemann_solver_1 -# Additional Benchmarked Features -# - hypoelasticity : T -# - riemann_solver : 1 - -import json, math, argparse - -parser = argparse.ArgumentParser(prog="Benchmarkin Case 3", description="This MFC case was created for the purposes of benchmarking MFC.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) - -parser.add_argument("--mfc", type=json.loads, default="{}", metavar="DICT", help="MFC's toolchain's internal state.") -parser.add_argument("--gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.") - -ARGS = vars(parser.parse_args()) -DICT = ARGS["mfc"] - -size = 1 if DICT["gpu"] else 0 - -ppg = 8000000 / 16.0 -procs = DICT["nodes"] * DICT["tasks_per_node"] -ncells = math.floor(ppg * procs * ARGS["gbpp"]) -s = math.floor((ncells / 2.0) ** (1 / 3)) -Nx, Ny, Nz = 2 * s, s, s - - -# Configuring case dictionary -print( - json.dumps( - { - # Logistics - "run_time_info": "F", - # Computational Domain Parameters - "x_domain%beg": 0.0e00, - "x_domain%end": 1.0e00, - "y_domain%beg": 0.0e00, - "y_domain%end": 2.0e00, - "z_domain%beg": 0.0e00, - "z_domain%end": 1.0e00, - "m": Nx, - "n": Ny, - "p": Nz, - "dt": 1e-8, - "t_step_start": 0, - "t_step_stop": int(30 * (95 * size + 5)), - "t_step_save": int(30 * (95 * size + 5)), - # Simulation Algorithm Parameters - "num_patches": 2, - "model_eqns": 2, - "alt_soundspeed": "F", - "num_fluids": 2, - "mpp_lim": "F", - "mixture_err": "F", - "time_stepper": 3, - "weno_order": 3, - "weno_eps": 1.0e-16, - "weno_Re_flux": "F", - "weno_avg": "F", - "mapped_weno": "F", - "null_weights": "F", - "mp_weno": "F", - "riemann_solver": 1, - "wave_speeds": 1, - "avg_state": 2, - "bc_x%beg": -3, - "bc_x%end": -3, - "bc_y%beg": -3, - "bc_y%end": -3, - "bc_z%beg": -3, - "bc_z%end": -3, - # Turning on Hypoelasticity - "hypoelasticity": "T", - "fd_order": 4, - # Formatted Database Files Structure Parameters - "format": 1, - "precision": 2, - "prim_vars_wrt": "T", - "parallel_io": "F", - # Patch 1 L - "patch_icpp(1)%geometry": 9, - "patch_icpp(1)%x_centroid": 0.35, - "patch_icpp(1)%y_centroid": 1.0, - "patch_icpp(1)%z_centroid": 0.5, - "patch_icpp(1)%length_x": 0.7, - "patch_icpp(1)%length_y": 2, - "patch_icpp(1)%length_z": 1, - "patch_icpp(1)%vel(1)": 0.0, - "patch_icpp(1)%vel(2)": 0.0, - "patch_icpp(1)%vel(3)": 0.0, - "patch_icpp(1)%pres": 1e09, - "patch_icpp(1)%alpha_rho(1)": 1000, - "patch_icpp(1)%alpha_rho(2)": 0.0, - "patch_icpp(1)%alpha(1)": 1, - "patch_icpp(1)%alpha(2)": 0.0, - "patch_icpp(1)%tau_e(1)": 0.0, - # Patch 2 R - "patch_icpp(2)%geometry": 9, - "patch_icpp(2)%x_centroid": 0.85, - "patch_icpp(2)%y_centroid": 1.0, - "patch_icpp(2)%z_centroid": 0.5, - "patch_icpp(2)%length_x": 0.3, - "patch_icpp(2)%length_y": 2.0, - "patch_icpp(2)%length_z": 1.0, - "patch_icpp(2)%vel(1)": 0, - "patch_icpp(2)%vel(2)": 0, - "patch_icpp(2)%vel(3)": 0, - "patch_icpp(2)%pres": 1e05, - "patch_icpp(2)%alpha_rho(1)": 0.0, - "patch_icpp(2)%alpha_rho(2)": 50.0, - "patch_icpp(2)%alpha(1)": 0, - "patch_icpp(2)%alpha(2)": 1, - "patch_icpp(2)%tau_e(1)": 0.0, - # Fluids Physical Parameters - "fluid_pp(1)%gamma": 1.0e00 / (4.4e00 - 1.0e00), - "fluid_pp(1)%pi_inf": 4.4e00 * 6.0e08 / (4.4e00 - 1.0e00), - "fluid_pp(1)%G": 1.0e09, - "fluid_pp(2)%gamma": 1.0e00 / (1.4e00 - 1.0e00), - "fluid_pp(2)%pi_inf": 0.0, - "fluid_pp(2)%G": 0.0, - } - ) -) diff --git a/benchmarks/ibm/case.py b/benchmarks/ibm/case.py deleted file mode 100644 index ba163d949..000000000 --- a/benchmarks/ibm/case.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python3 -# Benchmark ibm_T -# Additional Benchmarked Features -# - ibm : T - -import json, math, argparse - -parser = argparse.ArgumentParser(prog="Benchmarking Case 4", description="This MFC case was created for the purposes of benchmarking MFC.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) - -parser.add_argument("--mfc", type=json.loads, default="{}", metavar="DICT", help="MFC's toolchain's internal state.") -parser.add_argument("--gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.") - -ARGS = vars(parser.parse_args()) -DICT = ARGS["mfc"] - -size = 1 if DICT["gpu"] else 0 - -ppg = 8000000 / 16.0 -procs = DICT["nodes"] * DICT["tasks_per_node"] -ncells = math.floor(ppg * procs * ARGS["gbpp"]) -s = math.floor((ncells / 2.0) ** (1 / 3)) -Nx, Ny, Nz = 2 * s, s, s - -dx = 1.0 / (1.0 * (Nx + 1)) - -Tend = 1e-4 -Nt = 200 -mydt = Tend / (1.0 * Nt) - -# Configuring case dictionary -print( - json.dumps( - { - # Logistics - "run_time_info": "F", - # Computational Domain Parameters - "x_domain%beg": 0.0e00, - "x_domain%end": 1.0e00, - "y_domain%beg": 0, - "y_domain%end": 0.5, - "z_domain%beg": 0.0, - "z_domain%end": 0.5, - "m": Nx, - "n": Ny, - "p": Nz, - "dt": mydt, - "t_step_start": 0, - "t_step_stop": int(20 * (95 * size + 5)), - "t_step_save": int(20 * (95 * size + 5)), - # Simulation Algorithm Parameters - "num_patches": 1, - "model_eqns": 2, - "alt_soundspeed": "F", - "num_fluids": 2, - "mpp_lim": "F", - "mixture_err": "F", - "time_stepper": 3, - "weno_order": 5, - "weno_eps": 1.0e-16, - "weno_Re_flux": "T", - "weno_avg": "T", - "mapped_weno": "T", - "null_weights": "F", - "mp_weno": "F", - "riemann_solver": 2, - "wave_speeds": 1, - "avg_state": 2, - "bc_x%beg": -3, - "bc_x%end": -3, - "bc_y%beg": -3, - "bc_y%end": -3, - "bc_z%beg": -3, - "bc_z%end": -3, - # Turn on IBM - "ib": "T", - "num_ibs": 1, - "viscous": "T", - # Formatted Database Files Structure Parameters - "format": 1, - "precision": 2, - "prim_vars_wrt": "T", - "parallel_io": "T", - # Patch 1 L - "patch_icpp(1)%geometry": 9, - "patch_icpp(1)%x_centroid": 0.5, - "patch_icpp(1)%y_centroid": 0.25, - "patch_icpp(1)%z_centroid": 0.25, - "patch_icpp(1)%length_x": 1.0, - "patch_icpp(1)%length_y": 0.5, - "patch_icpp(1)%length_z": 0.5, - "patch_icpp(1)%vel(1)": 0.1, - "patch_icpp(1)%vel(2)": 0, - "patch_icpp(1)%vel(3)": 0, - "patch_icpp(1)%pres": 1.0, - "patch_icpp(1)%alpha_rho(1)": 0.8e00, - "patch_icpp(1)%alpha(1)": 0.8e00, - "patch_icpp(1)%alpha_rho(2)": 0.2e00, - "patch_icpp(1)%alpha(2)": 0.2e00, - # Patch: Sphere Immersed Boundary - "patch_ib(1)%geometry": 8, - "patch_ib(1)%x_centroid": 0.25, - "patch_ib(1)%y_centroid": 0.25, - "patch_ib(1)%z_centroid": 0.25, - "patch_ib(1)%radius": 0.1, - # Fluids Physical Parameters - # Specify 2 fluids - "fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00), - "fluid_pp(1)%pi_inf": 0, - "fluid_pp(1)%Re(1)": 54000, - "fluid_pp(2)%gamma": 1.0e00 / (1.4 - 1.0e00), - "fluid_pp(2)%pi_inf": 0, - "fluid_pp(2)%Re(1)": 54000, - } - ) -) diff --git a/benchmarks/viscous_weno5_sgb_acoustic/case.py b/benchmarks/viscous_weno5_sgb_acoustic/case.py deleted file mode 100644 index 1a85a4b28..000000000 --- a/benchmarks/viscous_weno5_sgb_acoustic/case.py +++ /dev/null @@ -1,225 +0,0 @@ -#!/usr/bin/env python3 -# Benchmark viscosity_weno_Re_flux_T_weno_order_5_bubbles_T_bubble_mode_3_acoustic_T -# Additional Benchmarked Features -# - viscosity enabled -# - weno_Re_flux : T -# - weno_order : 5 -# - bubbles_euler : T -# - bubble_model : 3 -# - acoustic_source : T - -import json, math, argparse - -parser = argparse.ArgumentParser(prog="Benchmarking Case 2", description="This MFC case was created for the purposes of benchmarking MFC.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) - -parser.add_argument("--mfc", type=json.loads, default="{}", metavar="DICT", help="MFC's toolchain's internal state.") -parser.add_argument("--gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.") - -ARGS = vars(parser.parse_args()) -DICT = ARGS["mfc"] - -size = 1 if DICT["gpu"] else 0 - -ppg = 8000000 / 16.0 -procs = DICT["nodes"] * DICT["tasks_per_node"] -ncells = math.floor(ppg * procs * ARGS["gbpp"]) -s = math.floor((ncells / 2.0) ** (1 / 3)) -Nx, Ny, Nz = 2 * s, s, s - -x0 = 10.0e-04 -y0 = 10.0e-04 -z0 = 10.0e-04 -p0 = 1.0 -rho0 = 1.0e03 -c0 = math.sqrt(p0 / rho0) -patm = 1.0 - -# water props -n_tait = 7.1 -B_tait = 306.0e06 / p0 -mul0 = 1.002e-03 # viscosity -ss = 0.07275 # surface tension -pv = 2.3388e03 # vapor pressure - -gamma_v = 1.33 -M_v = 18.02 -mu_v = 0.8816e-05 -k_v = 0.019426 - -# air props -gamma_n = 1.4 -M_n = 28.97 -mu_n = 1.8e-05 -k_n = 0.02556 - -# air props -gamma_gas = gamma_n - -# reference bubble size -R0ref = 10.0e-06 - -pa = 0.1 * 1.0e06 / 101325.0 - -# Characteristic velocity -uu = math.sqrt(p0 / rho0) -# Cavitation number -Ca = (p0 - pv) / (rho0 * (uu**2.0)) -# Weber number -We = rho0 * (uu**2.0) * R0ref / ss -# Inv. bubble Reynolds number -Re_inv = mul0 / (rho0 * uu * R0ref) - -# IC setup -vf0 = 0.00004 -n0 = vf0 / (math.pi * 4.0e00 / 3.0e00) - -cact = 1475.0 -t0 = x0 / c0 - -nbubbles = 1 -myr0 = R0ref - -cfl = 0.01 -Ldomain = 20.0e-03 -L = Ldomain / x0 -dx = L / float(Nx) -dt = cfl * dx * c0 / cact -Lpulse = 0.3 * Ldomain -Tpulse = Lpulse / cact - -# Configuring case dictionary -print( - json.dumps( - { - # Logistics - "run_time_info": "F", - # Computational Domain Parameters - "x_domain%beg": -10.0e-03 / x0, - "x_domain%end": 10.0e-03 / x0, - "y_domain%beg": -5.0e-03 / y0, - "y_domain%end": 5.0e-03 / y0, - "z_domain%beg": -5.0e-03 / z0, - "z_domain%end": 5.0e-03 / z0, - "stretch_x": "F", - "cyl_coord": "F", - "m": Nx, - "n": Ny, - "p": Nz, - "dt": dt, - "t_step_start": 0, - "t_step_stop": int(15 * (25 * size + 5)), - "t_step_save": int(15 * (25 * size + 5)), - # Simulation Algorithm Parameters - "num_patches": 2, - "model_eqns": 2, - "alt_soundspeed": "F", - "num_fluids": 1, - "mpp_lim": "F", - "mixture_err": "F", - "time_stepper": 3, - "weno_order": 5, - "weno_eps": 1.0e-16, - "weno_Re_flux": "F", - "weno_avg": "F", - "mapped_weno": "T", - "null_weights": "F", - "mp_weno": "T", - "riemann_solver": 2, - "wave_speeds": 1, - "avg_state": 2, - "bc_x%beg": -3, - "bc_x%end": -3, - "bc_y%beg": -3, - "bc_y%end": -3, - "bc_z%beg": -3, - "bc_z%end": -3, - "viscous": "T", - # Formatted Database Files Structure Parameters - "format": 1, - "precision": 2, - "prim_vars_wrt": "T", - "parallel_io": "T", - # Patch 1 _ Background - "patch_icpp(1)%geometry": 9, - "patch_icpp(1)%x_centroid": 0.0, - "patch_icpp(1)%y_centroid": 0.0, - "patch_icpp(1)%z_centroid": 0.0, - "patch_icpp(1)%length_x": 20.0e-03 / x0, - "patch_icpp(1)%length_y": 10.0e-03 / y0, - "patch_icpp(1)%length_z": 10.0e-03 / z0, - "patch_icpp(1)%vel(1)": 0.0, - "patch_icpp(1)%vel(2)": 0.0, - "patch_icpp(1)%vel(3)": 0.0, - "patch_icpp(1)%pres": patm, - "patch_icpp(1)%alpha_rho(1)": (1.0 - 1.0e-12) * 1.0e03 / rho0, - "patch_icpp(1)%alpha(1)": 1.0e-12, - "patch_icpp(1)%r0": 1.0, - "patch_icpp(1)%v0": 0.0e00, - # Patch 2 Screen - "patch_icpp(2)%geometry": 9, - "patch_icpp(2)%x_centroid": 0.0, - "patch_icpp(2)%y_centroid": 0.0, - "patch_icpp(2)%z_centroid": 0.0, - "patch_icpp(2)%length_x": 5.0e-03 / x0, - "patch_icpp(2)%length_y": 10.0e-03 / y0, - "patch_icpp(2)%length_z": 10.0e-03 / z0, - "patch_icpp(2)%alter_patch(1)": "T", - "patch_icpp(2)%vel(1)": 0.0, - "patch_icpp(2)%vel(2)": 0.0, - "patch_icpp(2)%vel(3)": 0.0, - "patch_icpp(2)%pres": patm, - "patch_icpp(2)%alpha_rho(1)": (1.0 - vf0) * 1.0e03 / rho0, - "patch_icpp(2)%alpha(1)": vf0, - "patch_icpp(2)%r0": 1.0, - "patch_icpp(2)%v0": 0.0e00, - # Fluids Physical Parameters - # Surrounding liquid - "fluid_pp(1)%gamma": 1.0e00 / (n_tait - 1.0e00), - "fluid_pp(1)%pi_inf": n_tait * B_tait / (n_tait - 1.0), - "fluid_pp(1)%mul0": mul0, - "fluid_pp(1)%ss": ss, - "fluid_pp(1)%pv": pv, - "fluid_pp(1)%gamma_v": gamma_v, - "fluid_pp(1)%M_v": M_v, - "fluid_pp(1)%mu_v": mu_v, - "fluid_pp(1)%k_v": k_v, - "fluid_pp(1)%Re(1)": 1e3, - # Last fluid_pp is always reserved for bubble gas state - # if applicable - "fluid_pp(2)%gamma": 1.0 / (gamma_gas - 1.0), - "fluid_pp(2)%pi_inf": 0.0e00, - "fluid_pp(2)%gamma_v": gamma_n, - "fluid_pp(2)%M_v": M_n, - "fluid_pp(2)%mu_v": mu_n, - "fluid_pp(2)%k_v": k_n, - # Non-polytropic gas compression model AND/OR Tait EOS - "pref": p0, - "rhoref": rho0, - # Bubbles - "bubbles_euler": "T", - "bubble_model": 3, - "polytropic": "T", - "polydisperse": "F", - # 'poly_sigma' : 0.3, - "thermal": 3, - "R0ref": myr0, - "nb": 1, - "Ca": Ca, - "Web": We, - "Re_inv": Re_inv, - # Acoustic source - "acoustic_source": "T", - "num_source": 1, - "acoustic(1)%support": 3, - "acoustic(1)%loc(1)": -5.0e-03 / x0, - "acoustic(1)%loc(2)": 0.0, - "acoustic(1)%length": 1.0 / x0, - "acoustic(1)%height": 1.0 / x0, - "acoustic(1)%npulse": 1, - "acoustic(1)%dir": 1.0, - "acoustic(1)%pulse": 1, - "acoustic(1)%mag": pa, - "acoustic(1)%wavelength": (1.0 / (300000.0)) * cact / x0, - } - ) -) diff --git a/test-components.sh b/test-components.sh deleted file mode 100755 index 14fab2518..000000000 --- a/test-components.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -set -e - -echo "=== Testing Individual Components ===" - -# Test 1: Check if mfc.sh exists and is executable -echo "1. Testing mfc.sh..." -if [ -f "./mfc.sh" ]; then - chmod +x ./mfc.sh - echo "✓ mfc.sh found and made executable" -else - echo "✗ mfc.sh not found - creating mock for testing" - cat > ./mfc.sh << 'MOCK' -#!/bin/bash -echo "Mock benchmark running..." -mkdir -p bench -echo "name: test_benchmark" > bench/test.yaml -echo "time: 1.23" >> bench/test.yaml -echo "Mock benchmark completed" -MOCK - chmod +x ./mfc.sh -fi - -# Test 2: Run benchmark command -echo "2. Testing benchmark execution..." -./mfc.sh bench -o bench || echo "Benchmark failed, continuing with mock data" - -# Test 3: Check yq installation and YAML to JSON conversion -echo "3. Testing YAML to JSON conversion..." -if ! command -v yq &> /dev/null; then - echo "Installing yq..." - sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 - sudo chmod +x /usr/local/bin/yq -fi - -# Convert any YAML files found -find . -maxdepth 1 -name "*.yaml" -exec sh -c 'echo "Converting $1"; yq eval -o=json "$1" > "${1%.yaml}.json"' _ {} \; - -# Test 4: Check JSON output format -echo "4. Validating JSON format..." -for json_file in *.json; do - if [ -f "$json_file" ]; then - echo "Checking $json_file:" - python3 -c "import json; json.load(open('$json_file')); print('✓ Valid JSON')" || echo "✗ Invalid JSON" - fi -done - -echo "=== Component Testing Complete ==="