Segmentation fault with ParMETIS_V3_PartKway


I'm trying to use ParMETIS to partition a graph stored in a compatible file.
To do that, I'm using ParMETIS_V3_PartKway. It works perfectly with graphs containing 64, 128 or 256 vertices. But every case containing more than 256 vertices raise a segmentation fault. I use my own code to call ParMETIS_V3_PartKway but the "parmetis" binary included with ParMETIS give me exactly the same result. I call it like this : ./parmetis 1024_parmetis.graph 1 8 0 0 0 0 and it gives me that :

[fourmi048:27917] [ 0] /lib64/ [0x7ffff6caa6e0]
[fourmi048:27917] [ 1] ./parmetis(libmetis__CreateCoarseGraphNoMask+0x2fd) [0x46999c]
[fourmi048:27917] [ 2] ./parmetis(libmetis__CreateCoarseGraph+0xb8) [0x468c8c]
[fourmi048:27917] [ 3] ./parmetis(libmetis__Match_SHEM+0x66d) [0x468af1]
[fourmi048:27917] [ 4] ./parmetis(libmetis__CoarsenGraph+0x1b9) [0x467c2d]
[fourmi048:27917] [ 5] ./parmetis(libmetis__MultilevelBisect+0xa0) [0x460b6f]
[fourmi048:27917] [ 6] ./parmetis(libmetis__MlevelRecursiveBisection+0x10f) [0x46084a]
[fourmi048:27917] [ 7] ./parmetis(libmetis__MlevelRecursiveBisection+0x321) [0x460a5c]
[fourmi048:27917] [ 8] ./parmetis(libmetis__MlevelRecursiveBisection+0x2cf) [0x460a0a]
[fourmi048:27917] [ 9] ./parmetis(METIS_PartGraphRecursive+0x1ef) [0x460693]
[fourmi048:27917] [10] ./parmetis(libmetis__InitKWayPartitioning+0x205) [0x46d4b9]
[fourmi048:27917] [11] ./parmetis(libmetis__MlevelKWayPartitioning+0xcb) [0x46d0e9]
[fourmi048:27917] [12] ./parmetis(METIS_PartGraphKway+0x2e8) [0x46cf74]
[fourmi048:27917] [13] ./parmetis(libparmetis__PartitionSmallGraph+0x1a2) [0x41af9c]
[fourmi048:27917] [14] ./parmetis(ParMETIS_V3_PartKway+0x46f) [0x430db7]
[fourmi048:27917] [15] ./parmetis(main+0x414) [0x40c6d8]
[fourmi048:27917] [16] /lib64/ [0x7ffff6c96586]
[fourmi048:27917] [17] ./parmetis [0x40c209]

My graphs have weighted edges.

I hope I gave enough informations... Do you have any idea?


RE: Same problem, SegFault with increased no. of processes

I am having the same problem of Segmentation fault with 'ParMETIS_V3_PartKway', when i go beyond a certain number of partitions/processes. ( In my case, I jump from 27, 64, 125, 216 no of processes and the problem is observed from 216 onwards.

I read through this thread and felt that it went in a wrong flow (about the number of vertices being more or a particular node), which may not be the actual cause as per the discussion before. Also, as Dr. Karypis and ftessier said, I tried playing around with ncon value, 1, 1.02, 1.03 etc. but didn't help.

Could you please guide me to look in correct direction to get it resolved? [there is exact same problem mentioned in an another question as well: ]

Thank you.

RE: I Tried to debug this with

I Tried to debug this with GDB and here is what I found :

When I ask to ParMETIS_V3_PartKway to partition my 1024-vertices graph in 8 parts, the first one contains 129 vertices instead of 128... I didn't find how is it possible but it seems to be the cause of the segfault. Maybe someone has an idea about that?

RE: You should check that you are

You should check that you are passing the right values in the parameters, especially the vtxdist array. If the first processor thinks that it has 129 vertices, then this is due to the vtxdist array.

RE: Hmm... I checked and it seems

Hmm... I checked and it seems to be ok. I run my application on only one processor. So my vtxdist array is like this : [0, 1024].

RE: How did you determine that

How did you determine that the 0th processor has 129 vertices?

RE: I called ParMETIS_V3_PartKway

I called ParMETIS_V3_PartKway in order to partition my graph in 8 parts and counted the number of occurences of "0". It gives me 129. By the way here are the number of occurences for each partition in the part array :

0 : 129
1 : 129
2 : 129
3 : 129
4 : 129
5 : 123
6 : 128
7 : 128

The code I'm using works perfectly with my graph files containing 64, 128 or 256 vertices...
And, as I said it before, I obtained exactly the same results with my code and with the "parmetis" binary included with ParMETIS.

RE: So the issue is that the

So the issue is that the computed partitions are not of the same size? If this is the case, then there is nothing wrong. ParMetis does not guarantee that. By default it tries to enforce a load balance of 1.03 (max/average).

RE: Hmm... Ok, I understand. Is

Hmm... Ok, I understand. Is there a way to impose to ParMETIS to partition a graph in equal parts?
I tried to set graph->ncon to 1.0001 and it seems to work.
However doesn't look like a good solution.

Thx for your help ;)

RE: ParMetis is not designed to

ParMetis is not designed to produce equal size partitions. I will not reduce the balance factor any lower than 1.02.