Skip to content

Commit 5b9a897

Browse files
yzengclaude
andcommitted
Simplify CI tests: reduce from 9 to 3 cases for faster runs
- Keep 3 representative tests: LidDrivenCavity (2D), RSV (2D MPI + level set), DraftingKissingTumbling (3D MPI + particles/IBM) - Add max_step=2 override to all tests to limit simulation time - Disable plot and checkpoint output (amr.plot_int=-1 amr.check_int=-1) - Use shallow git clones (--depth 1) for amrex and AMReX-Hydro - Refactor test script with shared run_test() helper Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 90dbfaf commit 5b9a897

File tree

2 files changed

+41
-146
lines changed

2 files changed

+41
-146
lines changed

.github/workflows/test_IAMReX.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ jobs:
2626
- name: Clone AMReX and AMReX-Hydro repositories
2727
run: |
2828
cd /home/runner/work/IAMReX
29-
git clone https://github.com/AMReX-Codes/amrex.git
30-
git clone https://github.com/AMReX-Fluids/AMReX-Hydro.git
29+
git clone --depth 1 https://github.com/AMReX-Codes/amrex.git
30+
git clone --depth 1 https://github.com/AMReX-Fluids/AMReX-Hydro.git
3131
- name: Run IAMReX tests
3232
run: |
3333
cd /home/runner/work/IAMReX/IAMReX

Test_IAMReX/test_IAMReX.py

Lines changed: 39 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -5,167 +5,62 @@
55
import os
66
import subprocess
77

8-
def test_lidDrivenCanvity(working_dir, print_output):
9-
subprocess.run(
10-
"make -j8 && ./amr2d.gnu.ex inputs.2d.lid_driven_cavity",
11-
shell=True,
12-
check=True,
13-
cwd=working_dir,
14-
stdout=None if print_output else subprocess.DEVNULL,
15-
stderr=None if print_output else subprocess.DEVNULL
16-
)
17-
print("Test_lidDrivenCanvity succeed")
18-
19-
def test_LidDrivenCavitySphere(working_dir, print_output):
20-
subprocess.run(
21-
"make -j8 && ./amr3d.gnu.MPI.ex inputs.3d.lid_driven_cavity_particle",
22-
shell=True,
23-
check=True,
24-
cwd=working_dir,
25-
stdout=None if print_output else subprocess.DEVNULL,
26-
stderr=None if print_output else subprocess.DEVNULL
27-
)
28-
print("Test LidDrivenCavitySphere succeed")
29-
30-
def test_RSV(working_dir, print_output):
31-
subprocess.run(
32-
"make -j8 && ./amr2d.gnu.MPI.ex inputs.2d.rsv",
33-
shell=True,
34-
check=True,
35-
cwd=working_dir,
36-
stdout=None if print_output else subprocess.DEVNULL,
37-
stderr=None if print_output else subprocess.DEVNULL
38-
)
39-
print("Test RSV succeed")
40-
41-
def test_DraftingKissingTumbling(working_dir, print_output):
42-
subprocess.run(
43-
"make -j8 USE_CUDA=FALSE USE_MPI=TRUE DEBUG=FALSE;"
44-
"mpiexec -np 2 ./amr3d.gnu.MPI.ex inputs.3d.DKT max_step=1 amr.n_cell=16 8 8",
45-
shell=True,
46-
check=True,
47-
cwd=working_dir,
48-
stdout=None if print_output else subprocess.DEVNULL,
49-
stderr=None if print_output else subprocess.DEVNULL
50-
)
51-
print("test_DraftingKissingTumbling succeed")
8+
# Common overrides for fast CI runs: minimal steps, small grids, no file output
9+
CI_OVERRIDES = "max_step=2 amr.plot_int=-1 amr.check_int=-1"
5210

53-
def test_FallingSphere(working_dir, print_output):
11+
def run_test (name, working_dir, build_cmd, run_cmd, print_output):
12+
"""Build and run a single test case."""
13+
full_cmd = f"{build_cmd} && {run_cmd}"
5414
subprocess.run(
55-
"make -j8 USE_CUDA=FALSE USE_MPI=TRUE DEBUG=FALSE;"
56-
"mpiexec -np 2 ./amr3d.gnu.MPI.ex inputs.3d.FallingSphere max_step=1 amr.n_cell=16 8 8",
57-
shell=True,
58-
check=True,
59-
cwd=working_dir,
60-
stdout=None if print_output else subprocess.DEVNULL,
61-
stderr=None if print_output else subprocess.DEVNULL
15+
full_cmd,
16+
shell=True,
17+
check=True,
18+
cwd=working_dir,
19+
stdout=None if print_output else subprocess.DEVNULL,
20+
stderr=None if print_output else subprocess.DEVNULL
6221
)
63-
print("test_FallingSphere succeed")
64-
65-
def test_FlowPastCylinder(working_dir, print_output):
66-
subprocess.run(
67-
"make -j8 USE_CUDA=FALSE USE_MPI=TRUE DEBUG=FALSE;"
68-
"mpiexec -np 2 ./amr3d.gnu.MPI.ex inputs.3d.flow_past_cylinder-x max_step=1",
69-
shell=True,
70-
check=True,
71-
cwd=working_dir,
72-
stdout=None if print_output else subprocess.DEVNULL,
73-
stderr=None if print_output else subprocess.DEVNULL
74-
)
75-
print("test_FlowPastCylinder succeed")
76-
77-
def test_FlowPastSphere(working_dir, print_output):
78-
subprocess.run(
79-
"make -j8 USE_CUDA=FALSE USE_MPI=TRUE DEBUG=FALSE;"
80-
"mpiexec -np 2 ./amr3d.gnu.MPI.ex inputs.3d.flow_past_sphere max_step=1 amr.n_cell=16 8 8",
81-
shell=True,
82-
check=True,
83-
cwd=working_dir,
84-
stdout=None if print_output else subprocess.DEVNULL,
85-
stderr=None if print_output else subprocess.DEVNULL
86-
)
87-
print("test_FlowPastSphere succeed")
88-
89-
def test_RayleighTaylor(working_dir, print_output):
90-
subprocess.run(
91-
"make -j8 USE_CUDA=FALSE USE_MPI=TRUE DEBUG=FALSE && mpiexec -np 2 ./amr2d.gnu.MPI.ex inputs.2d.rayleightaylor",
92-
shell=True,
93-
check=True,
94-
cwd=working_dir,
95-
stdout=None if print_output else subprocess.DEVNULL,
96-
stderr=None if print_output else subprocess.DEVNULL
97-
)
98-
print("test_RayleighTaylor succeed")
99-
100-
def test_RayleighTaylor_LS(working_dir, print_output):
101-
subprocess.run(
102-
"make -j8 USE_CUDA=FALSE USE_MPI=TRUE DEBUG=FALSE;"
103-
"mpiexec -np 2 ./amr2d.gnu.MPI.ex inputs.2d.rayleightaylor_rt ",
104-
shell=True,
105-
check=True,
106-
cwd=working_dir,
107-
stdout=None if print_output else subprocess.DEVNULL,
108-
stderr=None if print_output else subprocess.DEVNULL
109-
)
110-
print("test_RayleighTaylor_LS succeed")
111-
112-
22+
print(f"Test {name} succeed")
11323

