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

TST: Skip f2py TestSharedMemory for LONGDOUBLE on macos/arm64 #18862

Merged

Conversation

ogrisel
Copy link
Contributor

@ogrisel ogrisel commented Apr 27, 2021

Those test fail on macos/arm64 as discussed here:

#18143 (comment)

Honestly I do not really understand what these tests are checking but LONGDOUBLE is an alias for DOUBLE (float64) on macos/arm64 while it is equivalent to float128 on x86_64. See the linked discussion for more details.

LONGDOUBLE is an alias for DOUBLE on this platform.
@ogrisel
Copy link
Contributor Author

ogrisel commented Apr 27, 2021

Alternatively one could check:

np.longdouble.dtype is not np.double.dtype

instead of platform info.

@seberg
Copy link
Member

seberg commented Apr 27, 2021

This is a bit strange, I guess there is some place here were the alignment for the clongdouble is taken as the itemsize instead of the size of a double? (I am also surprised a 64bit systems malloc will only guarantee an 8-byte alignment even then).

But if the failure is alignment related, then this seems OK considering the current comment. (I am not sure its strictly correct, but it seems fine)

@charris charris changed the title Skip f2py TestSharedMemory for LONGDOUBLE on macos/arm64 TST: Skip f2py TestSharedMemory for LONGDOUBLE on macos/arm64 Apr 27, 2021
@ogrisel
Copy link
Contributor Author

ogrisel commented Apr 27, 2021

The failures are here:

https://gist.github.com/ogrisel/851992e4c555af67881c9e0f2281c5df

But I do not understand the tests themselves. I have never use f2py.

@seberg
Copy link
Member

seberg commented Apr 27, 2021

Yeah, hopefully @pearu may have some insight.

@ogrisel
Copy link
Contributor Author

ogrisel commented Apr 27, 2021

You might also want to have a look at #18143 (comment) to compare that to what we get on other platforms.

@charris charris merged commit 1fee7ac into numpy:main Apr 27, 2021
@charris
Copy link
Member

charris commented Apr 27, 2021

Thanks @ogrisel . The @if decorator could possibly be simplified. What does finfo('longdouble') say on M1?

EDIT: And on Windows.

@ogrisel
Copy link
Contributor Author

ogrisel commented Apr 28, 2021

@charris

What does finfo('longdouble') say on M1?

>>> np.finfo('longdouble')
finfo(resolution=1e-15, min=-1.7976931348623157e+308, max=1.7976931348623157e+308, dtype=float64)

@ogrisel ogrisel deleted the skip-longdouble-f2py-tests-on-macos-arm64 branch April 28, 2021 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants