def fit_pixel_multiprocess_nnls(exp_data, matv, param,
                                use_snip=False):
    num_processors_to_use = multiprocessing.cpu_count()

    logger.info('cpu count: {}'.format(num_processors_to_use))
    pool = multiprocessing.Pool(num_processors_to_use)

    result_pool = [
        pool.apply_async(_log_and_fit, (n, data, matv,param, use_snip))
        for n, data in enumerate(exp_data)]

    results = [r.get() for r in result_pool]

    pool.terminate()
    pool.join()

    return np.array(results)
Multiprocess fit of experiment data.
dataset/ETHPy150Open scikit-beam/scikit-beam/skbeam/core/fitting/xrf_model.py/fit_pixel_multiprocess_nnls