Skip to content

Commit 6fc430a

Browse files
committed
Merge remote-tracking branch 'upstream/master' into MovingBubblesFresh
2 parents fd96fec + 7c806be commit 6fc430a

118 files changed

Lines changed: 7899 additions & 2486 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

.codeant/configuration.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

.coderabbit.yaml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,52 @@ language: en-US
33

44
reviews:
55
profile: chill
6+
7+
# Hide the “Review skipped / Draft detected” status message
8+
review_status: false
9+
10+
# Remove the “Prompt for all review comments with AI agents” block
11+
enable_prompt_for_ai_agents: false
12+
13+
# Disable extra/non-default summary sections
14+
high_level_summary: false
15+
related_issues: false
16+
sequence_diagrams: false
17+
changed_files_summary: false
18+
19+
# Further reduce walkthrough noise (footer itself isn't currently configurable)
20+
collapse_walkthrough: true
21+
review_details: false
22+
estimate_code_review_effort: false
23+
assess_linked_issues: false
24+
related_prs: false
25+
suggested_labels: false
26+
suggested_reviewers: false
27+
in_progress_fortune: false
28+
poem: false
29+
30+
# Remove "Finishing Touches" section content
31+
finishing_touches:
32+
docstrings:
33+
enabled: false
34+
unit_tests:
35+
enabled: false
36+
37+
auto_review:
38+
enabled: true # initial PR-open review
39+
auto_incremental_review: false # no re-run on every push
40+
641
path_instructions:
42+
- path: "**/*"
43+
instructions: |
44+
IMPORTANT: Only comment on code that is within this PR’s diff (changed lines / files).
45+
Do not add feedback that requires commenting outside the diff range.
46+
747
- path: "src/**/*.fpp"
848
instructions: |
949
Fortran source (Fypp-preprocessed). Follow the coding standards in
1050
docs/documentation/contributing.md and the GPU macro API in
11-
docs/documentation/gpuParallelization.md.
12-
- path: "src/**/*.f90"
13-
instructions: |
14-
Fortran source. Follow the coding standards in
51+
docs/documentation/gpuParallelization.md and the coding standards in
1552
docs/documentation/contributing.md.
1653
- path: "toolchain/**/*.py"
1754
instructions: |

