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

ensure gadget binary field data are in native endianness #2120

Merged
merged 1 commit into from Dec 13, 2018

Conversation

ngoldbaum
Copy link
Member

Some low-level routines (in the test case in the bug report it was the selection machinery) expect raw field data from the low-level I/O routines to be in native byte order. However, here we're reading bigendian data and pass it directly to those low-level routines. This breaks on little endian architectures.

The fix is to ensure the data are in native byte order after we read it in.

Ping @weiguangcui and maybe @matthewturk to look this over?

@chummels
Copy link
Member

@ngoldbaum Whoa, this is great! Similar code may also be able to address the endian issues I described in PR #1944 ? If so, you just saved me a ton of time...

@ngoldbaum ngoldbaum changed the title ensure gadget binary field data are little endian. ensure gadget binary field data are in native endianness Dec 11, 2018
Copy link

@weiguangcui weiguangcui left a comment

Choose a reason for hiding this comment

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

Hi all,
I have tested the code with both python2 and 3. All worked fine to me.
Thank you @ngoldbaum !

@ngoldbaum ngoldbaum merged commit d0d64c2 into yt-project:master Dec 13, 2018
ngoldbaum pushed a commit to ngoldbaum/yt that referenced this pull request Feb 22, 2019
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.

None yet

3 participants