Skip to content

Commit d7b4830

Browse files
authored
Merge branch 'master' into cantera-pyro
2 parents 13edff8 + cb856f7 commit d7b4830

Some content is hidden

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

62 files changed

+11298
-11180
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ sbatch <<EOT
4242
#SBATCH --account=gts-sbryngelson3 # charge account
4343
#SBATCH -N1 # Number of nodes required
4444
$sbatch_device_opts
45-
#SBATCH -t 02:00:00 # Duration of the job (Ex: 15 mins)
45+
#SBATCH -t 03:00:00 # Duration of the job (Ex: 15 mins)
4646
#SBATCH -q embers # QOS Name
4747
#SBATCH -o$job_slug.out # Combined output and error messages file
4848
#SBATCH -W # Do not exit until the submitted job terminates.

docs/documentation/case.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,7 @@ Details of the transducer acoustic source model can be found in [Maeda and Colon
745745
| `mu_v`| Real | Viscosity |
746746
| `k_v`| Real | Thermal conductivity |
747747
| `cp_v`| Real | Specific heat capacity |
748+
| `D_v`| Real | Vapor diffusivity in the gas |
748749

749750
These options work only for gas-liquid two-component flows.
750751
Component indexes are required to be 1 for liquid and 2 for gas.
@@ -836,7 +837,6 @@ When ``polytropic = 'F'``, the gas compression is modeled as non-polytropic due
836837
| `T0` | Real | Reference temperature |
837838
| `x0` | Real | Reference length |
838839
| `Thost` | Real | Temperature of the surrounding liquid (host) |
839-
| `diffcoefvap` | Real | Vapor diffusivity in the gas |
840840

841841
- `nBubs_glb` Total number of bubbles. Their initial conditions need to be specified in the ./input/lag_bubbles.dat file. See the example cases for additional information.
842842

docs/documentation/gpuParallelization.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,16 @@ Note: Ordering is not guaranteed or stable, so use key-value pairing when using
4444

4545
**Macro Invocation**
4646

47-
Uses FYPP eval directive using `#:call`
47+
In order to parallelize a loop, simply place two macro calls on either end of the loop:
4848

4949
```C
50-
#:call GPU_PARALLEL_LOOP(...)
50+
$:$GPU_PARALLEL_LOOP(...)
5151
{code}
52-
#:endcall GPU_PARALLEL_LOOP
52+
$:END_GPU_PARALLEL_LOOP()
5353
```
5454
55+
This wraps the lines in `code` with parallelization calls to openACC or openMP, depending on environment and compiler settings.
56+
5557
**Parameters**
5658
5759
| name | data type | Default Value | description |

examples/1D_qbmm/case.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
M_n = 28.97
2626
mu_n = 1.8e-05
2727
k_n = 0.02556
28+
D = 0.242e-4
2829

2930
# air props
3031
# gamma_gas = gamma_n
@@ -163,6 +164,7 @@
163164
"fluid_pp(2)%M_v": M_n,
164165
"fluid_pp(2)%mu_v": mu_n,
165166
"fluid_pp(2)%k_v": k_n,
167+
"fluid_pp(2)%D_v": D,
166168
# Non-polytropic gas compression model AND/OR Tait EOS
167169
"pref": p0,
168170
"rhoref": rho0,

examples/3D_lagrange_bubblescreen/case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@
155155
"lag_params%rho0": rho0,
156156
"lag_params%T0": T0,
157157
"lag_params%x0": x0,
158-
"lag_params%diffcoefvap": diffVapor,
159158
"lag_params%Thost": T_host,
160159
# Fluids Physical Parameters
161160
# Host medium
@@ -177,6 +176,7 @@
177176
"fluid_pp(2)%M_v": MW_g,
178177
"fluid_pp(2)%k_v": k_g,
179178
"fluid_pp(2)%cp_v": cp_g,
179+
"fluid_pp(2)%D_v": diffVapor,
180180
}
181181
)
182182
)

