Gnimuc / LBFGSB.jl

Julia wrapper for L-BFGS-B Nonlinear Optimization Code
MIT License
38 stars 6 forks source link

Update wrapper.jl #12

Closed raminammour closed 2 years ago

raminammour commented 2 years ago

Hello,

I have seen a deadlock from calling lbfgsb many times with multi-threaded code inside jupyter notebooks. I have not been able to produce a MWE to submit a reliable test here, but I have been able to fix locally with the flush(stdout) commands added above.

It only happens when iprint=1 and there would be a lot of printing, which made me suspect buffered IO and try the solution submitted here.

I know this may be a poor justification for the PR, but the above commands can't hurt (hopefully) :)

Cheers!

Gnimuc commented 2 years ago

Thanks!