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

fix reading of byte-swapped input files (#95) #101

Merged
merged 1 commit into from
Feb 17, 2023

Commits on Jan 31, 2023

  1. fix reading of byte-swapped input files (LLNL#95)

    When reading a byte-swapped file, the input is grouped to 4-byte words
    and each of them is swapped individually. When we try to read such a
    file, we first validate its header using zfp_read_header with the
    ZFP_HEADER_MAGIC flag. This flag causes it to only validate the first
    word to be "zfp\x05". If it is not exactly that, it gives up.
    Unfortunately, this magic word can already be swapped. The actual byte
    swapping code would only be tried once the full header would fail to
    read, so automatic byte swapping never worked.
    
    Instead, when encountering a header with bad magic, try swapping it
    already and only try reading the full header once the magic (normal or
    swapped) has been read successfully.
    
    Thanks to Mark C. Miller, Peter Lindstrom and Enrico Zini for doing most
    of the debugging to get here.
    helmutg committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    e03e79e View commit details
    Browse the repository at this point in the history