.github/pull_request_template.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,11 @@ See the [developer guide](https://mflowcode.github.io/documentation/contributing
3030
- [ ] Tested on NVIDIA GPU or AMD GPU
3131

3232
</details>
33+
34+
## AI code reviews
35+
36+
Reviews are not triggered automatically. To request a review, comment on the PR:
37+
- `@coderabbitai review` — incremental review (new changes only)
38+
- `@coderabbitai full review` — full review from scratch
39+
- `/review` — Qodo review
40+
- `/improve` — Qodo code suggestions

.github/scripts/submit_and_monitor_bench.sh

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,50 +14,27 @@ device="$2"
1414
interface="$3"
1515
cluster="$4"
1616

17-
# Get the directory where this script lives
18-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19-
2017
echo "[$dir] Submitting benchmark for $device-$interface on $cluster..."
2118
cd "$dir"
2219

23-
# Submit job
24-
submit_output=$(bash .github/workflows/$cluster/submit-bench.sh \
25-
.github/workflows/$cluster/bench.sh "$device" "$interface" 2>&1)
26-
27-
job_id=$(echo "$submit_output" | sed -n 's/.*Submitted batch job \([0-9][0-9]*\).*/\1/p')
28-
job_slug="bench-$device-$interface"
29-
output_file="${job_slug}.out"
30-
31-
if [ -z "$job_id" ]; then
32-
echo "[$dir] ERROR: Failed to submit job"
33-
echo "$submit_output"
34-
exit 1
35-
fi
36-
37-
echo "[$dir] Job ID: $job_id, monitoring output file: $output_file"
38-
39-
# Use the monitoring script from PR (where this script lives)
40-
monitor_exit=0
41-
bash "${SCRIPT_DIR}/monitor_slurm_job.sh" "$job_id" "$output_file" || monitor_exit=$?
42-
if [ "$monitor_exit" -ne 0 ]; then
43-
echo "[$dir] WARNING: SLURM job exited with code $monitor_exit"
44-
else
45-
echo "[$dir] Monitoring complete for job $job_id"
46-
fi
20+
# Submit and monitor job (submit.sh auto-detects bench mode from script name)
21+
bash .github/workflows/$cluster/submit.sh \
22+
.github/workflows/$cluster/bench.sh "$device" "$interface"
4723

4824
# Verify the YAML output file was created
25+
job_slug="bench-$device-$interface"
4926
yaml_file="${job_slug}.yaml"
5027
if [ ! -f "$yaml_file" ]; then
51-
echo "[$dir] ERROR: Expected output file not found: $yaml_file"
52-
echo "[$dir] Directory contents:"
53-
ls -la *.yaml 2>/dev/null || echo " No YAML files found"
54-
echo ""
55-
echo "[$dir] Last 100 lines of job output ($output_file):"
56-
echo "----------------------------------------"
57-
tail -n 100 "$output_file" 2>/dev/null || echo " Could not read output file"
58-
echo "----------------------------------------"
59-
exit 1
28+
echo "[$dir] ERROR: Expected output file not found: $yaml_file"
29+
echo "[$dir] Directory contents:"
30+
ls -la *.yaml 2>/dev/null || echo " No YAML files found"
31+
echo ""
32+
output_file="${job_slug}.out"
33+
echo "[$dir] Last 100 lines of job output ($output_file):"
34+
echo "----------------------------------------"
35+
tail -n 100 "$output_file" 2>/dev/null || echo " Could not read output file"
36+
echo "----------------------------------------"
37+
exit 1
6038
fi
6139

6240
echo "[$dir] Verified output file exists: $yaml_file ($(stat -f%z "$yaml_file" 2>/dev/null || stat -c%s "$yaml_file" 2>/dev/null) bytes)"
63-

.github/workflows/bench.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
jobs:
1414
file-changes:
1515
name: Detect File Changes
16+
if: >
17+
github.event_name != 'pull_request_review' ||
18+
github.event.review.user.type != 'Bot'
1619
runs-on: 'ubuntu-latest'
1720
outputs:
1821
checkall: ${{ steps.changes.outputs.checkall }}
@@ -28,7 +31,7 @@ jobs:
2831

2932
self:
3033
name: "${{ matrix.name }} (${{ matrix.device }}${{ matrix.interface != 'none' && format('-{0}', matrix.interface) || '' }})"
31-
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' || github.event.pull_request.user.login=='wilfonba')) || github.event_name=='workflow_dispatch') }}
34+
if: ${{ github.repository=='MFlowCode/MFC' && needs.file-changes.outputs.checkall=='true' && github.event.pull_request.draft != true && ((github.event_name=='pull_request_review' && github.event.review.state=='approved') || (github.event_name=='pull_request' && (github.event.pull_request.user.login=='sbryngelson' || github.event.pull_request.user.login=='wilfonba')) || github.event_name=='workflow_dispatch') }}
3235
needs: file-changes
3336
strategy:
3437
fail-fast: false

.github/workflows/claude-code-review.yml

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,68 +10,63 @@ jobs:
1010
permissions:
1111
contents: read
1212
pull-requests: write
13-
issues: read
13+
issues: write
1414
actions: read
1515
id-token: write
1616

1717
steps:
18-
- name: Checkout PR head (fork)
18+
- name: Install unzip (required by bun setup)
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y unzip
22+
23+
# IMPORTANT: checkout BASE repo only (safe on forks)
24+
- name: Checkout base repo (safe)
1925
uses: actions/checkout@v4
2026
with:
21-
ref: ${{ github.event.pull_request.head.sha }}
2227
fetch-depth: 1
2328

2429
- name: Run Claude Code Review
25-
id: claude-review
2630
uses: anthropics/claude-code-action@v1
2731
with:
2832
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
2933
github_token: ${{ github.token }}
3034

31-
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
32-
plugins: 'code-review@claude-code-plugins'
35+
plugin_marketplaces: "https://github.com/anthropics/claude-code.git"
36+
plugins: "code-review@claude-code-plugins"
3337

38+
# NOTE: do NOT use --dangerouslyDisableSandbox (it can crash the CLI).
39+
# This flag is for non-interactive CI runs (bypasses approval prompts).
3440
claude_args: >
35-
--dangerouslyDisableSandbox
36-
--max-turns 10
41+
--dangerously-skip-permissions
42+
--max-turns 90
3743
--allowedTools
38-
"Bash(gh pr view:*)"
39-
"Bash(gh pr diff:*)"
40-
"Bash(gh pr comment:*)"
41-
"Bash(gh api repos/*/pulls/*:*)"
42-
"Bash(gh api repos/*/issues/*/comments:*)"
43-
"Bash(cat:*)"
44-
"Bash(ls:*)"
45-
"Bash(grep:*)"
46-
"Bash(find:*)"
44+
"Bash"
4745
4846
prompt: |
49-
/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}
47+
You are running in pull_request_target.
48+
DO NOT read or inspect any checked-out PR/fork code. Review ONLY using GitHub API/gh commands.
5049
51-
Always use the numeric PR form with --repo, e.g.:
52-
- gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} ...
53-
- gh pr diff ${{ github.event.pull_request.number }} --repo ${{ github.repository }} ...
54-
- gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} ...
50+
You may read local guidance ONLY from:
51+
- ./CLAUDE.md (root) if present
52+
- ./.claude/rules/*.md if present (max 10 files)
5553
56-
Output requirements (even if no issues):
57-
- Start with: files changed count + list up to 15 changed file paths
58-
- Then: a short summary of what the PR changes (3–6 bullets)
59-
- Then: findings:
60-
- If issues: list them with file path + line numbers when possible
61-
- If no issues: list at least 3 concrete "improvement opportunities" with file paths
54+
Keep tool calls minimal and in this order:
55+
1) ls -1 .claude/rules 2>/dev/null || true
56+
2) cat CLAUDE.md 2>/dev/null || true
57+
3) find .claude/rules -maxdepth 1 -name "*.md" -print | head -n 10 | xargs -I{} cat "{}" 2>/dev/null || true
58+
4) gh pr view ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --json title,body,files,changedFiles,additions,deletions,headRefOid
59+
5) gh pr diff ${{ github.event.pull_request.number }} --repo ${{ github.repository }}
60+
6) Post ONE top-level PR comment titled "Claude Code Review", then STOP.
6261
63-
Post the results as ONE top-level PR comment titled "Claude Code Review".
64-
If you cannot access the diff/files, say exactly what is blocked.
65-
If posting a PR comment is blocked, write the full review to the GitHub Actions job summary instead.
62+
Output format:
63+
- Head SHA
64+
- Files changed count + list up to 10 file paths
65+
- Summary (3–6 bullets, minimal)
66+
- Findings with file + line numbers when possible
67+
- If no issues: 0–3 improvement opportunities (only if confident)
6668
67-
IMPORTANT:
68-
- Do NOT stop just because a previous "Claude Code Review" comment exists.
69-
- If a prior Claude review exists, post a NEW comment titled "Claude Code Review (updated)" that includes:
70-
- current head SHA: ${{ github.event.pull_request.head.sha }}
71-
- files changed count + up to 15 file paths
72-
- 3–6 bullet summary of changes
73-
- findings or at least 3 improvement opportunities with file paths
74-
Post as ONE top-level PR comment.
69+
If posting is blocked, write the full review to the GitHub Actions job summary instead, then STOP.
7570
7671
additional_permissions: |
7772
actions: read

.github/workflows/coverage.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: [master]
66
pull_request:
7+
types: [opened, synchronize, reopened, ready_for_review]
78
workflow_dispatch:
89

910
concurrency:
@@ -28,18 +29,29 @@ jobs:
2829

2930
run:
3031
name: Coverage Test on CodeCov
31-
if: needs.file-changes.outputs.checkall == 'true'
32+
if: needs.file-changes.outputs.checkall == 'true' && github.event.pull_request.draft != true
3233
needs: file-changes
3334
runs-on: "ubuntu-latest"
3435
steps:
3536
- name: Checkouts
3637
uses: actions/checkout@v4
3738

39+
- name: Get system info for cache key
40+
id: sys-info
41+
run: |
42+
{
43+
uname -m
44+
cat /proc/cpuinfo 2>/dev/null | grep 'model name' | head -1 || sysctl -n machdep.cpu.brand_string 2>/dev/null || true
45+
${FC:-gfortran} --version 2>/dev/null | head -1 || true
46+
${CC:-gcc} --version 2>/dev/null | head -1 || true
47+
} | (sha256sum 2>/dev/null || shasum -a 256) | cut -c1-16 > /tmp/sys-hash
48+
echo "sys-hash=$(cat /tmp/sys-hash)" >> "$GITHUB_OUTPUT"
49+
3850
- name: Restore Build Cache
3951
uses: actions/cache@v4
4052
with:
4153
path: build
42-
key: mfc-coverage-${{ hashFiles('CMakeLists.txt', 'toolchain/dependencies/**', 'toolchain/cmake/**', 'src/**/*.fpp', 'src/**/*.f90') }}
54+
key: mfc-coverage-${{ steps.sys-info.outputs.sys-hash }}-${{ hashFiles('CMakeLists.txt', 'toolchain/dependencies/**', 'toolchain/cmake/**', 'src/**/*.fpp', 'src/**/*.f90') }}
4355

