libprima / prima

PRIMA is a package for solving general nonlinear optimization problems without using derivatives. It provides the reference implementation for Powell's derivative-free optimization methods, i.e., COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. PRIMA means Reference Implementation for Powell's methods with Modernization and Amelioration, P for Powell.
http://libprima.net
BSD 3-Clause "New" or "Revised" License
292 stars 36 forks source link

`PRIMA_INTEGER_KIND = 16` affects solvers' behavior if compiled with `gfortran -Ofast -fno-stack-arrays` #97

Open zaikunzhang opened 9 months ago

zaikunzhang commented 9 months ago

If we set PRIMA_INTEGER_KIND to 16, meaning to use 16-bit integers for internal calculations, then the following solvers behave visibly differently from the standard version when the Fortran code is compiled by gfortran -Ofast -fno-stack-arrays.

UOBYQA, 1--100-dimensional problems NEWUOA, 1--200-dimensional problems BOBYQA, 1--200-dimensional bound-constrained problems

The same difference is not observable on other solvers or when the code is compiled with gfortran -ffast-math.

This is unexpected.

See the artifacts of https://github.com/primalib/prima/actions/workflows/profile_int16.yml for the results.