def mpi_map_alloc_dmem(f, scatter_tuple=None, bcast_tuple=None,
    dmem_key_in_list=None, dmem_arg_in_list=None, dmem_val_in_list=None,
    dmem_key_out_list=None, obj=None, obj_val=None, reduce_obj=None,
    reduce_tuple=None, mpi_pool=None, splitted=False, concatenate=True):
    """ Interface for the parallel evaluation of a generic function on points ``x``

    Args:
      f (:class:`object` or :class:`str`): function or string identifying the
        function in object ``obj``
      scatter_tuple (tuple): tuple containing 2 lists of ``[keys]`` and ``[arguments]``
        which will be scattered to the processes.
      bcast_tuple (tuple): tuple containing 2 lists of ``[keys]`` and ``[arguments]``
        which will be broadcasted to the processes.
      dmem_key_in_list (list): list of string containing the keys
        to be fetched (or created with default ``None`` if missing) from the
        distributed memory and provided as input to ``f``.
      dmem_val_in_list (list): list of objects corresponding to the keys defined
        in ``dmem_key_in_list``, used in case we are not executing in parallel
      dmem_key_out_list (list): list of keys to be assigned to the outputs
        beside the first one
      obj (object): object where the function ``f_name`` is defined
      obj_val (object): object to be used in case not executing in parallel and
        ``obj`` is a string
      reduce_obj (object): object :class:`ReduceObject` defining the reduce
        method to be applied (if any)   
      reduce_tuple (object): tuple containing 2 lists of ``[keys]`` and ``[arguments]``
        which will be scattered to the processes to be used by ``reduce_obj``
      mpi_pool (:class:`mpi_map.MPI_Pool<mpi_map.MPI_Pool>`): pool of processors
      splitted (bool): whether the scattering input is already splitted or not
      concatenate (bool): whether to concatenate the output (the output of ``f``
        must be a :class:`numpy.ndarray<numpy.ndarray>` object
    """
    if scatter_tuple is None:
        scatter_tuple = [], []
    if bcast_tuple is None:
        bcast_tuple = [], []
    if dmem_key_in_list is None:
        dmem_key_in_list = []
    if dmem_arg_in_list is None:
        dmem_arg_in_list = []
    if dmem_val_in_list is None:
        dmem_val_in_list = []
    if dmem_key_out_list is None:
        dmem_key_out_list = []
    if reduce_tuple is None:
        reduce_tuple = [], []
    if mpi_pool is None:
        args = {}
        for key, val in zip(scatter_tuple[0], scatter_tuple[1]):
            if splitted:
                if len(val) != 1:
                    raise ValueError(
                        'Serial execution but splitted input is %d long' %
                        len(val))
                args[key] = val[0]
            else:
                args[key] = val
        for key, val in zip(bcast_tuple[0], bcast_tuple[1]):
            args[key] = val
        for key, val in zip(dmem_arg_in_list, dmem_val_in_list):
            args[key] = val
        reduce_args = {}
        for key, val in zip(reduce_tuple[0], reduce_tuple[1]):
            if splitted:
                if len(val) != 1:
                    raise ValueError(
                        'Serial execution but splitted input is %d long' %
                        len(val))
                reduce_args[key] = val[0]
            else:
                reduce_args[key] = val
        if obj is not None:
            if isinstance(obj, str):
                f = getattr(obj_val, f)
            else:
                f = getattr(obj, f)
        pars = f(**args)
        if not isinstance(pars, tuple):
            pars = pars,
    else:
        obj_scatter = mpi_pool.split_data(scatter_tuple[1], scatter_tuple[0
            ], splitted=splitted)
        obj_bcast = {}
        for key, val in zip(bcast_tuple[0], bcast_tuple[1]):
            obj_bcast[key] = val
        obj_args_reduce = mpi_pool.split_data(reduce_tuple[1], reduce_tuple
            [0], splitted=splitted)
        pars = tuple([None] * len(dmem_key_out_list))
        mpi_pool.map_alloc_dmem(f, obj_scatter=obj_scatter, obj_bcast=
            obj_bcast, dmem_key_in_list=dmem_key_in_list, dmem_arg_in_list=
            dmem_arg_in_list, dmem_key_out_list=dmem_key_out_list, obj=obj,
            reduce_obj=reduce_obj, reduce_args=obj_args_reduce)
    return pars
