How do I parallelize a simple Python loop?

后端 未结 13 1573
北荒
北荒 2020-11-22 11:54

This is probably a trivial question, but how do I parallelize the following loop in python?

# setup output lists
output1 = list()
output2 = list()
output3 =          


        
13条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 12:15

    This could be useful when implementing multiprocessing and parallel/ distributed computing in Python.

    YouTube tutorial on using techila package

    Techila is a distributed computing middleware, which integrates directly with Python using the techila package. The peach function in the package can be useful in parallelizing loop structures. (Following code snippet is from the Techila Community Forums)

    techila.peach(funcname = 'theheavyalgorithm', # Function that will be called on the compute nodes/ Workers
        files = 'theheavyalgorithm.py', # Python-file that will be sourced on Workers
        jobs = jobcount # Number of Jobs in the Project
        )
    

提交回复
热议问题