Can't read foreign endian SION key/value files
Reported by Bert Wesarg:
we encountered a problem when we want to read a trace from a foreign endian system. The direction itself does not matter. Attached[1] are two files, from a big and a little endian system respectively. The error already shows up when running siondump -k on the file:
Here is a working siondump on the same endian system:
$ siondump -k test-sion-be-1x4 siondump: sid: 0 siondump: filename: test-sion-be-1x4 siondump: prefix: test-sion-1x4 siondump: number of tasks: 1 siondump: current endianness: big siondump: file endianness: big siondump: filesystem blocksize: 1048576 bytes ( 1.00 MB) siondump: file set: No siondump: file number: 0 siondump: number of files: 1 siondump: flag1: 219043332096 (51+0) siondump: flag2: 0 siondump: keyval: 51 (SION_KEYVAL_INLINE) siondump: file format version: 5 siondump: file SIONlib version: 1.5p4 (current 1.5p4) siondump: number of blocks: 3 siondump: size of chunks: 12582912 bytes ( 12.00 MB) siondump: datasize in file (aggr.): 8389184 bytes ( 8.00 MB) siondump: size of full chunks: 8388608 bytes ( 8.00 MB) # 2 siondump: size of partly filled chunks: 576 bytes ( 0.00 MB) # 1 siondump: size of empty chunks: 0 bytes ( 0.00 MB) # 0 siondump: overhead compared to task-local file: 4193728 bytes ( 4.00 MB) siondump: file usage (user data/chunk size): 66.671244% siondump: fsblocks, size of used blocks: 9437184 bytes ( 9.00 MB, 9 blocks) siondump: fsblocks, size of fully used locks: 8388608 bytes ( 8.00 MB, 8 blocks) siondump: fsblocks, size of partly used blocks: 576 bytes of 1048576 bytes ( 0.00 MB of 1.00 MB, 1 blocks) siondump: fsblocks, used fsblocks/chunk size: 75.000000% siondump: fsblocks, user data/used blocks: 88.894992%
Task 00: key[00]= 3: #blocks= 1 totalsize= 2097280 Task 00: key[01]= 2: #blocks= 1 totalsize= 2097280 Task 00: key[02]= 1: #blocks= 1 totalsize= 2097280 Task 00: key[03]= 0: #blocks= 1 totalsize= 2097280
The little-endian file on a big-endian system (showing only the Task section):
$ siondump -k test-sion-le-1x4
SION_ERROR_RETURN on rank 0, rc=0: could not skip data section of one block (0 bytes) from file ... Task 00: key[00]=216172782113783808: #blocks= 1 totalsize=-9223336852482686976
The big-endian file on a little-endian system (showing only the Task section):
$ siondump -k test-sion-be-1x4
SION_ERROR_RETURN on rank 0, rc=0: could not skip data section of one block (0 bytes) from file ... Task 00: key[00]=216172782113783808: #blocks= 1 totalsize=-9223336852482686976