Skip to content

Check cpuinfo only when needed. #180

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

Closed
wants to merge 1 commit into from

Conversation

QuLogic
Copy link
Contributor

@QuLogic QuLogic commented Mar 19, 2019

The cpuinfo module does not support s390x and fails to import, but we don't really need it since we've set CFLAGS. Move the import later so it's only used when actually checking CPU instruction support.

TODO:

  • [N/A] Unit tests and/or doctests in docstrings
  • tox -e py37 passes locally
  • tox -e py27 passes locally
  • [N/A] Docstrings and API docs for any new/modified user-facing classes and functions
  • Changes documented in docs/release.rst
  • tox -e docs passes locally
  • AppVeyor and Travis CI passes
  • Test coverage to 100% (Coveralls passes)

The cpuinfo module does not support s390x and fails to import, but we
don't really need it since we've set CFLAGS. Move the import later so
it's only used when actually checking CPU instruction support.
Copy link
Member

@alimanfoo alimanfoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this. It looks good. Only thought is that if user has set CFLAGS then sources for SSE2 and AVX2 modules from c-blosc will never be included. So, I.e., user might give CFLAGS="-mavx2" but would not get AVX2 modules compiled because sources would be excluded. Hope that makes sense.

Not sure what is best solution, maybe would have been better rather than have variables like DISABLE_NUMCODECS_AVX2 which only allows to turn something off, we should have ENABLE_NUMCODECS_AVX2 which could be set to 1 to force on or set to 0 to force off. Thoughts welcome.

@QuLogic
Copy link
Contributor Author

QuLogic commented Mar 21, 2019

Since those files require setting -DSHUFFLE_SSE2_ENABLED and -DSHUFFLE_AVX2_ENABLED, maybe check if the user's set that in CFLAGS?

It's impossible to just look for a compiler option (e.g., -msse2), because it could be implied by any number of -march flags.

@jakirkham
Copy link
Member

jakirkham commented Apr 20, 2019

Would it be possible to raise this with the developers of cpuinfo?

ref: https://github.com/workhorsy/py-cpuinfo

@QuLogic
Copy link
Contributor Author

QuLogic commented Apr 20, 2019

It's known upstream: workhorsy/py-cpuinfo#69

@jakirkham
Copy link
Member

It seems like the developer has done some work on it (has a branch) and probably needs more people from the community with access to that architecture to engage with him and try it out. Would you mind engaging in that issue directly and sharing a bit more about what in that branch doesn’t work?

@jakirkham jakirkham mentioned this pull request Nov 3, 2019
8 tasks
@jakirkham
Copy link
Member

It looks like upstream addressed this issue. So I've submitted PR ( #202 ), which merely updates cpuinfo.py to a commit with the needed feature. Can you please check if that is acceptable @QuLogic? If so, I'll go ahead and merge that PR.

@QuLogic QuLogic deleted the late-cpuinfo branch September 16, 2020 10:15
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

Successfully merging this pull request may close these issues.

3 participants