diff --git a/.env b/.env new file mode 100644 index 0000000000..88bf9f148b --- /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.yml b/.github/workflows/bench.yml deleted file mode 100644 index b5e89a2b5e..0000000000 --- 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/cleanliness.yml b/.github/workflows/cleanliness.yml deleted file mode 100644 index ec472dce98..0000000000 --- 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/cont-bench.yml b/.github/workflows/cont-bench.yml new file mode 100644 index 0000000000..9fe93b3d0f --- /dev/null +++ b/.github/workflows/cont-bench.yml @@ -0,0 +1,149 @@ +name: Continuous Benchmarking + +on: [push, pull_request, workflow_dispatch] + +permissions: + contents: write + deployments: write + pages: write + 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 + 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 + 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 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"' _ {} \; + + + - 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: 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 + if: always() + with: + name: benchmark-results + path: | + pr/bench* + pr/build/benchmarks/* + pr/docs/documentation/cont-bench.md diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 7487d8e550..0000000000 --- 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 d161d80342..0000000000 --- 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 16043daa95..0000000000 --- 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 31a514d45d..0000000000 --- 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 c2e1893427..0000000000 --- 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 4e498a6090..0000000000 --- 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 68c07d6c18..0000000000 --- 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 '(?/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 accdc96288..0000000000 --- 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.yml b/.github/workflows/test.yml deleted file mode 100644 index 2948b11333..0000000000 --- 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 diff --git a/benchmarks/5eq_rk3_weno3_hllc/case.py b/benchmarks/5eq_rk3_weno3_hllc/case.py deleted file mode 100644 index 5233ef93f6..0000000000 --- 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 e9b4188b26..0000000000 --- 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 ba163d9494..0000000000 --- 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 1a85a4b280..0000000000 --- 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/docs/documentation/cont-bench.md b/docs/documentation/cont-bench.md new file mode 100644 index 0000000000..60399103d4 --- /dev/null +++ b/docs/documentation/cont-bench.md @@ -0,0 +1,154 @@ +# Continuouscl Benchmarking Results + +Generated on: 2025-07-10 00:46:18 UTC + +## System Information +- Host: github-runner +- CPUs: 2 +- MHz per CPU: 2000 + +## Benchmark Results + +| 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 | + +## 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