ParMETIS segfault

Parmetis seems to successfully partition smaller graphs serially. Once graph size passes the 10,000 vertex threshold and parmetis switches to parallel mode, it segfaults.

nchanged is larger than the nvtxs which causes the loop at match.c:306 to run past the end of iperm.

What could I be doing wrong to cause this segfault?

Kevin Tew

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5793fa6 in libparmetis__Match_Global (ctrl=0x24c8dde0, graph=0xa4922d0) at /home/tewk/Downloads/parmetis-4.0.3/libparmetis/match.c:306
306 ii = iperm[changed[i]];
(gdb) bt
#0 0x00007ffff5793fa6 in libparmetis__Match_Global (ctrl=0x24c8dde0, graph=0xa4922d0) at /home/tewk/Downloads/parmetis-4.0.3/libparmetis/match.c:306
#1 0x00007ffff578bd0a in libparmetis__Global_Partition (ctrl=0x24c8dde0, graph=0xa4922d0) at /home/tewk/Downloads/parmetis-4.0.3/libparmetis/kmetis.c:189
#2 0x00007ffff578b676 in ParMETIS_V3_PartKway (vtxdist=0x24f633b0, xadj=0x24da83c0, adjncy=0x25b53ec0, vwgt=0x0, adjwgt=0x0, wgtflag=0x7fffffffc504, numflag=0x7fffffffc508, ncon=0x7fffffffc4fc,
nparts=0x7fffffffc500, tpwgts=0x99f4f70, ubvec=0x318f5a0, options=0x7fffffffc710, edgecut=0x7fffffffc50c, part=0x255d8a20, comm=0x7fffffffc558) at /home/tewk/Downloads/parmetis-4.0.3/libparmetis/kmetis.c:94

(gdb) p nchanged
$1 = 9623
(gdb) p ii
$2 = 8358
(gdb) p i
$3 = 9238
(gdb) p nvtxs
$4 = 9112