From 5ae4d0552fde0ae7479f076a8e43ef22e6f1371c Mon Sep 17 00:00:00 2001 From: Alexey Stukalov Date: Tue, 30 Aug 2016 14:37:19 +0200 Subject: [PATCH] remove enable_parallel_evaluators check since Julia 0.5 is mature --- src/BlackBoxOptim.jl | 8 -------- src/opt_controller.jl | 6 +----- test/test_evaluator.jl | 2 -- test/test_toplevel_bboptimize.jl | 2 -- 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/BlackBoxOptim.jl b/src/BlackBoxOptim.jl index eaa54e95..dd1c95cf 100644 --- a/src/BlackBoxOptim.jl +++ b/src/BlackBoxOptim.jl @@ -5,12 +5,6 @@ module BlackBoxOptim using Distributions, StatsBase, Compat using Compat: String, view -# selectively enable parallel evaluation: -# - Julia v0.3: no RemoteChannel -# + Julia v0.4 -# - Julia v0.5: incompatible changes in parallel API -enable_parallel_methods = VERSION >= v"0.4.0" && VERSION < v"0.5.0-" - export Optimizer, AskTellOptimizer, SteppingOptimizer, PopulationOptimizer, bboptimize, bbsetup, compare_optimizers, @@ -110,9 +104,7 @@ include("archives/epsbox_archive.jl") include("genetic_operators/genetic_operator.jl") include("evaluator.jl") -if enable_parallel_methods include("parallel_evaluator.jl") -end include("population.jl") include("optimizer.jl") diff --git a/src/opt_controller.jl b/src/opt_controller.jl index 83b1ede6..dd9ea8bb 100644 --- a/src/opt_controller.jl +++ b/src/opt_controller.jl @@ -9,11 +9,7 @@ function make_evaluator(problem::OptimizationProblem, archive=nothing, params::P archive = TopListArchive(fitness_scheme(problem), numdims(problem), archiveCapacity) end if length(workers) > 0 - if BlackBoxOptim.enable_parallel_methods - return ParallelEvaluator(problem, archive, pids=workers) - else - throw(SystemError("Parallel evaluation disabled")) - end + return ParallelEvaluator(problem, archive, pids=workers) else return ProblemEvaluator(problem, archive) end diff --git a/test/test_evaluator.jl b/test/test_evaluator.jl index 3889a1e5..1e60f41d 100644 --- a/test/test_evaluator.jl +++ b/test/test_evaluator.jl @@ -75,10 +75,8 @@ facts("Evaluator") do @fact sortperm(candidates, by = fitness) --> collect(1:10) end -if BlackBoxOptim.enable_parallel_methods context("ParallelEvaluator") do evaluator_tests(() -> BlackBoxOptim.ParallelEvaluator(p, pids=workers())) end -end end diff --git a/test/test_toplevel_bboptimize.jl b/test/test_toplevel_bboptimize.jl index 0fc4994d..d7c29f87 100644 --- a/test/test_toplevel_bboptimize.jl +++ b/test/test_toplevel_bboptimize.jl @@ -53,7 +53,6 @@ facts("Top-level interface") do @fact numdims(xpop) --> 2 end -if BlackBoxOptim.enable_parallel_methods context("using population optimizer and parallel evaluator") do opt = bbsetup(rosenbrock; Method=:adaptive_de_rand_1_bin, SearchRange = (-5.0, 5.0), NumDimensions = 2, @@ -61,7 +60,6 @@ if BlackBoxOptim.enable_parallel_methods res = bboptimize(opt) @fact isa(BlackBoxOptim.evaluator(lastrun(opt)), BlackBoxOptim.ParallelEvaluator) --> true end -end end