Tracking progress of joblib.Parallel execution

后端 未结 8 815
隐瞒了意图╮
隐瞒了意图╮ 2020-12-24 12:08

Is there a simple way to track the overall progress of a joblib.Parallel execution?

I have a long-running execution composed of thousands of jobs, which I want to tr

8条回答
  •  攒了一身酷
    2020-12-24 12:22

    Why can't you simply use tqdm? The following worked for me

    from joblib import Parallel, delayed
    from datetime import datetime
    from tqdm import tqdm
    
    def myfun(x):
        return x**2
    
    results = Parallel(n_jobs=8)(delayed(myfun)(i) for i in tqdm(range(1000))
    100%|██████████| 1000/1000 [00:00<00:00, 10563.37it/s]
    

提交回复
热议问题