networkit icon indicating copy to clipboard operation
networkit copied to clipboard

ParallelConnectedComponents cause Segmentation fault

Open academe-01 opened this issue 2 years ago • 2 comments

Hi, any idea what's the problem?

import networkit as nk

x = nk.Graph(6)
x.addEdge(0, 1)
x.addEdge(1, 2)
x.addEdge(3, 4)
x.addEdge(4, 5)
cc = nk.components.ParallelConnectedComponents(x)
cc.run()

cc.hasFinished()
>> True
cc.numberOfComponents()
>> 2

cc.getComponents()
Segmentation fault (core dumped)

academe-01 avatar May 13 '22 01:05 academe-01

I replicated your issue and, after some testing, it seems that ParallelConnectedComponents is bugged. Our tests are not failing becausegetComponents() is never tested for this algorithm.

My recommendation is to use ConnectedComponents, even though it is not parallel, the algorithm is quite fast.

angriman avatar May 24 '22 15:05 angriman

My recommendation is to use ConnectedComponents, even though it is not parallel, the algorithm is quite fast.

I need to process few billions of CC, unfortunately single threaded ConnectedComponents not working in my case....

academe-01 avatar May 29 '22 09:05 academe-01

Closing this issue. We merged a PR that fixes this problem. This will be part of the next (possibly bug-fix) release. You can use it right now by installing from the master-branch (or downloading a wheel artifact from CI).

fabratu avatar Sep 03 '22 09:09 fabratu