Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions toolchain/mfc/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ def add_common_arguments(p, mask = None):
test.add_argument("-l", "--list", action="store_true", help="List all available tests.")
test.add_argument("-f", "--from", default=test_cases[0].get_uuid(), type=str, help="First test UUID to run.")
test.add_argument("-t", "--to", default=test_cases[-1].get_uuid(), type=str, help="Last test UUID to run.")
test.add_argument("-o", "--only", nargs="+", type=str, default=[], metavar="L", help="Only run tests with specified properties.")
test.add_argument("-a", "--test-all", action="store_true", default=False, help="Run the Post Process Tests too.")
test.add_argument("-%", "--percent", type=int, default=100, help="Percentage of tests to run.")
test.add_argument("-m", "--max-attempts", type=int, default=1, help="Maximum number of attempts to run a test.")
test.add_argument( "--no-build", action="store_true", default=False, help="(Testing) Do not rebuild MFC.")
test.add_argument( "--no-examples", action="store_true", default=False, help="Do not test example cases." )
test.add_argument("--case-optimization", action="store_true", default=False, help="(GPU Optimization) Compile MFC targets with some case parameters hard-coded.")
test.add_argument( "--dry-run", action="store_true", default=False, help="Build and generate case files but do not run tests.")
test.add_argument("-o", "--only", nargs="+", type=str, default=[], metavar="L", help="Only run tests with specified properties.")
test.add_argument("-a", "--test-all", action="store_true", default=False, help="Run the Post Process Tests too.")
test.add_argument("-%", "--percent", type=int, default=100, help="Percentage of tests to run.")
test.add_argument("-m", "--max-attempts", type=int, default=1, help="Maximum number of attempts to run a test.")
test.add_argument("-r", "--rdma-mpi", action="store_true", default=False, help="Enable RDMA MPI for tests")
test.add_argument( "--no-build", action="store_true", default=False, help="(Testing) Do not rebuild MFC.")
test.add_argument( "--no-examples", action="store_true", default=False, help="Do not test example cases." )
test.add_argument("--case-optimization", action="store_true", default=False, help="(GPU Optimization) Compile MFC targets with some case parameters hard-coded.")
test.add_argument( "--dry-run", action="store_true", default=False, help="Build and generate case files but do not run tests.")

test_meg = test.add_mutually_exclusive_group()
test_meg.add_argument("--generate", action="store_true", default=False, help="(Test Generation) Generate golden files.")
Expand Down
6 changes: 4 additions & 2 deletions toolchain/mfc/test/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def run(self, targets: List[Union[str, MFCTarget]], gpus: Set[int]) -> subproces
filepath = f'{self.get_dirpath()}/case.py'
tasks = ["-n", str(self.ppn)]
jobs = ["-j", str(ARG("jobs"))] if ARG("case_optimization") else []
case_optimization = ["--case-optimization"] if ARG("case_optimization") else []
case_optimization = ["--case-optimization"] if ARG("case_optimization") else []
rdma_mpi_args = ["--rdma-mpi"] if ARG("rdma_mpi") else []


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

command = [
mfc_script, "run", filepath, "--no-build", *tasks, *case_optimization,
*jobs, "-t", *target_names, *gpus_select, *ARG("--")
*jobs, "-t", *target_names, *gpus_select, *rdma_mpi_args, *ARG("--")
]

return common.system(command, print_cmd=False, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
Expand Down
13 changes: 12 additions & 1 deletion toolchain/mfc/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ def __filter(cases_) -> typing.List[TestCase]:
if any(label in case.trace for label in skip):
cases.remove(case)

for case in cases[:]:
if ARG("rdma_mpi") and case.ppn <= 1:
cases.remove(case)
skipped_cases.append(case)

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

cmd = case.run([PRE_PROCESS, SIMULATION], gpus=devices)
if ARG("rdma_mpi"):
cmd = case.run([PRE_PROCESS, SIMULATION], gpus=devices, rdma_mpi=True)
else:
cmd = case.run([PRE_PROCESS, SIMULATION], gpus=devices)
out_filepath = os.path.join(case.get_dirpath(), "out_pre_sim.txt")

common.file_write(out_filepath, cmd.stdout)
Expand Down Expand Up @@ -224,6 +231,10 @@ def _handle_case(case: TestCase, devices: typing.Set[int]):
if ARG("test_all"):
case.delete_output()
cmd = case.run([PRE_PROCESS, SIMULATION, POST_PROCESS], gpus=devices)
if ARG("rdma_mpi"):
cmd = case.run([PRE_PROCESS, SIMULATION, POST_PROCESS], gpus=devices, rdma_mpi=True)
else:
cmd = case.run([PRE_PROCESS, SIMULATION, POST_PROCESS], gpus=devices)
out_filepath = os.path.join(case.get_dirpath(), "out_post.txt")
common.file_write(out_filepath, cmd.stdout)

Expand Down
Loading