Skip to content

Commit ea2f3c4

Browse files
committed
correct corrupted comments and whitespace in 127/147 changed files
1 parent b565c87 commit ea2f3c4

52 files changed

Lines changed: 734 additions & 1436 deletions

Some content is hidden

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

.github/CODEOWNERS

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
11
# Spencer H. Bryngelson (sbryngelson) is the
22
# default owner of all files in the repository.
33
* @sbryngelson
4-
5-
# @core-devs
6-
src/ @MFlowCode/core-devs
7-
docs/ @MFlowCode/core-devs
8-
toolchain/ @MFlowCode/core-devs
9-
tests/ @MFlowCode/core-devs
10-
benchmarks/ @MFlowCode/core-devs
11-
mfc.sh @MFlowCode/core-devs
12-
CMakeLists.txt @MFlowCode/core-devs
13-
14-
# @physics-devs
15-
src/ @MFlowCode/physics-devs

mfc.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,12 @@ if [ $code -ne 0 ]; then
102102
error "main.py finished with a $code exit code."
103103
fi
104104

105-
# Deactivate the Python virtualenv in case the user "source"'d this script
106-
log "(venv) Exiting the$MAGENTA Python$COLOR_RESET virtual environment."
107-
deactivate
105+
# Deactivate the Python virtualenv in case the user "source"'d this script.
106+
# Guard against the case where no venv was activated (e.g. system Python).
107+
if type deactivate > /dev/null 2>&1; then
108+
log "(venv) Exiting the$MAGENTA Python$COLOR_RESET virtual environment."
109+
deactivate
110+
fi
108111

109112
# Exit with proper exit code
110113
exit $code

src/common/include/3dHardcodedIC.fpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
eps = 1e-9_wp
2121

22-
if (patch_icpp(patch_id)%hcid == 303) then
22+
if (patch_icpp(patch_id)%hcid == 303) then ! IGR Multijet
2323
eps_smooth = 3._wp
2424
inquire (file="njet.txt", exist=file_exist)
2525
if (file_exist) then
@@ -75,7 +75,7 @@
7575
end if
7676
end if
7777

78-
if (patch_icpp(patch_id)%hcid == 304) then
78+
if (patch_icpp(patch_id)%hcid == 304) then ! 3D Cartesian interface from file
7979
@:ALLOCATE(ih(0:n_glb, 0:p_glb))
8080

8181
if (interface_file == '.') then
@@ -108,7 +108,7 @@
108108
end if
109109
end if
110110

111-
if (patch_icpp(patch_id)%hcid == 305) then
111+
if (patch_icpp(patch_id)%hcid == 305) then ! 3D Axisymmetric interface from file
112112
@:ALLOCATE(ih(0:n_glb, 0:0))
113113
if (interface_file == '.') then
114114
call s_mpi_abort("Error: interface_file must be specified for hcid=305")
@@ -241,9 +241,6 @@
241241
q_prim_vf(eqn_idx%cont%beg)%sf(i, j, k) = q_prim_vf(eqn_idx%adv%beg)%sf(i, j, k)*(950._wp/1000._wp)
242242
q_prim_vf(eqn_idx%cont%end)%sf(i, j, k) = q_prim_vf(eqn_idx%adv%end)%sf(i, j, k)*(1._wp/1000._wp)
243243

244-
! h = x_cc(i) - ih(start_idx(2) + j, start_idx(3) + k) q_prim_vf(momxb)%sf(i,j,k) = -1._wp * (ih(start_idx(2) + j,
245-
! start_idx(3) + k) - normFac) * exp(-h * h / 1000) / 100._wp
246-
247244
q_prim_vf(eqn_idx%E)%sf(i, j, k) = p0_ic + (q_prim_vf(eqn_idx%cont%beg)%sf(i, j, k) + q_prim_vf(eqn_idx%cont%end)%sf(i, &
248245
& j, k))*g0_ic*(ih(start_idx(2) + j, start_idx(3) + k) - x_cc(i))
249246

src/common/include/ExtrusionHardcodedIC.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
!> @brief Allocate memory and read initial condition data for IC extrusion.
1+
!> Allocate memory and read initial condition data for IC extrusion.
22
!>
33
!> @details
44
!> This macro handles the complete initialization process for IC extrusion by:

