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

Docs: endian_reverse unclear #1822

Closed
ax3l opened this issue Oct 14, 2019 · 14 comments · Fixed by #1833
Closed

Docs: endian_reverse unclear #1822

ax3l opened this issue Oct 14, 2019 · 14 comments · Fixed by #1833

Comments

@ax3l
Copy link
Contributor

ax3l commented Oct 14, 2019

Migrated from here so it does not get lost.

The CMake flag ADIOS2_USE_ENDIAN_REVERSE=ON looks scary to me for the following reason: if a file was written in one endinaness and read again in another, the BP file format should encode that and our BPEngine could automatically take care of it. (E.g. HDF5 does it that way).

I was working/interning a few years ago in Juelich where serveral big and little endian machines were connected to the same file system and workflows going back and forth were common. Using various adios modules, depending on the origin of the data, would be very complicated.

If it's not possible to already express this in BP itself, which I think it should be for portability, then we should at least make this a runtime option for now.

@williamfgc
Copy link
Contributor

@ax3l what's the actual issue? Please, see my explanation in the referenced link.

@pnorbert
Copy link
Contributor

pnorbert commented Oct 14, 2019 via email

@williamfgc
Copy link
Contributor

Also, there is a lack of testing due to limited access to such configuration in our CI. The feature itself is not fully tested (in CI or nightly), it was just done for one user who kindly provided some tests.

@ax3l
Copy link
Contributor Author

ax3l commented Oct 14, 2019

The problem is that endian portability and conversion should be done automatically, not by a user and most certainly not by yet-an-other binary variant of the library. As explained in the description, that makes workflows super complicated.

Imagine the following: machine A writes big endinanness to the FS, machine B is small endian and also writes to the FS.
Now I process both data on system B, am I supposed to reload the ADIOS2 module for each access? Shall I link two ADIOS2 libraries? Things like that :-)

Yes, CI is an issue these days :-S

@williamfgc
Copy link
Contributor

@ax3l nothing is preventing turning this ON if that is appropriate for the system use case.

The problem is that endian portability and conversion should be done automatically

Not really, we only had one case that required this feature

@williamfgc
Copy link
Contributor

@ax3l I think this is more of a system admin packaging problem than an adios2 problem. Would you agree?

@ax3l
Copy link
Contributor Author

ax3l commented Oct 15, 2019

Well in my opinion, I think the workflow I describe in detail in the PR description and comment is not supported yet and BP is not endian-portable due to it.

I think a portable fileformat (BP) or adios engine of any kind should be self-aware of its endianness (just encode it) and then just flip during read properly when required, without interaction from user or sysadmin. I really do not think this should be a compile time option or for the better a runtime option, but an opaque feature of adios data reading/writing.

This problem has been solved for a long time by just adding the write endianness to meta-data, e.g. in protobuf, Cap’n Proto, HDF5, et al., and then just runtime determining of one has to flip all reads depending on the read architecture.

@pnorbert
Copy link
Contributor

pnorbert commented Oct 15, 2019 via email

@williamfgc
Copy link
Contributor

@ax3l OK, thanks for your input. I see the confusion, and I second @pnorbert response. Any BP file (regardless of compilation options) is aware of its endianness. The decision workflow should be: do we ever going to read big and little endian BP files on our target system? If yes, then turn it on, but knowing that we don't test on CI or nightly, if no (the majority of our users) then do nothing.

@ax3l
Copy link
Contributor Author

ax3l commented Oct 15, 2019

Ohh, I see. 💡 This is just enabling potential runtime endian-transforms, yet only when they are necessary!

I think there is a new doc string in 2.4.0+ as well that says: Big/Little Endian Interoperability for different endianness platforms at write and read.

Well, all of that makes a lot of sense now. The short spack variant string Enable Endian Interoperability confused me.

Mea cupla and thanks for the clarification. Will update the spack variant description.

@ax3l ax3l closed this as completed Oct 15, 2019
@ax3l
Copy link
Contributor Author

ax3l commented Oct 15, 2019

Shall we generally update the string on that option to something like Enable endian conversion if a different endianness is detected between write and read.?

@williamfgc
Copy link
Contributor

@ax3l no problem, improving the documentation is always welcome. To be fair, I used boost's endian_reverse terminology, but feel free to make the description more clear.

@williamfgc
Copy link
Contributor

williamfgc commented Oct 15, 2019

Also, the functionality in the code is based on calls to std::reverse, but this function is more general than for just endianness.

@ax3l ax3l changed the title endian_reverse should be in BP Docs: endian_reverse unclear Oct 15, 2019
@ax3l
Copy link
Contributor Author

ax3l commented Oct 15, 2019

Hehe, sorry again for confusing this. I should have just immediately grep-ed in the source for what it is doing.

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

Successfully merging a pull request may close this issue.

3 participants