examples/3D_lagrange_shbubcollapse/case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@
157157
"lag_params%rho0": rho0,
158158
"lag_params%T0": T0,
159159
"lag_params%x0": x0,
160-
"lag_params%diffcoefvap": diffVapor,
161160
"lag_params%Thost": T_host,
162161
# Fluids Physical Parameters
163162
# Host medium
@@ -179,6 +178,7 @@
179178
"fluid_pp(2)%M_v": MW_g,
180179
"fluid_pp(2)%k_v": k_g,
181180
"fluid_pp(2)%cp_v": cp_g,
181+
"fluid_pp(2)%D_v": diffVapor,
182182
}
183183
)
184184
)

src/common/include/acc_macros.fpp

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
$:end_acc_directive
130130
#:enddef
131131

132-
#:def ACC_PARALLEL_LOOP(code, collapse=None, private=None, parallelism='[gang, vector]', &
132+
#:def ACC_PARALLEL_LOOP_OLD(code, collapse=None, private=None, parallelism='[gang, vector]', &
133133
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
134134
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
135135
& no_create=None, present=None, deviceptr=None, attach=None, extraAccArgs=None)
@@ -161,6 +161,35 @@
161161
$:acc_end_directive
162162
#:enddef
163163

164+
#:def ACC_PARALLEL_LOOP(collapse=None, private=None, parallelism='[gang, vector]', &
165+
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
166+
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
167+
& no_create=None, present=None, deviceptr=None, attach=None, extraAccArgs=None)
168+
#:set collapse_val = GEN_COLLAPSE_STR(collapse)
169+
#:set parallelism_val = GEN_PARALLELISM_STR(parallelism)
170+
#:set default_val = GEN_DEFAULT_STR(default)
171+
#:set private_val = GEN_PRIVATE_STR(private, False).strip('\n') + GEN_PRIVATE_STR(firstprivate, True).strip('\n')
172+
#:set reduction_val = GEN_REDUCTION_STR(reduction, reductionOp)
173+
#:set copy_val = GEN_COPY_STR(copy)
174+
#:set copyin_val = GEN_COPYIN_STR(copyin, False).strip('\n') + GEN_COPYIN_STR(copyinReadOnly, True).strip('\n')
175+
#:set copyout_val = GEN_COPYOUT_STR(copyout)
176+
#:set create_val = GEN_CREATE_STR(create)
177+
#:set no_create_val = GEN_NOCREATE_STR(no_create)
178+
#:set present_val = GEN_PRESENT_STR(present)
179+
#:set deviceptr_val = GEN_DEVICEPTR_STR(deviceptr)
180+
#:set attach_val = GEN_ATTACH_STR(attach)
181+
#:set extraAccArgs_val = GEN_EXTRA_ARGS_STR(extraAccArgs)
182+
#:set clause_val = collapse_val.strip('\n') + parallelism_val.strip('\n') + &
183+
& default_val.strip('\n') + private_val.strip('\n') + reduction_val.strip('\n') + &
184+
& copy_val.strip('\n') + copyin_val.strip('\n') + &
185+
& copyout_val.strip('\n') + create_val.strip('\n') + &
186+
& no_create_val.strip('\n') + present_val.strip('\n') + &
187+
& deviceptr_val.strip('\n') + attach_val.strip('\n')
188+
#:set acc_directive = '!$acc parallel loop ' + &
189+
& clause_val + extraAccArgs_val.strip('\n')
190+
$:acc_directive
191+
#:enddef
192+
164193
#:def ACC_ROUTINE(function_name=None, parallelism=None, nohost=False, extraAccArgs=None)
165194
#:set parallelism_val = GEN_PARALLELISM_STR(parallelism)
166195
#:assert isinstance(nohost, bool)
@@ -308,4 +337,4 @@
308337
#:set acc_directive = '!$acc wait ' + clause_val + extraAccArgs_val.strip('\n')
309338
$:acc_directive
310339
#:enddef
311-
! New line at end of file is required for FYPP
340+
! New line at end of file is required for FYPP

