def METHOD_NAME(callee, port, return_value_queue, config, *args):
    print_memory_stats()
    random.seed(config.rng_seed)
    np.random.seed(config.rng_seed)
    torch.manual_seed(config.rng_seed)
    torch.cuda.manual_seed_all(config.rng_seed)
    rank, nranks = config.rank, config.nranks
    os.environ["MASTER_ADDR"] = "localhost"
    os.environ["MASTER_PORT"] = port
    os.environ["WORLD_SIZE"] = str(config.nranks)
    os.environ["RANK"] = str(config.rank)
    # TODO: Ideally the gpus "getter" handles this max-nranks thing!
    os.environ["CUDA_VISIBLE_DEVICES"] = ','.join(map(str, config.gpus_[:nranks]))
    nranks_, distributed_ = distributed.init(rank)
    assert nranks_ == nranks
    # Run.init(args.rank, args.root, args.experiment, args.run)
    with Run().context(config, inherit_config=False):
        return_val = callee(config, *args)
    return_value_queue.put((rank, return_val))