add ParallelEvaluator#34
Conversation
|
Thanks, looks great. Can we set things up so this is only activated on 0.4 and later and that its tests are only run if on 0.4? Or maybe we just wait until 0.4 is officially released and we require it. What do you think? |
|
Since the 0.4 release is very near, I think it would be easier to just require 0.4 at some point, then merge this PR. Last week Julia 0.4rc2 was released, it fixes some stability issues related to interprocess communication, so in principle we can already switch the master to 0.4 and tag the new version after the official release. |
de94703 to
db4f82d
Compare
|
I've rebased the PR to the master. It builds on 0.4, fails on 0.3 (the PR requires channels, so it would not work 0.3), fails on nightly (the core devs are changing the parallel API, but I don't think it makes sense to update the PR now. I expect there would be more changes in the 0.5 development cycle). |
|
Sounds good. I'm ready to require 0.4. Will check and run on my side and then merge. @alyst , do you recommend we also exclude nightly from the travis build/testing? Disturbing not to have a travis pass. |
7a90149 to
50f8039
Compare
required to workaround the Julia (de)serialization issues between master-worker
distributes evaluation of fitness for an array of Candidate{F} between
the workers
if Workers= parameter is specified (in bbsetup() or bboptimize()), and the optimizer is a subclass of AskTellOptimizer, ParallelOptimizer is used
50f8039 to
5d9f664
Compare
|
IMO nightlies should be kept. I've added the commit disabling ParallelEvaulator on 0.3 and 0.5. Unfortunately, it didn't worked out:
As for 0.3, I think it should be dropped. |
|
Ok, I've tried this and it looks good. I think we should also add an example file that runs an opt first with only one worker process and then with several, to show people how it can be used and what the benefits are. Will see if I have time to add one, if not I'd appreciate one from you. :) |
|
Hmm, I have problems ensuring all code is loaded on all workers and get something like: after trying to addprocs() and then setup and run an optimization with multiple Workers. Maybe I need a small example from you anyway... Can you please check and do a PR on this file: https://github.com/robertfeldt/BlackBoxOptim.jl/blob/master/examples/rosenbrock_parallel.jl |
Implements
ParallelEvaluator <: Evaluatorthat distributes the calculation of candidates' fitnesses across the worker processes. Should be beneficial for NES family of optimizers that regenerate the population at each step.It does require channels from Julia 0.4, but unlike
ParallelOptimizerfrom #25 communication between the processes is much more straighforward (it's very similar topmap(), except that theproblemobject needs to be sent to the workers only once atParallelEvaluatorcreation).To use it, simply add
Workers=parameter tobbsetup/bboptimize(problem)call. E.g.