with open('r.data') as f:
    m = mmap.mmap(f.fileno(), 0, mmap.MAP_SHARED, mmap.PROT_READ)
r = np.frombuffer(m, dtype='int64')
r = r.reshape(shape)
numpy tofile() with very large arrays saves all zeros