def __call__(self, x):
        " Divide x into self.nproc chunks, feeding one to each process. "
        nx = x.shape[0] // self.nproc + 1
        # launch evaluation of self.fcn for each chunk, in parallel
        results = self.pool.map(
            self.fcn,
            [x[i*nx : (i+1)*nx] for i in range(self.nproc)],
            1,
            )
        # convert list of results into a single numpy array
        return numpy.concatenate(results)
def __call__ ( self , x ) : nx = x . shape [ 0 ] // self . nproc + 1 results = self . pool . map ( self . fcn , [ x [ i * nx : ( i + 1 ) * nx ] for i in range ( self . nproc ) ] , 1 , ) return numpy . concatenate ( results )
Divide x into self.nproc chunks, feeding one to each process.