Parallelize solve_problems#195
Parallelize solve_problems#195MaxenceGollier wants to merge 1 commit intoJuliaSmoothOptimizers:mainfrom
Conversation
|
The race condition causes issue, for example, see MaxenceGollier/ExactPenalty.jl#57. I will fix the BSD tests as well. |
a9f9ba9 to
09a20fa
Compare
tmigot
left a comment
There was a problem hiding this comment.
@MaxenceGollier If I understand correctly you propose to do multi-threading over problems. This assumes that problems are thread-safe, which is the case for CUTEst and (in theory) OptimizationProblems.jl, however it also needs the solvers to be thread safe, which I don't think we really test.
If we are going for a multi-threaded version, I think it should be a different function than solve_problems also, because it will never be safe in general (for any set of problems, and any set of solvers).
| stats = DataFrame(names .=> [T[] for T in types]) | ||
| stats_lock = ReentrantLock() |
There was a problem hiding this comment.
Would it be better to have one stats per thread and merge all of them in the end ?
|
The idea would be that your version is faster when it is possible, and #194 would be safer. So, both approaches might be complementary. |
@dpo, @tmigot
#120
(hopefully) supersedes #127, #167, #176.
To parallelize over solvers instead of problems, CUTEst problems make it very very difficult, i have tried multiple times but failed. I think it is fine just to parallelize over problems.
To make things clear,
_run_problemwhich just performs one iteration of the loop.first_problemis set to false to avoid race conditions on this variable and other variables accessed whenfirst_problemis true.