Skip to content

ezpz.testΒΆ

CLI entry point for running the distributed smoke test locally.

main(args=None) ΒΆ

Run the distributed smoke test via the scheduler or mpirun fallback.

Source code in src/ezpz/test.py
def main(args: Optional[List[str]] = None) -> int:
    """Run the distributed smoke test via the scheduler or ``mpirun`` fallback."""
    args = sys.argv[1:] if args is None else args
    command = _build_test_command(args)
    scheduler = get_scheduler().lower()

    if scheduler in {"pbs", "slurm"}:
        cmd_str = " ".join(shlex.quote(part) for part in command)
        return launch(cmd_to_launch=cmd_str)

    fallback_cmd = ["mpirun", "-np", "2", *command]
    result = subprocess.run(fallback_cmd, check=False)
    ezpz.cleanup()
    return result.returncode