(self, func, *args, nprocs=1, servers=None, verbose=False, **kwargs)
return self
Distribute model evaluation across a cluster.

        Usage Conditions:
        * The provided function needs to accept a numpy array of inputs as
          its first parameter
        * The provided function must return a numpy array of results

        Parameters
        ----------
        func : function,
            Model, or function that wraps a model, to be run in parallel

        nprocs : int,
            Number of processors to use for each node. Defaults to 1.

        servers : list[str] or None,
            IP addresses or alias for each server/node to use.

        verbose : bool,
            Display job execution statistics. Defaults to False.

        *args : list,
            Additional arguments to be passed to `func`

        **kwargs : dict,
            Additional keyword arguments passed to `func`

        Returns
        ----------
        self : ProblemSpec object
Distribute model evaluation across a cluster.
Distribute model evaluation across a cluster .
def evaluate_distributed(self, func, *args, nprocs=1, servers=None, verbose=False, **kwargs):
        """Distribute model evaluation across a cluster.

        Usage Conditions:
        * The provided function needs to accept a numpy array of inputs as
          its first parameter
        * The provided function must return a numpy array of results

        Parameters
        ----------
        func : function,
            Model, or function that wraps a model, to be run in parallel

        nprocs : int,
            Number of processors to use for each node. Defaults to 1.

        servers : list[str] or None,
            IP addresses or alias for each server/node to use.

        verbose : bool,
            Display job execution statistics. Defaults to False.

        *args : list,
            Additional arguments to be passed to `func`

        **kwargs : dict,
            Additional keyword arguments passed to `func`

        Returns
        ----------
        self : ProblemSpec object
        """
        if verbose:
            from pathos.parallel import stats

        warnings.warn("Distributed evaluation is an untested experimental feature and may not work.")

        workers = pp_Pool(nprocs, servers=servers)

        # Split into even chunks
        chunks = np.array_split(self._samples, int(nprocs)*len(servers), axis=0)

        tmp_f = self._wrap_func(func)

        res = list(workers.map(tmp_f, chunks))

        self.results = self._collect_results(res)

        if verbose:
            print(stats(), '\n')

        workers.clear()

        return self
def evaluate_distributed ( self , func , * args , nprocs = 1 , servers = None , verbose = False , * * kwargs ) : if verbose : from pathos . parallel import stats warnings . warn ( "Distributed evaluation is an untested experimental feature and may not work." ) workers = pp_Pool ( nprocs , servers = servers ) # Split into even chunks chunks = np . array_split ( self . _samples , int ( nprocs ) * len ( servers ) , axis = 0 ) tmp_f = self . _wrap_func ( func ) res = list ( workers . map ( tmp_f , chunks ) ) self . results = self . _collect_results ( res ) if verbose : print ( stats ( ) , '\n' ) workers . clear ( ) return self