4456
- name: Setup Ubuntu
4557
run: |

.github/workflows/frontier/bench.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ "$job_device" = "gpu" ]; then
1616
fi
1717

1818
if [ "$job_device" = "gpu" ]; then
19-
./mfc.sh bench --mem 12 -j $n_ranks -o "$job_slug.yaml" -- -c frontier $device_opts -n $n_ranks
19+
./mfc.sh bench --mem 4 -j $n_ranks -o "$job_slug.yaml" -- -c $job_cluster $device_opts -n $n_ranks
2020
else
21-
./mfc.sh bench --mem 1 -j $(nproc) -o "$job_slug.yaml" -- -c frontier $device_opts -n $n_ranks
21+
./mfc.sh bench --mem 1 -j $(nproc) -o "$job_slug.yaml" -- -c $job_cluster $device_opts -n $n_ranks
2222
fi

.github/workflows/frontier/build.sh

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
# Ignore SIGHUP to survive login node session drops
44
trap '' HUP
55

6+
# Determine compiler flag from directory name
7+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8+
cluster_name="$(basename "$SCRIPT_DIR")"
9+
case "$cluster_name" in
10+
frontier) compiler_flag="f" ;;
11+
frontier_amd) compiler_flag="famd" ;;
12+
*) echo "ERROR: Unknown cluster '$cluster_name'"; exit 1 ;;
13+
esac
14+
615
job_device=$1
716
job_interface=$2
817
run_bench=$3
@@ -16,28 +25,25 @@ if [ "$job_device" = "gpu" ]; then
1625
fi
1726
fi
1827

