def init_comm(base_comm, grid_shape):
    """Create an MPI communicator with a cartesian topology."""
    return base_comm.Create_cart(grid_shape, len(grid_shape) * (False,),
                                 reorder=False)