def initial_comm_setup(): """Setup client and engine intracomm, and intercomm.""" world = get_comm_world() world_rank = world.rank # create a comm that is split into client and engines. if world_rank == client_rank: split_world = world.Split(0, 0) else: split_world = world.Split(1, world_rank) from distarray.localapi.mpiutils import set_base_comm set_base_comm(split_world) # create the intercomm if world_rank == client_rank: intercomm = split_world.Create_intercomm(0, world, 1) else: intercomm = split_world.Create_intercomm(0, world, 0) return intercomm
def _make_new_comm(rank_list): import distarray.localapi.mpiutils as mpiutils new_comm = mpiutils.create_comm_with_list(rank_list) if not mpiutils.get_base_comm(): mpiutils.set_base_comm(new_comm) return proxyize(new_comm) # noqa