ELIFE-ASU / Inform

A cross platform C library for information analysis of dynamical systems
https://elife-asu.github.io/Inform
MIT License
21 stars 3 forks source link

Segmentation fault when computing transfer entropy on linux_64 #87

Open geofurb opened 2 years ago

geofurb commented 2 years ago

The issue appears to be occurring with PyInform, but I believe similar to #85 this is an issue with the underlying Inform binary. Applying the update from #85 does not resolve this issue, so it appears to be a separate problem.

import numpy as np
import pyinform

a = np.random.rand(4000) > 0.25
b = np.random.rand(4000) > 0.40

print(a.dtype,b.dtype)
for k in range(1, 100):
    print(k, pyinform.transfer_entropy(a, b, k=k))

Result: Segfault at k=30

It may be informative that this second example segfaults at k=19:

import numpy as np
import pyinform

c = np.random.randint(0, 3, 4000)
d = np.random.randint(0, 2, 4000)

print(c.dtype,d.dtype)
for k in range(1, 100):
    print(k, pyinform.transfer_entropy(c, d, k=k))

Segfault is consistent on two machines: Ubuntu 18.04 with i7-5820K, 128 GB RAM and Ubuntu 22.04 with i7-11800H, 64 GB RAM