I want to convert the binary generated by graph500 to a text format (maybe edgelist). I was using this scriptto do that according to this answer, but I am getting confused by the results and the consequent error delineated below.
I created a graph500 of scale 2 (4 vertices) and tried to print the output of fin.read(16), its size and the edgelist v1,v2 for every iteration in the loop. I get weird results (such as the below):
edge txt : (0, 4294967297)
edge : b'\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00'
edge size = 49
edge txt : (4294967296, 1)
edge : b'\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00'
edge size = 49
........
edge txt : (1, 8589934593)
edge : b'\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00'
edge size = 49
edge txt : (4294967296, 1)
edge : b''
edge size = 33
I expected the vertices to be 4 in number; so the repeated huge numbers in the tuples (viz. 4294967296, 8589934593... etc) are the memory locations?
And since the fin.read(16)'s size is 49 bytes, should the format of unpacked be something other than "qq"? Interestingly, the last line which is blank is 33 (16 less than 49) after which I get the following error :
(v1, v2) = struct.unpack("qq", edge)
struct.error: unpack requires a buffer of 16 bytes
What am I doing wrong and what should I change? Thanks in advance!