11424
def main():
115-
# if print_output = falsethe information of compile and running doesn't display in terminal
116-
print_output =False
25+
# if print_output = false, the information of compile and running doesn't display in terminal
26+
print_output = False
11727

11828
script_dir = os.path.dirname(os.path.abspath(__file__))
11929
print("Script Directory:", script_dir)
12030

121-
# LidDrivenCavity
31+
# LidDrivenCavity (2D, no MPI — basic compilation and run test)
12232
working_dir = os.path.join(script_dir, "../Tutorials/LidDrivenCavity")
12333
print("Test Working Directory:", os.path.abspath(working_dir))
124-
test_lidDrivenCanvity(working_dir, print_output)
125-
126-
# LidDrivenCavitySphere
127-
working_dir = os.path.join(script_dir, "../Tutorials/LidDrivenCavitySphere")
128-
print("Test Working Directory:", os.path.abspath(working_dir))
129-
test_LidDrivenCavitySphere(working_dir, print_output)
34+
run_test(
35+
"LidDrivenCavity",
36+
working_dir,
37+
"make -j8",
38+
f"./amr2d.gnu.ex inputs.2d.lid_driven_cavity {CI_OVERRIDES}",
39+
print_output
40+
)
13041

131-
# RSV
42+
# RSV (2D, MPI, level set)
13243
working_dir = os.path.join(script_dir, "../Tutorials/RSV")
13344
print("Test Working Directory:", os.path.abspath(working_dir))
134-
test_RSV(working_dir, False)
135-
45+
run_test(
46+
"RSV",
47+
working_dir,
48+
"make -j8",
49+
f"./amr2d.gnu.MPI.ex inputs.2d.rsv {CI_OVERRIDES}",
50+
print_output
51+
)
13652

137-
# DraftingKissingTumbling
53+
# DraftingKissingTumbling (3D, MPI, particles/IBM)
13854
working_dir = os.path.join(script_dir, "../Tutorials/DraftingKissingTumbling")
13955
print("Test Working Directory:", os.path.abspath(working_dir))
140-
test_DraftingKissingTumbling(working_dir, print_output)
141-
142-
# FallingSphere
143-
working_dir = os.path.join(script_dir, "../Tutorials/FallingSphere")
144-
print("Test Working Directory:", os.path.abspath(working_dir))
145-
test_FallingSphere(working_dir, print_output)
146-
147-
# FlowPastCylinder
148-
working_dir = os.path.join(script_dir, "../Tutorials/FlowPastCylinder")
149-
print("Test Working Directory:", os.path.abspath(working_dir))
150-
test_FlowPastCylinder(working_dir, print_output)
151-
152-
# FlowPastSphere
153-
working_dir = os.path.join(script_dir, "../Tutorials/FlowPastSphere")
154-
print("Test Working Directory:", os.path.abspath(working_dir))
155-
test_FlowPastSphere(working_dir, print_output)
156-
157-
# RayleighTaylor
158-
working_dir = os.path.join(script_dir, "../Tutorials/RayleighTaylor")
159-
print("Test Working Directory:", os.path.abspath(working_dir))
160-
test_RayleighTaylor(working_dir, print_output)
161-
162-
# RayleighTaylor_LS
163-
working_dir = os.path.join(script_dir, "../Tutorials/RayleighTaylor_LS")
164-
print("Test Working Directory:", os.path.abspath(working_dir))
165-
test_RayleighTaylor_LS(working_dir, print_output)
166-
56+
run_test(
57+
"DraftingKissingTumbling",
58+
working_dir,
59+
"make -j8 USE_CUDA=FALSE USE_MPI=TRUE DEBUG=FALSE",
60+
f"mpiexec -np 2 ./amr3d.gnu.MPI.ex inputs.3d.DKT max_step=1 amr.n_cell=16 8 8 amr.plot_int=-1 amr.check_int=-1",
61+
print_output
62+
)
16763

16864

169-
if __name__== "__main__" :
65+
if __name__ == "__main__":
17066
main()
171-

0 commit comments

Comments
 (0)