Skip to content

Commit b8f485a

Browse files
authored
Merge branch 'master' into debug-testhang
2 parents 05df25c + 99c749d commit b8f485a

File tree

115 files changed

+10651
-865
lines changed

Some content is hidden

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

115 files changed

+10651
-865
lines changed

.cursor/rules/mfc-agent-rules.mdc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Written primarily for Fortran/Fypp; the OpenACC and style sections matter only w
1616
- Most sources are `.fpp`; CMake transpiles them to `.f90`.
1717
- **Fypp macros** live in `src/<subprogram>/include/` you should scan these first.
1818
`<subprogram>` ∈ {`simulation`,`common`,`pre_process`,`post_process`}.
19-
- Only `simulation` (+ its `common` calls) is GPU-accelerated via **OpenACC**.
19+
- Only `simulation` (+ its `common` calls) is GPU-accelerated via **OpenACC** or **OpenMP**.
2020
- Assume free-form Fortran 2008+, `implicit none`, explicit `intent`, and modern
2121
intrinsics.
2222
- Prefer `module … contains … subroutine foo()`; avoid `COMMON` blocks and
@@ -56,27 +56,29 @@ Written primarily for Fortran/Fypp; the OpenACC and style sections matter only w
5656
* Every variable: `intent(in|out|inout)` + appropriate `dimension` / `allocatable`
5757
/ `pointer`.
5858
* Use `s_mpi_abort(<msg>)` for errors, not `stop`.
59-
* Mark OpenACC-callable helpers that are called from OpenACC parallel loops immediately after declaration:
59+
* Mark GPU-callable helpers that are called from GPU parallel loops immediately after declaration:
6060
```fortran
6161
subroutine s_flux_update(...)
62-
!$acc routine seq
62+
$:GPU_ROUTINE(function_name='s_flux_update', parallelism='[seq]')
6363
...
6464
end subroutine
6565
```
6666

6767
---
6868

69-
# 3 OpenACC Programming Guidelines (for kernels)
69+
# 3 FYPP Macros for GPU acceleration Pogramming Guidelines (for kernels)
70+
71+
Do not directly use OpenACC or OpenMP directives directly. Instead, use the FYPP macros contained in src/common/include/parallel_macros.fpp
7072

7173
Wrap tight loops with
7274

7375
```fortran
74-
!$acc parallel loop gang vector default(present) reduction(...)
76+
$:GPU_PARALLEL_FOR(private='[...]', copy='[...]')
7577
```
76-
* Add `collapse(n)` to merge nested loops when safe.
77-
* Declare loop-local variables with `private(...)`.
78+
* Add `collapse=n` to merge nested loops when safe.
79+
* Declare loop-local variables with `private='[...]'`.
7880
* Allocate large arrays with `managed` or move them into a persistent
79-
`!$acc enter data` region at start-up.
81+
`$:GPU_ENTER_DATA(...)` region at start-up.
8082
* **Do not** place `stop` / `error stop` inside device code.
8183
* Must compile with Cray `ftn` and NVIDIA `nvfortran` for GPU offloading; also build CPU-only with
8284
GNU `gfortran` and Intel `ifx`/`ifort`.

.fortlsrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"MFC_DOUBLE_PRECISION": 1
3030
},
3131
"lowercase_intrinsics": true,
32-
"debug_log": true,
32+
"debug_log": false,
3333
"disable_diagnostics": false,
3434
"use_signature_help": true,
3535
"variable_hover": true,
@@ -93,4 +93,4 @@
9393
"**/m_nvtx*",
9494
"**/syscheck.fpp"
9595
]
96-
}
96+
}

.github/workflows/frontier/submit-bench.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ sbatch <<EOT
3232
#SBATCH -A CFD154 # charge account
3333
#SBATCH -N 1 # Number of nodes required
3434
$sbatch_device_opts
35-
#SBATCH -t 01:59:00 # Duration of the job (Ex: 15 mins)
35+
#SBATCH -t 02:59:00 # Duration of the job (Ex: 15 mins)
3636
#SBATCH -o$job_slug.out # Combined output and error messages file
3737
#SBATCH -p extended # Extended partition for shorter queues
3838
#SBATCH -W # Do not exit until the submitted job terminates.

