diff --git a/Project.toml b/Project.toml index 40a4a25..9927616 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CompositionalNetworks" uuid = "4b67e4b5-442d-4ef5-b760-3f5df3a57537" authors = ["Jean-François Baffier"] -version = "0.2.0" +version = "0.2.1" [deps] ConstraintDomains = "5800fd60-8556-4464-8d61-84ebf7a0bedb" @@ -9,12 +9,14 @@ Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4" Evolutionary = "86b6b26d-c046-49b6-aa0b-5f0f74682bd6" OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +ThreadPools = "b189fb0b-2eb5-4ed4-bc0c-d34c51242431" [compat] ConstraintDomains = "0.2" Dictionaries = "0.3" Evolutionary = "0.8" OrderedCollections = "1" +ThreadPools = "1" julia = "1.6" [extras] diff --git a/src/CompositionalNetworks.jl b/src/CompositionalNetworks.jl index cd4403b..f4e972b 100644 --- a/src/CompositionalNetworks.jl +++ b/src/CompositionalNetworks.jl @@ -6,6 +6,7 @@ using Dictionaries using Evolutionary using OrderedCollections using Random +using ThreadPools # Exports utilities export csv2space diff --git a/src/genetic.jl b/src/genetic.jl index 7b7961e..b145160 100644 --- a/src/genetic.jl +++ b/src/genetic.jl @@ -48,7 +48,7 @@ function optimize!(icn, X, X_sols, global_iter, local_iter, dom_size, param=noth aux_results = Vector{BitVector}(undef, global_iter) nt = Base.Threads.nthreads() @info """Starting optimization of weights$(nt > 1 ? " (multithreaded)" : "")""" - Base.Threads.@threads for i in 1:global_iter + @qthreads for i in 1:global_iter @info "Iteration $i" aux_icn = deepcopy(icn) _optimize!(aux_icn, X, X_sols, dom_size, param;