19-
. ./mfc.sh load -c f -m g
28+
. ./mfc.sh load -c $compiler_flag -m $([ "$job_device" = "gpu" ] && echo "g" || echo "c")
2029

2130
# Only set up build cache for test suite, not benchmarks
2231
if [ "$run_bench" != "bench" ]; then
23-
source .github/scripts/setup-build-cache.sh frontier "$job_device" "$job_interface"
32+
source .github/scripts/setup-build-cache.sh "$cluster_name" "$job_device" "$job_interface"
2433
fi
2534

2635
max_attempts=3
2736
attempt=1
2837
while [ $attempt -le $max_attempts ]; do
2938
echo "Build attempt $attempt of $max_attempts..."
3039
if [ "$run_bench" == "bench" ]; then
31-
build_cmd_ok=true
32-
for dir in benchmarks/*/; do
33-
dirname=$(basename "$dir")
34-
if ! ./mfc.sh run -v "$dir/case.py" --case-optimization -j 8 --dry-run $build_opts; then
35-
build_cmd_ok=false
36-
break
37-
fi
38-
done
40+
if ./mfc.sh build -j 8 $build_opts; then
41+
build_cmd_ok=true
42+
else
43+
build_cmd_ok=false
44+
fi
3945
else
40-
if ./mfc.sh test -v -a --dry-run --rdma-mpi -j 8 $build_opts; then
46+
if ./mfc.sh test -v -a --dry-run $([ "$cluster_name" = "frontier" ] && echo "--rdma-mpi") -j 8 $build_opts; then
4147
build_cmd_ok=true
4248
else
4349
build_cmd_ok=false

0 commit comments

Comments
 (0)