.github/workflows/frontier/submit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ sbatch <<EOT
3333
#SBATCH -A CFD154 # charge account
3434
#SBATCH -N 1 # Number of nodes required
3535
$sbatch_device_opts
36-
#SBATCH -t 01:59:00 # Duration of the job (Ex: 15 mins)
36+
#SBATCH -t 02:59:00 # Duration of the job (Ex: 15 mins)
3737
#SBATCH -o$job_slug.out # Combined output and error messages file
3838
#SBATCH -p extended # Extended partition for shorter queues
3939
#SBATCH -W # Do not exit until the submitted job terminates.

.github/workflows/phoenix/submit-bench.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ JOBID=$(sbatch <<-EOT | awk '{print $4}'
6969
EOT
7070
)
7171

72-
echo "🚀 Submitted SLURM job $JOBID"
72+
echo "Submitted: SLURM job $JOBID"
7373

7474
# if this wrapper is killed/canceled, make sure SLURM job is cleaned up
7575
trap '[[ -n "${JOBID:-}" ]] && scancel "$JOBID" >/dev/null 2>&1 || :' EXIT
@@ -86,22 +86,22 @@ while :; do
8686

8787
# If it’s one of SLURM’s terminal states, break immediately
8888
case "$STATE" in
89-
COMPLETED|FAILED|CANCELLED|TIMEOUT)
90-
echo " SLURM job $JOBID reached terminal state: $STATE"
89+
COMPLETED|FAILED|CANCELLED|TIMEOUT|PREEMPTED)
90+
echo "Completed: SLURM job $JOBID reached terminal state: $STATE"
9191
break
9292
;;
9393
"")
94-
echo " SLURM job $JOBID no longer in queue; assuming finished"
94+
echo "Completed: SLURM job $JOBID no longer in queue; assuming finished"
9595
break
9696
;;
9797
*)
98-
echo " SLURM job $JOBID state: $STATE"
98+
echo "Waiting: SLURM job $JOBID state: $STATE"
9999
sleep 10
100100
;;
101101
esac
102102
done
103103

104104
# Now retrieve the exit code and exit with it
105105
EXIT_CODE=$(sacct -j "$JOBID" --noheader --format=ExitCode | head -1 | cut -d: -f1)
106-
echo "🔚 SLURM job $JOBID exit code: $EXIT_CODE"
106+
echo "Completed: SLURM job $JOBID exit code: $EXIT_CODE"
107107
exit "$EXIT_CODE"

.github/workflows/phoenix/submit.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ JOBID=$(sbatch <<-EOT | awk '{print $4}'
6262
EOT
6363
)
6464

65-
echo "🚀 Submitted SLURM job $JOBID"
65+
echo "Submitted: SLURM job $JOBID"
6666

6767
# if this wrapper is killed/canceled, make sure SLURM job is cleaned up
6868
trap '[[ -n "${JOBID:-}" ]] && scancel "$JOBID" >/dev/null 2>&1 || :' EXIT
@@ -79,22 +79,22 @@ while :; do
7979

8080
# If it’s one of SLURM’s terminal states, break immediately
8181
case "$STATE" in
82-
COMPLETED|FAILED|CANCELLED|TIMEOUT)
83-
echo " SLURM job $JOBID reached terminal state: $STATE"
82+
COMPLETED|FAILED|CANCELLED|TIMEOUT|PREEMPTED)
83+
echo "Completed: SLURM job $JOBID reached terminal state: $STATE"
8484
break
8585
;;
8686
"")
87-
echo " SLURM job $JOBID no longer in queue; assuming finished"
87+
echo "Completed: SLURM job $JOBID no longer in queue; assuming finished"
8888
break
8989
;;
9090
*)
91-
echo " SLURM job $JOBID state: $STATE"
91+
echo "Waiting: SLURM job $JOBID state: $STATE"
9292
sleep 10
9393
;;
9494
esac
9595
done
9696

