Skip to content

Commit

Permalink
Add ThreadPools and tag version
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzaare committed Mar 17, 2021
1 parent 63b8f3b commit e4c70e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
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"
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]
Expand Down
1 change: 1 addition & 0 deletions src/CompositionalNetworks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using Dictionaries
using Evolutionary
using OrderedCollections
using Random
using ThreadPools

# Exports utilities
export csv2space
Expand Down
2 changes: 1 addition & 1 deletion src/genetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e4c70e5

Please sign in to comment.