File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -1015,14 +1015,22 @@ function threaded_monodromy_solve!(
1015
1015
progress,
1016
1016
)
1017
1017
queue = Channel {LoopTrackingJob} (Inf )
1018
- Threads. resize_nthreads! (MS. trackers)
1018
+
1019
+ tracker = MS. trackers[1 ]
1020
+ ntrackers = length (MS. trackers)
1021
+ nthr = Threads. nthreads ()
1022
+ resize! (MS. trackers, nthr)
1023
+ for i = ntrackers+ 1 : nthr
1024
+ MS. trackers[i] = deepcopy (tracker)
1025
+ end
1026
+
1019
1027
data_lock = ReentrantLock ()
1020
1028
t₀ = time ()
1021
1029
retcode = :in_progress
1022
1030
stats = MS. statistics
1023
1031
notify_lock = ReentrantLock ()
1024
1032
cond_queue_emptied = Threads. Condition (notify_lock)
1025
- workers_idle = fill (true , Threads . nthreads () )
1033
+ workers_idle = fill (true , nthr )
1026
1034
interrupted = Ref (false )
1027
1035
queued = Ref (0 )
1028
1036
try
Original file line number Diff line number Diff line change @@ -592,7 +592,15 @@ function threaded_solve(
592
592
started = Threads. Atomic {Int} (0 )
593
593
finished = Threads. Atomic {Int} (0 )
594
594
try
595
- Threads. resize_nthreads! (solver. trackers)
595
+ tracker = solver. trackers[1 ]
596
+ ntrackers = length (solver. trackers)
597
+ nthr = Threads. nthreads ()
598
+
599
+ resize! (solver. trackers, nthr)
600
+ for i = ntrackers+ 1 : nthr
601
+ solver. trackers[i] = deepcopy (tracker)
602
+ end
603
+
596
604
tasks = map (enumerate (solver. trackers)) do (i, tracker)
597
605
@tspawnat i begin
598
606
while (k = Threads. atomic_add! (started, 1 ) + 1 ) ≤ N && ! interrupted
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ function KeywordArgumentException(key, given)
149
149
KeywordArgumentException (key, given, " " )
150
150
end
151
151
function Base. showerror (io:: IO , E:: KeywordArgumentException )
152
- print (io, " Invalid argument $given for $key . " , E. msg)
152
+ print (io, " Invalid argument $(E . given) for $(E . key) . " , E. msg)
153
153
end
154
154
155
155
struct FiniteException <: Exception
You can’t perform that action at this time.
0 commit comments