src/common/include/macros.fpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
#ifdef MFC_SIMULATION
2020
#ifdef __NVCOMPILER_GPU_UNIFIED_MEM
2121
block
22-
! Beginning in the 25.3 release, the structure of the cudafor module has been changed slightly. The module now includes, or
23-
! "uses" 3 submodules: cuda_runtime_api, gpu_reductions, and sort. The cudafor functionality has not changed. But for new
24-
! users, or users who have needed to work-around name conflicts in the module, it may be better to use cuda_runtime_api to
25-
! expose interfaces to the CUDA runtime calls described in Chapter 4 of this guide.
22+
! NVIDIA CUDA Fortran 25.3+: uses submodules (cuda_runtime_api, gpu_reductions, sort) See
2623
! https://docs.nvidia.com/hpc-sdk/compilers/cuda-fortran-prog-guide/index.html#fortran-host-modules
2724
#if __NVCOMPILER_MAJOR__ < 25 || (__NVCOMPILER_MAJOR__ == 25 && __NVCOMPILER_MINOR__ < 3)
2825
use cudafor, gpu_sum => sum, gpu_maxval => maxval, gpu_minval => minval
@@ -58,6 +55,7 @@
5855
#endif
5956
#:enddef
6057
58+
! Allocate and create GPU device memory
6159
#:def ALLOCATE(*args)
6260
@:LOG({'@:ALLOCATE(${re.sub(' +', ' ', ', '.join(args))}$)'})
6361
#:set allocated_variables = ', '.join(args)
@@ -77,13 +75,15 @@
7775
$:GPU_ENTER_DATA(create='[' + joined + ']')
7876
#:enddef ALLOCATE
7977
78+
! Free GPU device memory and deallocate
8079
#:def DEALLOCATE(*args)
8180
@:LOG({'@:DEALLOCATE(${re.sub(' +', ' ', ', '.join(args))}$)'})
8281
#:set allocated_variables = ', '.join(args)
8382
$:GPU_EXIT_DATA(delete=('[' + allocated_variables + ']'))
8483
deallocate (${allocated_variables}$)
8584
#:enddef DEALLOCATE
8685
86+
! Cray-specific GPU pointer setup for vector fields
8787
#:def ACC_SETUP_VFs(*args)
8888
#ifdef _CRAYFTN
8989
block
@@ -107,6 +107,7 @@
107107
#endif
108108
#:enddef
109109
110+
! Cray-specific GPU pointer setup for scalar fields
110111
#:def ACC_SETUP_SFs(*args)
111112
#ifdef _CRAYFTN
112113
block
@@ -122,6 +123,7 @@
122123
#endif
123124
#:enddef
124125
126+
! Cray-specific GPU pointer setup for acoustic source spatials
125127
#:def ACC_SETUP_source_spatials(*args)
126128
#ifdef _CRAYFTN
127129
block

src/common/include/parallel_macros.fpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#:include 'omp_macros.fpp'
33
#:include 'acc_macros.fpp'
44

5+
! GPU parallel region (scalar reductions, maxval/minval)
56
#:def GPU_PARALLEL(code, private=None, default='present', firstprivate=None, reduction=None, reductionOp=None, &
67
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
78
& no_create=None, present=None, deviceptr=None, attach=None, extraAccArgs=None, extraOmpArgs=None)
@@ -20,6 +21,7 @@
2021
#endif
2122
#:enddef
2223

24+
! GPU parallel loop over threads (most common GPU macro)
2325
#:def GPU_PARALLEL_LOOP(collapse=None, private=None, parallelism='[gang, vector]', &
2426
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
2527
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
@@ -39,6 +41,7 @@
3941
#endif
4042
#:enddef
4143

44+
! Required closing for GPU_PARALLEL_LOOP
4245
#:def END_GPU_PARALLEL_LOOP()
4346
#:set acc_end_directive = '!$acc end parallel loop'
4447
#:set omp_end_directive = END_OMP_PARALLEL_LOOP()
@@ -50,6 +53,7 @@
5053
#endif
5154
#:enddef
5255

56+
! Mark routine for device compilation
5357
#:def GPU_ROUTINE(function_name=None, parallelism=None, nohost=False, cray_inline=False, cray_noinline=False, extraAccArgs=None, &
5458
& extraOmpArgs=None)
5559
#:assert isinstance(cray_inline, bool)
@@ -106,6 +110,7 @@
106110
#:endif
107111
#:enddef
108112

113+
! Declare device-resident data
109114
#:def GPU_DECLARE(copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, present=None, deviceptr=None, &
110115
& link=None, extraAccArgs=None, extraOmpArgs=None)
111116
#:set acc_code = ACC_DECLARE(copy=copy, copyin=copyin, copyinReadOnly=copyinReadOnly, copyout=copyout, create=create, &
@@ -123,6 +128,7 @@
123128
#endif
124129
#:enddef
125130

131+
! Inner loop within a GPU parallel region
126132
#:def GPU_LOOP(collapse=None, parallelism=None, data_dependency=None, reduction=None, reductionOp=None, private=None, &
127133
& extraAccArgs=None, extraOmpArgs=None)
128134
#:set acc_code = ACC_LOOP(collapse=collapse, parallelism=parallelism, data_dependency=data_dependency, reduction=reduction, &
@@ -137,6 +143,7 @@
137143
#endif
138144
#:enddef
139145

