dcolli23 / PyOpt

Python optimization framework
GNU General Public License v3.0
1 stars 0 forks source link

Add support for multiprocessing for MasterWorker #22

Open dcolli23 opened 4 years ago

dcolli23 commented 4 years ago

Description

At my recommendation, Ken Campbell is no longer going to add support for multithreading in FiberSim and will instead use Python multiprocessing to run parallel simulations of FiberSim. Due to this, the individual simulations will not take up all of the processing power and we can start parallelizing the optimization routines.

We need to add an initialization parameter for multiprocessing simulations.

dcolli23 commented 4 years ago

If we're going to add support for multiprocessing in the MasterWorker, we may as well add support for multiprocessing in the WorkerFamily as well. I say that we make a mixin to support this multiprocessing. This multiprocessing mixin can simply spawn processes based on the parent class's child list. We'll have to write some logic in the mixin that keeps track of the number of processes so we don't wind up bogging down the CPU with running multiple children for the PSO and multiple children for the family of simulations.