src/common/include/omp_macros.fpp

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
$:omp_end_directive
150150
#:enddef
151151

152-
#:def OMP_PARALLEL_LOOP(code, collapse=None, private=None, parallelism='[gang, vector]', &
152+
#:def OMP_PARALLEL_LOOP_OLD(code, collapse=None, private=None, parallelism='[gang, vector]', &
153153
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
154154
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
155155
& no_create=None, present=None, deviceptr=None, attach=None, extraOmpArgs=None)
@@ -196,6 +196,62 @@
196196
$:omp_end_directive
197197
#:enddef
198198

199+
#:def OMP_PARALLEL_LOOP(collapse=None, private=None, parallelism='[gang, vector]', &
200+
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
201+
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
202+
& no_create=None, present=None, deviceptr=None, attach=None, extraOmpArgs=None)
203+
204+
#:set collapse_val = GEN_COLLAPSE_STR(collapse)
205+
#:set parallelism_val = OMP_PARALLELISM_STR(parallelism)
206+
#:set default_val = OMP_DEFAULT_STR(default)
207+
#:set private_val = GEN_PRIVATE_STR(private, False).strip('\n') + GEN_PRIVATE_STR(firstprivate, True).strip('\n')
208+
#:set reduction_val = GEN_REDUCTION_STR(reduction, reductionOp)
209+
#:set copy_val = OMP_COPY_STR(copy)
210+
#:set copyin_val = OMP_COPYIN_STR(copyin).strip('\n') + OMP_COPYIN_STR(copyinReadOnly).strip('\n')
211+
#:set copyout_val = OMP_COPYOUT_STR(copyout)
212+
#:set create_val = OMP_CREATE_STR(create)
213+
#:set no_create_val = OMP_NOCREATE_STR(no_create)
214+
#:set present_val = OMP_PRESENT_STR(present)
215+
#:set deviceptr_val = OMP_DEVICEPTR_STR(deviceptr)
216+
#:set attach_val = OMP_MAP_STR('always,tofrom', attach)
217+
#:set extraOmpArgs_val = GEN_EXTRA_ARGS_STR(extraOmpArgs)
218+
#:set clause_val = collapse_val.strip('\n') + parallelism_val.strip('\n') + &
219+
& default_val.strip('\n') + private_val.strip('\n') + reduction_val.strip('\n') + &
220+
& copy_val.strip('\n') + copyin_val.strip('\n') + &
221+
& copyout_val.strip('\n') + create_val.strip('\n') + &
222+
& no_create_val.strip('\n') + present_val.strip('\n') + &
223+
& deviceptr_val.strip('\n') + attach_val.strip('\n')
224+
#! Hardcoding the parallelism for now
225+
226+
#:if MFC_COMPILER == NVIDIA_COMPILER_ID or MFC_COMPILER == PGI_COMPILER_ID
227+
#:set omp_start_directive = '!$omp target teams loop defaultmap(firstprivate:scalar) bind(teams,parallel) '
228+
#:elif MFC_COMPILER == CCE_COMPILER_ID
229+
#:set omp_start_directive = '!$omp target teams distribute parallel do simd defaultmap(firstprivate:scalar) '
230+
#:elif MFC_COMPILER == AMD_COMPILER_ID
231+
#:set omp_start_directive = '!$omp target teams distribute parallel do '
232+
#:else
233+
#:set omp_start_directive = '!$omp target teams loop defaultmap(firstprivate:scalar) bind(teams,parallel) '
234+
#:endif
235+
236+
#:set omp_directive = omp_start_directive + clause_val + extraOmpArgs_val.strip('\n')
237+
$:omp_directive
238+
#:enddef
239+
240+
#:def END_OMP_PARALLEL_LOOP()
241+
242+
#:if MFC_COMPILER == NVIDIA_COMPILER_ID or MFC_COMPILER == PGI_COMPILER_ID
243+
#:set omp_end_directive = '!$omp end target teams loop'
244+
#:elif MFC_COMPILER == CCE_COMPILER_ID
245+
#:set omp_end_directive = '!$omp end target teams distribute parallel do simd'
246+
#:elif MFC_COMPILER == AMD_COMPILER_ID
247+
#:set omp_end_directive = '!$omp end target teams distribute parallel do'
248+
#:else
249+
#:set omp_end_directive = '!$omp end target teams loop'
250+
#:endif
251+
252+
$:omp_end_directive
253+
#:enddef
254+
199255
#:def OMP_ROUTINE(function_name, nohost, extraOmpArgs)
200256
#:assert isinstance(nohost, bool)
201257
#:if nohost == True

