Python: Splitting up a sum with threads

后端 未结 2 570
囚心锁ツ
囚心锁ツ 2021-01-24 13:49

i have a costly calculation to do for fitting some experimental data. The fitting function is a sum over eigenmodes, each of them containing a specific surface integral. As it i

2条回答
  •  抹茶落季
    2021-01-24 14:17

    use multiprocessing pool

    import multiprocessing as mp
    
    p = mp.Pool(10)
    
    res = p.map(your_function, range(Mmin, Mmax))
    

提交回复
热议问题