def METHOD_NAME(cls, rank, test_name, file_name, pipe):
    self = cls(test_name)
    self.assertTrue(torch.cuda.is_available())
    self.assertTrue(hasattr(self, "DISTRIBUTED_BACKEND"))
    self.rank = rank
    self.file_name = file_name
    print(f"[dist init] rank = {self.rank}, world_size = {self.world_size}")
    try:
        dist.init_process_group(
            init_method=self.init_method,
            backend=self.DISTRIBUTED_BACKEND,
            world_size=int(self.world_size),
            rank=self.rank,
        )
    except RuntimeError as e:
        if "recompile" in e.args[0]:
            print(f"Backend of {self.DISTRIBUTED_BACKEND} not available")
            sys.exit(0)
        raise
    torch.cuda.set_device(self.rank % torch.cuda.device_count())
    dist.barrier()
    self.run_test(test_name, pipe)
    dist.barrier()
    dist.destroy_process_group()
    sys.exit(0)