Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodetection of ILP64 can trigger Input Errors #101

Open
BrandonGroth opened this issue Jan 23, 2023 · 1 comment
Open

Autodetection of ILP64 can trigger Input Errors #101

BrandonGroth opened this issue Jan 23, 2023 · 1 comment

Comments

@BrandonGroth
Copy link

In autodetection.c, LBT specifies a negative N value for input to "probe" the library whether it is using LP64 or ILP64 (autodetect_blas_interface calling isamax). However, our BLAS library by default treats negative N values as an input error and issues a STOP 1.

Other libraries like IMSL also treat negative N values as input errors and exit: https://help.imsl.com/fortran/6.0/stat/default.htm?turl=usererrors.htm

Is there any way to work around this issue?

@staticfloat
Copy link
Member

If you have other ideas on how to more safely autodetect the library interface, I'm happy to try them out. In this case, this probing routine was chosen because it worked well with all libraries tested at the time (OpenBLAS, MKL, Accelerate and reference BLAS).

If your BLAS library is meant to be used by a variety of clients, I suggest not killing the process when the user does something wrong, but instead raising an error through whatever mechanism you like (in the case of LAPACK, there is an error return code for this purpose); it is quite disruptive to kill the process if someone calls with incorrect arguments.

It is possible we could add functionality to LBT to skip autodetection, but I am loathe to do that as the consequences for getting the interface wrong are severe; the program may segfault, or even worse, silently give wrong answers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants