Skip to content

Commit 14706c2

Browse files
committed
added flag --rdma-mpi
1 parent b263cf3 commit 14706c2

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

toolchain/mfc/args.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@ def add_common_arguments(p, mask = None):
7676
test.add_argument("-l", "--list", action="store_true", help="List all available tests.")
7777
test.add_argument("-f", "--from", default=test_cases[0].get_uuid(), type=str, help="First test UUID to run.")
7878
test.add_argument("-t", "--to", default=test_cases[-1].get_uuid(), type=str, help="Last test UUID to run.")
79-
test.add_argument("-o", "--only", nargs="+", type=str, default=[], metavar="L", help="Only run tests with specified properties.")
80-
test.add_argument("-a", "--test-all", action="store_true", default=False, help="Run the Post Process Tests too.")
81-
test.add_argument("-%", "--percent", type=int, default=100, help="Percentage of tests to run.")
82-
test.add_argument("-m", "--max-attempts", type=int, default=1, help="Maximum number of attempts to run a test.")
83-
test.add_argument( "--no-build", action="store_true", default=False, help="(Testing) Do not rebuild MFC.")
84-
test.add_argument( "--no-examples", action="store_true", default=False, help="Do not test example cases." )
85-
test.add_argument("--case-optimization", action="store_true", default=False, help="(GPU Optimization) Compile MFC targets with some case parameters hard-coded.")
86-
test.add_argument( "--dry-run", action="store_true", default=False, help="Build and generate case files but do not run tests.")
79+
test.add_argument("-o", "--only", nargs="+", type=str, default=[], metavar="L", help="Only run tests with specified properties.")
80+
test.add_argument("-a", "--test-all", action="store_true", default=False, help="Run the Post Process Tests too.")
81+
test.add_argument("-%", "--percent", type=int, default=100, help="Percentage of tests to run.")
82+
test.add_argument("-m", "--max-attempts", type=int, default=1, help="Maximum number of attempts to run a test.")
83+
test.add_argument("-r", "--rdma-mpi", action="store_true", default=False, help="Enable RDMA MPI for tests")
84+
test.add_argument( "--no-build", action="store_true", default=False, help="(Testing) Do not rebuild MFC.")
85+
test.add_argument( "--no-examples", action="store_true", default=False, help="Do not test example cases." )
86+
test.add_argument("--case-optimization", action="store_true", default=False, help="(GPU Optimization) Compile MFC targets with some case parameters hard-coded.")
87+
test.add_argument( "--dry-run", action="store_true", default=False, help="Build and generate case files but do not run tests.")
8788

8889
test_meg = test.add_mutually_exclusive_group()
8990
test_meg.add_argument("--generate", action="store_true", default=False, help="(Test Generation) Generate golden files.")

toolchain/mfc/test/case.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ def run(self, targets: List[Union[str, MFCTarget]], gpus: Set[int]) -> subproces
133133
filepath = f'{self.get_dirpath()}/case.py'
134134
tasks = ["-n", str(self.ppn)]
135135
jobs = ["-j", str(ARG("jobs"))] if ARG("case_optimization") else []
136-
case_optimization = ["--case-optimization"] if ARG("case_optimization") else []
136+
case_optimization = ["--case-optimization"] if ARG("case_optimization") else []
137+
rdma_mpi_args = ["--rdma-mpi"] if ARG("rdma_mpi") else []
138+
137139

138140
if self.params.get("bubbles_lagrange", 'F') == 'T':
139141
input_bubbles_lagrange(self)
@@ -144,7 +146,7 @@ def run(self, targets: List[Union[str, MFCTarget]], gpus: Set[int]) -> subproces
144146

145147
command = [
146148
mfc_script, "run", filepath, "--no-build", *tasks, *case_optimization,
147-
*jobs, "-t", *target_names, *gpus_select, *ARG("--")
149+
*jobs, "-t", *target_names, *gpus_select, *rdma_mpi_args, *ARG("--")
148150
]
149151

150152
return common.system(command, print_cmd=False, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

toolchain/mfc/test/test.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ def __filter(cases_) -> typing.List[TestCase]:
6464
if any(label in case.trace for label in skip):
6565
cases.remove(case)
6666

67+
for case in cases[:]:
68+
if ARG("rdma_mpi") and case.ppn <= 1:
69+
cases.remove(case)
70+
skipped_cases.append(case)
6771

6872
if ARG("no_examples"):
6973
cases = [case for case in cases if not "Example" in case.trace]
@@ -180,7 +184,10 @@ def _handle_case(case: TestCase, devices: typing.Set[int]):
180184
cons.print(f" [bold magenta]{case.get_uuid()}[/bold magenta] SKIP {case.trace}")
181185
return
182186

183-
cmd = case.run([PRE_PROCESS, SIMULATION], gpus=devices)
187+
if ARG("rdma_mpi"):
188+
cmd = case.run([PRE_PROCESS, SIMULATION], gpus=devices, rdma_mpi=True)
189+
else:
190+
cmd = case.run([PRE_PROCESS, SIMULATION], gpus=devices)
184191
out_filepath = os.path.join(case.get_dirpath(), "out_pre_sim.txt")
185192

186193
common.file_write(out_filepath, cmd.stdout)
@@ -224,6 +231,10 @@ def _handle_case(case: TestCase, devices: typing.Set[int]):
224231
if ARG("test_all"):
225232
case.delete_output()
226233
cmd = case.run([PRE_PROCESS, SIMULATION, POST_PROCESS], gpus=devices)
234+
if ARG("rdma_mpi"):
235+
cmd = case.run([PRE_PROCESS, SIMULATION, POST_PROCESS], gpus=devices, rdma_mpi=True)
236+
else:
237+
cmd = case.run([PRE_PROCESS, SIMULATION, POST_PROCESS], gpus=devices)
227238
out_filepath = os.path.join(case.get_dirpath(), "out_post.txt")
228239
common.file_write(out_filepath, cmd.stdout)
229240

0 commit comments

Comments
 (0)