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) :)
Hello,
I have seen a deadlock from calling
lbfgsb
many times with multi-threaded code insidejupyter
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 theflush(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!