Skip to content

Commit ddb3edd

Browse files
wilfonbasbryngelsonhenryleberre
authored
More and Longer Benchmarks (#379)
Co-authored-by: Spencer Bryngelson <[email protected]> Co-authored-by: Ben Wilfong <[email protected]> Co-authored-by: Henry LE BERRE <[email protected]>
1 parent 36d989f commit ddb3edd

File tree

9 files changed

+644
-53
lines changed

9 files changed

+644
-53
lines changed

.github/workflows/phoenix/bench.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ if [ "$job_device" == "gpu" ]; then
88
device_opts="--gpu -g $gpu_ids"
99
fi
1010

11-
./mfc.sh bench -j $(nproc) -o "$job_slug.yaml" -- -c phoenix $device_opts -n $n_ranks
11+
if ["$job_device" == "gpu"]; then
12+
./mfc.sh bench --mem 8 -j $(nproc) -o "$job_slug.yaml" -- -c phoenix $device_opts -n $n_ranks
13+
else
14+
./mfc.sh bench --mem 1 -j $(nproc) -o "$job_slug.yaml" -- -c phoenix $device_opts -n $n_ranks
15+
fi

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,26 @@ examples/*/*.err
5252
examples/*/viz/
5353
examples/*.jpg
5454
examples/*.png
55+
56+
benchmarks/*batch/*/
57+
benchmarks/*/D/*
58+
benchmarks/*/p*
59+
benchmarks/*/D_*
60+
benchmarks/*/*.inf
61+
benchmarks/*/*.inp
62+
benchmarks/*/*.dat
63+
benchmarks/*/*.o*
64+
benchmarks/*/silo*
65+
benchmarks/*/restart_data*
66+
benchmarks/*/*.out
67+
benchmarks/*/binary
68+
benchmarks/*/fort.1
69+
benchmarks/*/*.sh
70+
benchmarks/*/*.err
71+
benchmarks/*/viz/
72+
benchmarks/*.jpg
73+
benchmarks/*.png
74+
5575
*.mod
5676

5777
# Video Files

benchmarks/3D_shockdroplet/case.py renamed to benchmarks/5eq_rk3_weno3_hllc/case.py

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
#!/usr/bin/env python3
22

3-
import math
4-
import json
3+
# Benchmark model_equations_2_time_stepper_3_weno_order_3_riemann_solver_2
4+
# Additional Benchmarked Features
5+
# - model_equations : 2
6+
# - time_stepper : 3
7+
# - weno_order : 3
8+
# - riemann_solver : 2
9+
10+
import json, math, argparse
11+
12+
parser = argparse.ArgumentParser(
13+
prog="Benchmarking Case 1",
14+
description="This MFC case was created for the purposes of benchmarking MFC.",
15+
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
16+
17+
parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS)
18+
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.")
19+
20+
ARGS = vars(parser.parse_args())
21+
DICT = json.loads(ARGS["dict"])
22+
23+
size = 1 if DICT["gpu"] else 0
24+
25+
ppg = 8000000 / 16.0
26+
procs = DICT["nodes"] * DICT["tasks_per_node"]
27+
ncells = math.floor(ppg * procs * ARGS["gbpp"])
28+
s = math.floor((ncells / 2.0) ** (1/3))
29+
Nx, Ny, Nz = 2*s, s, s
530

631
# athmospheric pressure - Pa (used as reference value)
732
patm = 101325
@@ -13,10 +38,9 @@
1338
CtD = 0.06
1439

1540
# cavity relative eccentricity (distance between radii)
16-
ecc = 0.564
41+
ecc = 0.564
1742

18-
# initial shock distance from the y axis. Note that the droplet center is located at y = 0.
19-
# Thus, the distance from the shock to
43+
# initial shock distance from the y axis. Note that the droplet center is located at y = 0. Thus, the distance from the shock to
2044
# the droplet is about D0/8
2145
ISD = 5.0/8 * D0
2246

@@ -26,10 +50,10 @@
2650
p0a = patm
2751

2852
# density - kg/m3
29-
rho0a = 1.204
53+
rho0a = 1.204
3054

3155
# gamma
32-
gama = 1.40
56+
gama = 1.40
3357

3458
# pi infinity - Pa
3559
pia = 0
@@ -52,15 +76,15 @@
5276
rho0w = 1000
5377

5478
# gama
55-
gamw = 6.12
79+
gamw = 6.12
5680

5781
# pi infty - Pa
5882
piw = 3.43E+08
5983

6084
# speed of sound - m/s
6185
c_w = math.sqrt( gamw * ( p0w + piw ) / rho0w )
6286

63-
# Shock Mach number of interest. Note that the post-shock properties can be defined in terms of either
87+
# Shock Mach number of interest. Note that the post-shock properties can be defined in terms of either
6488
# Min or psOp0a. Just comment/uncomment appropriatelly
6589
Min = 2.4
6690

@@ -71,7 +95,7 @@
7195
# psOp0a = 4.5
7296

7397
# density
74-
rhosOrho0a = ( 1 + ( gama + 1 ) / ( gama - 1) * psOp0a ) / ( ( gama + 1 ) / ( gama - 1) + psOp0a )
98+
rhosOrho0a = ( 1 + ( gama + 1 ) / ( gama - 1) * psOp0a ) / ( ( gama + 1 ) / ( gama - 1) + psOp0a )
7599

76100
# Mach number of the shocked region - just a checker, as it must return "Min"
77101
Ms = math.sqrt( ( gama + 1. ) / ( 2. * gama ) * ( psOp0a - 1. ) * ( p0a / ( p0a + pia ) ) + 1. )
@@ -88,7 +112,7 @@
88112
rhos = rhosOrho0a * rho0a
89113

90114
# post shock speed of sound - m/s
91-
c_s = math.sqrt( gama * (ps + pia) / rhos )
115+
c_s = math.sqrt( gama * (ps + pia) / rhos )
92116

93117
# velocity at the post shock - m/s
94118
vel = c_a/gama * (psOp0a - 1.) * p0a / ( p0a + pia ) / Ms
@@ -111,21 +135,12 @@
111135
ze = 10 * D0
112136

113137
# Stretching factor, to make sure the domaing is sufficiently large after the mesh stretch
114-
StF = 4.0
115-
116-
# number of elements into y direction
117-
Ny = 100
118-
119-
# number of elements into z direction
120-
Nz = 100
121-
122-
# number of elements into x direction
123-
Nx = Ny * 2
138+
StF = 4.0
124139

125140
# grid delta x if mesh were uniform in x direction - m. Note that I do not need a measure for dy
126141
dx = ( xe - xb ) / Nx
127142

128-
# I calculating tend twice; first is an estimate, second is
143+
# I calculate tend twice; first is an estimate, second is
129144
# the actual value used. This is because I am getting errors in the
130145
# post process part every time I approximate the actual Nt by an integer
131146
# number (think of a smarter way).
@@ -137,12 +152,10 @@
137152
# mismatches in simulation and post_process parts. Note that I wrote it this way so I have better control over the # of autosaves
138153
tendA = ttilde * D0 / vel
139154

140-
# "CFL" number that I use to control both temporal and spatial discretizations, such that the ratio dx/dt remains constant for a given
141-
# simulation
142-
cfl = 0.05
155+
cfl = 0.1
143156

144157
# time-step - s
145-
dt = cfl * dx/ ss
158+
dt = dx * cfl/ ss
146159

147160
# Save Frequency. Note that the number of autosaves will be SF + 1, as th IC (0.dat) is also saved
148161
SF = 400
@@ -173,26 +186,14 @@
173186
'y_domain%end' : ye,
174187
'z_domain%beg' : zb,
175188
'z_domain%end' : ze,
176-
'stretch_x' : 'T',
177-
'a_x' : 20,
178-
'x_a' : -1.2 * D0,
179-
'x_b' : 1.2 * D0,
180-
'stretch_y' : 'T',
181-
'a_y' : 20,
182-
'y_a' : -0.0 * D0,
183-
'y_b' : 1.2 * D0,
184-
'stretch_z' : 'T',
185-
'a_z' : 20,
186-
'z_a' : -0.0 * D0,
187-
'z_b' : 1.2 * D0,
188189
'm' : Nx,
189190
'n' : Ny,
190191
'p' : Nz,
191192
'cyl_coord' : 'F',
192193
'dt' : dt,
193194
't_step_start' : 0,
194-
't_step_stop' : 100,
195-
't_step_save' : 100,
195+
't_step_stop' : int(60*(95*size + 5)),
196+
't_step_save' : int(12*(95*size + 5)),
196197
# ==========================================================
197198

198199
# Simulation Algorithm Parameters ==========================
@@ -211,7 +212,7 @@
211212
'mapped_weno' : 'T',
212213
'riemann_solver' : 2,
213214
'wave_speeds' : 1,
214-
'avg_state' : 2,
215+
'avg_state' : 2,
215216
'bc_x%beg' : -6,
216217
'bc_x%end' : -6,
217218
'bc_y%beg' : -2,
@@ -226,7 +227,7 @@
226227
'prim_vars_wrt' :'T',
227228
'parallel_io' :'T',
228229
# ==========================================================
229-
# I will use 1 for WATER properties, and 2 for AIR properties
230+
# I will use 1 for WATER properties, and 2 for AIR properties
230231
# Patch 1: Background (AIR - 2) =============================
231232
'patch_icpp(1)%geometry' : 9,
232233
'patch_icpp(1)%x_centroid' : (xb+xe) / 2 * StF,
@@ -280,7 +281,6 @@
280281
'patch_icpp(3)%alpha(1)' : 1.0E+00,
281282
'patch_icpp(3)%alpha(2)' : 0.0E+00,
282283
# ==========================================================
283-
284284

285285
# Fluids Physical Parameters ===============================
286286
'fluid_pp(1)%gamma' : 1.0E+00/(gamw-1),
@@ -291,3 +291,4 @@
291291
}))
292292

293293
# ==============================================================================
294+

benchmarks/hypo_hll/case.py

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
#!/usr/bin/env python3
2+
3+
# Benchmark hypoelasticity_T_riemann_solver_1
4+
# Additional Benchmarked Features
5+
# - hypoelasticity : T
6+
# - riemann_solver : 1
7+
8+
import json, math, argparse
9+
10+
parser = argparse.ArgumentParser(
11+
prog="Benchmarkin Case 3",
12+
description="This MFC case was created for the purposes of benchmarking MFC.",
13+
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
14+
15+
parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS)
16+
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.")
17+
18+
ARGS = vars(parser.parse_args())
19+
DICT = json.loads(ARGS["dict"])
20+
21+
size = 1 if DICT["gpu"] else 0
22+
23+
ppg = 8000000 / 16.0
24+
procs = DICT["nodes"] * DICT["tasks_per_node"]
25+
ncells = math.floor(ppg * procs * ARGS["gbpp"])
26+
s = math.floor((ncells / 2.0) ** (1/3))
27+
Nx, Ny, Nz = 2*s, s, s
28+
29+
Mu = 1.84E-05
30+
gam_a = 1.4
31+
32+
D = 0.1
33+
34+
# Configuring case dictionary
35+
print(json.dumps({
36+
# Logistics ================================================================
37+
'run_time_info' : 'T',
38+
# ==========================================================================
39+
40+
# Computational Domain Parameters ==========================================
41+
# x direction
42+
'x_domain%beg' : -5*D,
43+
'x_domain%end' : 5.0*D,
44+
# y direction
45+
'y_domain%beg' : -2.5*D,
46+
'y_domain%end' : 2.5*D,
47+
# z direction
48+
'z_domain%beg' : -2.5*D,
49+
'z_domain%end' : 2.5*D,
50+
51+
'cyl_coord' : 'F',
52+
'm' : Nx,
53+
'n' : Ny,
54+
'p' : Nz,
55+
'dt' : 1.0E-7,
56+
't_step_start' : 0,
57+
't_step_stop' : int(20*(45*size + 5)),
58+
't_step_save' : int(4*(45*size + 5)),
59+
# ==========================================================================
60+
61+
# Simulation Algorithm Parameters ==========================================
62+
# Only one patches are necessary, the air tube
63+
'num_patches' : 1,
64+
# Use the 5 equation model
65+
'model_eqns' : 2,
66+
# 6 equations model does not need the K \div(u) term
67+
'alt_soundspeed' : 'F',
68+
# One fluids: air
69+
'num_fluids' : 1,
70+
# Advect both volume fractions
71+
'adv_alphan' : 'T',
72+
# No need to ensure the volume fractions sum to unity at the end of each
73+
# time step
74+
'mpp_lim' : 'F',
75+
# Correct errors when computing speed of sound
76+
'mixture_err' : 'T',
77+
# Use TVD RK3 for time marching
78+
'time_stepper' : 3,
79+
# Reconstruct the primitive variables to minimize spurious
80+
# Use WENO5
81+
'weno_order' : 5,
82+
'weno_eps' : 1.E-16,
83+
'weno_Re_flux' : 'T',
84+
'weno_avg' : 'T',
85+
'avg_state' : 2,
86+
'mapped_weno' : 'T',
87+
'null_weights' : 'F',
88+
'mp_weno' : 'T',
89+
'riemann_solver' : 2,
90+
'wave_speeds' : 1,
91+
# We use ghost-cell extrapolation
92+
'bc_x%beg' : -3,
93+
'bc_x%end' : -3,
94+
'bc_y%beg' : -3,
95+
'bc_y%end' : -3,
96+
'bc_z%beg' : -3,
97+
'bc_z%end' : -3,
98+
# Set IB to True and add 1 patch
99+
'ib' : 'T',
100+
'num_ibs' : 1,
101+
# ==========================================================================
102+
103+
# Formatted Database Files Structure Parameters ============================
104+
'format' : 1,
105+
'precision' : 2,
106+
'prim_vars_wrt' :'T',
107+
'E_wrt' :'T',
108+
'parallel_io' :'T',
109+
# ==========================================================================
110+
111+
# Patch: Constant Tube filled with air =====================================
112+
# Specify the cylindrical air tube grid geometry
113+
'patch_icpp(1)%geometry' : 9,
114+
'patch_icpp(1)%x_centroid' : 0.0,
115+
# Uniform medium density, centroid is at the center of the domain
116+
'patch_icpp(1)%y_centroid' : 0.0,
117+
'patch_icpp(1)%z_centroid' : 0.0,
118+
'patch_icpp(1)%length_x' : 10*D,
119+
'patch_icpp(1)%length_y' : 5*D,
120+
'patch_icpp(1)%length_z' : 5*D,
121+
# Specify the patch primitive variables
122+
'patch_icpp(1)%vel(1)' : 527.2E+00,
123+
'patch_icpp(1)%vel(2)' : 0.0E+00,
124+
'patch_icpp(1)%vel(3)' : 0.0E+00,
125+
'patch_icpp(1)%pres' : 10918.2549,
126+
'patch_icpp(1)%alpha_rho(1)' : 0.2199,
127+
'patch_icpp(1)%alpha(1)' : 1.E+00,
128+
# # ========================================================================
129+
130+
# Patch: Sphere Immersed Boundary ========================================
131+
'patch_ib(1)%geometry' : 8,
132+
'patch_ib(1)%x_centroid' : -3.0E-3,
133+
'patch_ib(1)%y_centroid' : 0.0,
134+
'patch_ib(1)%z_centroid' : 0.0,
135+
'patch_ib(1)%radius' : D/2,
136+
'patch_ib(1)%slip' : 'T',
137+
# ==========================================================================
138+
139+
# Fluids Physical Parameters ===============================================
140+
'fluid_pp(1)%gamma' : 1.E+00/(gam_a-1.E+00), # 2.50(Not 1.40)
141+
'fluid_pp(1)%pi_inf' : 0,
142+
'fluid_pp(1)%Re(1)' : 7535533.2,
143+
# ==========================================================================
144+
}))

0 commit comments

Comments
 (0)