src/common/include/parallel_macros.fpp

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

2020
#:enddef
2121

22-
#:def GPU_PARALLEL_LOOP(code, collapse=None, private=None, parallelism='[gang, vector]', &
22+
#:def GPU_PARALLEL_LOOP_OLD(code, collapse=None, private=None, parallelism='[gang, vector]', &
2323
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
2424
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
2525
& no_create=None, present=None, deviceptr=None, attach=None, extraAccArgs=None, extraOmpArgs=None)
2626

27-
#:set acc_code = ACC_PARALLEL_LOOP(code, collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraAccArgs)
28-
#:set omp_code = OMP_PARALLEL_LOOP(code, collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraOmpArgs)
27+
#:set acc_code = ACC_PARALLEL_LOOP_OLD(code, collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraAccArgs)
28+
#:set omp_code = OMP_PARALLEL_LOOP_OLD(code, collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraOmpArgs)
2929

3030
#if defined(MFC_OpenACC)
3131
$:acc_code
@@ -36,6 +36,35 @@
3636
#endif
3737
#:enddef
3838

39+
#:def GPU_PARALLEL_LOOP(collapse=None, private=None, parallelism='[gang, vector]', &
40+
& default='present', firstprivate=None, reduction=None, reductionOp=None, &
41+
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
42+
& no_create=None, present=None, deviceptr=None, attach=None, extraAccArgs=None, extraOmpArgs=None)
43+
44+
#:set acc_directive = ACC_PARALLEL_LOOP(collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraAccArgs)
45+
#:set omp_directive = OMP_PARALLEL_LOOP(collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraOmpArgs)
46+
47+
#if defined(MFC_OpenACC)
48+
$:acc_directive
49+
#elif defined(MFC_OpenMP)
50+
$:omp_directive
51+
#endif
52+
53+
#:enddef
54+
55+
#:def END_GPU_PARALLEL_LOOP()
56+
57+
#:set acc_end_directive = '!$acc end parallel loop'
58+
#:set omp_end_directive = END_OMP_PARALLEL_LOOP()
59+
60+
#if defined(MFC_OpenACC)
61+
$:acc_end_directive
62+
#elif defined(MFC_OpenMP)
63+
$:omp_end_directive
64+
#endif
65+
66+
#:enddef
67+
3968
#:def GPU_ROUTINE(function_name=None, parallelism=None, nohost=False, cray_inline=False, extraAccArgs=None, extraOmpArgs=None)
4069
#:assert isinstance(cray_inline, bool)
4170
#:set acc_directive = ACC_ROUTINE(function_name=function_name, parallelism=parallelism, nohost=nohost, extraAccArgs=extraAccArgs)

src/common/include/shared_parallel_macros.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@
107107
#:endif
108108
$:extraArgs_val
109109
#:enddef
110-
! New line at end of file is required for FYPP
110+
! New line at end of file is required for FYPP

0 commit comments

Comments
 (0)