Open asenzz opened 7 months ago
Hi,
Which interface are you using?
PRIMA is designed to be recursion-safe and thread-safe. This is tested during CI:
https://github.com/libprima/prima/blob/main/fortran/tests/test_bobyqa.f90#L289-L303
A more extensive test (also included in the CI) is done via the MATLAB interface:
https://github.com/libprima/prima/blob/main/matlab/tests/recursive.m
Of course, bugs may exist.
I can help debug this issue, but from what I gather so far, the problem is in the Fortran code.
It would be nice if you could help debug it, or provide a minimal working example.
One thing to check: did you use proper compiler options to enforce recursion-safety when building the Fortran library? For gfortran, it is -frecursive
, and for Intel oneAPI, it is -assume recursion
(Unix) or /assume:recursion
(Win).
Thank you.
Hmm seems that the C interface does give problems when used in multiple threads at once. I'll let you know as soon as I have something. It happens with LINCOA. Haven't retested BOBYQUA.
Could you provide a minimal example? Thank you.
If I run a BOBYQA instance from within a BOBYQA cost function, the call-back pointer, which in turn calls a lambda expression with captured references to variables, seems to be overwriting the memory of the lambda expression object and the captured variables are full of junk data. I can help debug this issue, but from what I gather so far, the problem is in the Fortran code. Thanks, Z