def create_grid_menv(addr, slave_addrs, grid_size, origin, logger=logger,
                     extra_ser=None):
    '''
    :param addr: Address of the multi-environment
    :param slave_addrs: Addresses for the slave environments.
    :param tuple grid_size: Grid size for each slave environment, e.g. (4, 4)
    :param origin:
        Origin of the multi-environment (slave envs are stacked horizontally).

    :param logger:
        Root logger for the multi-environment.

    :param extra_ser:
        Extra serializers for the environments (used to communicate arbitrary
        Python objects between the agents).

    :returns: Instance of :py:class:`GridMultiEnvironment`
    '''
    env_kwargs = {'codec': aiomas.MsgPack, 'extra_serializers': extra_ser}
    menv = GridMultiEnvironment(addr,
                                env_cls=Environment,
                                mgr_cls=GridMultiEnvManager,
                                logger=logger,
                                grid_size=grid_size,
                                origin=origin,
                                **env_kwargs)
    slave_kwargs = [{'codec': aiomas.MsgPack, 'extra_serializers': extra_ser}
                    for _ in range(len(slave_addrs))]
    run(menv.spawn_slaves(slave_addrs=slave_addrs,
                          slave_env_cls=GridEnvironment,
                          slave_mgr_cls=GridEnvManager,
                          slave_kwargs=slave_kwargs))
    return menv