9797
# Now retrieve the exit code and exit with it
9898
EXIT_CODE=$(sacct -j "$JOBID" --noheader --format=ExitCode | head -1 | cut -d: -f1)
99-
echo "🔚 SLURM job $JOBID exit code: $EXIT_CODE"
99+
echo "Completed: SLURM job $JOBID exit code: $EXIT_CODE"
100100
exit "$EXIT_CODE"

CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,17 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
135135
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
136136
add_compile_options(
137137
-Wall
138-
-Wextra
138+
-Wextra
139139
-fcheck=all,no-array-temps
140140
-fbacktrace
141141
-fimplicit-none
142142
-fsignaling-nans
143143
-finit-real=snan
144144
-finit-integer=-99999999
145-
-Wintrinsic-shadow
146-
-Wunderflow
147-
-Wrealloc-lhs
148-
-Wsurprising
145+
-Wintrinsic-shadow
146+
-Wunderflow
147+
-Wrealloc-lhs
148+
-Wsurprising
149149
)
150150
endif()
151151

@@ -163,6 +163,7 @@ elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Cray")
163163
"SHELL:-h acc_model=auto_async_none"
164164
"SHELL: -h acc_model=no_fast_addr"
165165
"SHELL: -h list=adm"
166+
"SHELL: -munsafe-fp-atomics" # Not unsafe for operations we do
166167
)
167168

168169
add_link_options("SHELL:-hkeepfiles")
@@ -172,7 +173,6 @@ elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Cray")
172173
"SHELL:-h acc_model=auto_async_none"
173174
"SHELL: -h acc_model=no_fast_addr"
174175
"SHELL: -K trap=fp" "SHELL: -G2"
175-
176176
)
177177
add_link_options("SHELL: -K trap=fp" "SHELL: -G2")
178178
endif()
@@ -200,10 +200,10 @@ elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_
200200
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
201201
add_compile_options(
202202
$<$<COMPILE_LANGUAGE:Fortran>:-O0>
203-
$<$<COMPILE_LANGUAGE:Fortran>:-C>
203+
$<$<COMPILE_LANGUAGE:Fortran>:-C>
204204
$<$<COMPILE_LANGUAGE:Fortran>:-g>
205-
$<$<COMPILE_LANGUAGE:Fortran>:-traceback>
206-
$<$<COMPILE_LANGUAGE:Fortran>:-Minform=inform>
205+
$<$<COMPILE_LANGUAGE:Fortran>:-traceback>
206+
$<$<COMPILE_LANGUAGE:Fortran>:-Minform=inform>
207207
$<$<COMPILE_LANGUAGE:Fortran>:-Mbounds>
208208
)
209209
endif()

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ They are organized below.
155155
* Runge-Kutta orders 1-3 (SSP TVD), adaptive time stepping
156156
* RK4-5 operator splitting for Euler-Lagrange modeling
157157
* Interface sharpening (THINC-like)
158+
* Information geometric regularization (IGR)
159+
* Shock capturing without WENO and Riemann solvers
158160

159161
### Large-scale and accelerated simulation
160162

benchmarks/5eq_rk3_weno3_hllc/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@
188188
"cyl_coord": "F",
189189
"dt": dt,
190190
"t_step_start": 0,
191-
"t_step_stop": int(30 * (95 * size + 5)),
192-
"t_step_save": int(30 * (95 * size + 5)),
191+
"t_step_stop": int(20 * (5 * size + 5)),
192+
"t_step_save": int(20 * (5 * size + 5)),
193193
# Simulation Algorithm Parameters
194194
"num_patches": 3,
195195
"model_eqns": 2,

benchmarks/hypo_hll/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"p": Nz,
4242
"dt": 1e-8,
4343
"t_step_start": 0,
44-
"t_step_stop": int(30 * (95 * size + 5)),
45-
"t_step_save": int(30 * (95 * size + 5)),
44+
"t_step_stop": int(20 * (5 * size + 5)),
45+
"t_step_save": int(20 * (5 * size + 5)),
4646
# Simulation Algorithm Parameters
4747
"num_patches": 2,
4848
"model_eqns": 2,

0 commit comments

Comments
 (0)