146+
! Scoped GPU data region
140147
#:def GPU_DATA(code, copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, no_create=None, present=None, &
141148
& deviceptr=None, attach=None, default=None, extraAccArgs=None, extraOmpArgs=None)
142149
#:set acc_code = ACC_DATA(code=code, copy=copy, copyin=copyin, copyinReadOnly=copyinReadOnly, copyout=copyout, create=create, &
@@ -155,6 +162,7 @@
155162
#endif
156163
#:enddef
157164

165+
! Host code with device pointers (for MPI with GPU buffers)
158166
#:def GPU_HOST_DATA(code, use_device_addr=None, use_device_ptr=None, extraAccArgs=None, extraOmpArgs=None)
159167
#:if use_device_addr is not None and use_device_ptr is not None
160168
#:set use_device_addr_end_index = len(use_device_addr) - 1
@@ -183,6 +191,7 @@
183191
#endif
184192
#:enddef
185193

194+
! Allocate device memory (unscoped)
186195
#:def GPU_ENTER_DATA(copyin=None, copyinReadOnly=None, create=None, attach=None, extraAccArgs=None, extraOmpArgs=None)
187196
#:set acc_code = ACC_ENTER_DATA(copyin=copyin, copyinReadOnly=copyinReadOnly, create=create, attach=attach, &
188197
& extraAccArgs=extraAccArgs)
@@ -196,6 +205,7 @@
196205
#endif
197206
#:enddef
198207

208+
! Free device memory
199209
#:def GPU_EXIT_DATA(copyout=None, delete=None, detach=None, extraAccArgs=None, extraOmpArgs=None)
200210
#:set acc_code = ACC_EXIT_DATA(copyout=copyout, delete=delete, detach=detach, extraAccArgs=extraAccArgs)
201211
#:set omp_code = OMP_EXIT_DATA(copyout=copyout, delete=delete, detach=detach, extraOmpArgs=extraOmpArgs)
@@ -207,6 +217,7 @@
207217
#endif
208218
#:enddef
209219

220+
! Atomic operation on device
210221
#:def GPU_ATOMIC(atomic, extraAccArgs=None, extraOmpArgs=None)
211222
#:set acc_code = ACC_ATOMIC(atomic=atomic, extraAccArgs=extraAccArgs)
212223
#:set omp_code = OMP_ATOMIC(atomic=atomic, extraOmpArgs=extraOmpArgs)
@@ -218,6 +229,7 @@
218229
#endif
219230
#:enddef
220231

232+
! End atomic capture block
221233
#:def END_GPU_ATOMIC_CAPTURE()
222234
#:set acc_end_directive = '!$acc end atomic'
223235
#:set omp_end_directive = '!$omp end atomic'
@@ -228,6 +240,7 @@
228240
#endif
229241
#:enddef
230242

243+
! Copy data between host and device
231244
#:def GPU_UPDATE(host=None, device=None, extraAccArgs=None, extraOmpArgs=None)
232245
#:set acc_code = ACC_UPDATE(host=host, device=device, extraAccArgs=extraAccArgs)
233246
#:set omp_code = OMP_UPDATE(host=host, device=device, extraOmpArgs=extraOmpArgs)
@@ -239,6 +252,7 @@
239252
#endif
240253
#:enddef
241254

255+
! Synchronization barrier
242256
#:def GPU_WAIT(extraAccArgs=None, extraOmpArgs=None)
243257
#:set acc_code = ACC_WAIT(extraAccArgs=extraAccArgs)
244258
#:set omp_code = OMP_WAIT(extraOmpArgs=extraOmpArgs)
@@ -250,6 +264,7 @@
250264
#endif
251265
#:enddef
252266

267+
! Import GPU library module (openacc or omp_lib)
253268
#:def USE_GPU_MODULE()
254269
#if defined(MFC_OpenACC)
255270
use openacc
@@ -258,24 +273,28 @@
258273
#endif
259274
#:enddef
260275

276+
! Emit code only for AMD compiler
261277
#:def DEF_AMD(code)
262278
#:if MFC_COMPILER == AMD_COMPILER_ID
263279
$:code
264280
#:endif
265281
#:enddef
266282

283+
! Emit code for non-Cray compilers
267284
#:def UNDEF_CCE(code)
268285
#:if MFC_COMPILER != CCE_COMPILER_ID
269286
$:code
270287
#:endif
271288
#:enddef
272289

290+
! Emit code only for Cray compiler
273291
#:def DEF_CCE(code)
274292
#:if MFC_COMPILER == CCE_COMPILER_ID
275293
$:code
276294
#:endif
277295
#:enddef
278296

297+
! Emit code for non-NVIDIA compilers
279298
#:def UNDEF_NVIDIA(code)
280299
#:if MFC_COMPILER != NVIDIA_COMPILER_ID and MFC_COMPILER != PGI_COMPILER_ID
281300
$:code

0 commit comments

Comments
 (0)