pik-copan / pyunicorn

Unified Complex Network and Recurrence Analysis Toolbox
http://pik-potsdam.de/~donges/pyunicorn/
Other
195 stars 86 forks source link

Segmentation error in Intersystem Recurrence Network #145

Closed sombuddha-bagchi closed 9 months ago

sombuddha-bagchi commented 3 years ago

I am using Python 3.8.3. While solving with 2 timeseries of 2000 datapoints, the code is giving the following error: 'Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)'. I tried debugging and the code fails at the command where the network is being constructed, i.e. 'InterSystemRecurrenceNetwork(x,y,metric=METRIC,threshold=(0.1, 0.04, 0.1))'. Can someone please help?

ntfrgl commented 1 year ago

I am reopening this issue, as it seems to have been closed without confirming a resolution.

@fkuehlein, could you please look into this? The recently updated Cython compiler directives might provide more information than the segfault above.

fkuehlein commented 1 year ago

Hi @ntfrgl,

I can confirm this is still an issue. However, the output still does not provide me any more information than the segfault.

The following code works fine for smaller numbers of nodes (apart from the issue in #128), but starts to fail for bigger amounts of nodes, starting at about 2000.

import numpy as np
from pyunicorn.timeseries import InterSystemRecurrenceNetwork

# create example timeseries
x = np.linspace(0,10, 2000) 
sine = np.sin(x)

ISRN = InterSystemRecurrenceNetwork(sine, sine, threshold=(0.1, 0.2, 0.1))

Then it just returns

Calculating recurrence plot at fixed threshold...
Calculating the supremum distance matrix...
Calculating recurrence plot at fixed threshold...
Calculating the supremum distance matrix...
Calculating recurrence plot at fixed threshold...
Calculating the supremum distance matrix...
Calculating cross recurrence plot at fixed threshold...
Calculating the supremum distance matrix...
Segmentation fault: 11

So it calls the CrossRecurrencePlot, but fails before printing the distance matrix in CrossRecurrencePlot.set_fixed_threshold() (which it does print for smaller node numbers).

Might thus actually be related to #128?

ntfrgl commented 1 year ago

This appears to be resolved by the commits above.

fkuehlein commented 1 year ago

I can confirm that. Will add at least a simple test for InterSystemRecurrenceNetwork before closing this issue.