MDCHAMP / FreeLunch

Meta-heuristic optimisation suite for python
https://pypi.org/project/freelunch/
MIT License
46 stars 3 forks source link

Multiproc option for mruns #32

Closed MDCHAMP closed 2 years ago

MDCHAMP commented 2 years ago

I would be a really nice QOL improvement to add high level control for a multiproc wrapper over multiple runs of the optimisers. This would make optimisation on cluster / hpc a lot more powerful / less janky than it is currently.

The calling syntax would be something like:

best_of_runs = opt(nruns=n_runs, nworkers=n_workers, pool_args={})

and I think using multiprocessing.pool.imap under the hood would be a good way to go.

This might require a bit of a rework to base.optimiser.call() but shouldn't be too bad to keep the calling syntax the same and still add the functionality / return structure.