ASSERT in ParMetis kwayfm.c

Hi

I recently introduced a platform independent (quite important for us) random number generator into my local copy of ParMetis (using Boost for the implementation). Since then I have had a few models assert in some parallel configurations. Before this they were fine. I have checked the number generator - seems fine also.

I am getting an assert in kwayfm.c @ line 309.

ASSERTP(ctrl, ognpwgts[j*ncon+h] <= badmaxpwgt[j*ncon+h] ||
pgnpwgts[j*ncon+h] <= ognpwgts[j*ncon+h],
(ctrl, "%.4f %.4f %.4f\n", ognpwgts[j*ncon+h],
badmaxpwgt[j*ncon+h], pgnpwgts[j*ncon+h]));

It appears that the propose node moves are violating the imbalance tolerance? The numbers involved look reasonable but I do admit I haven't made a Valgrind run yet.

I tried looking at the code in Metis but is seemed significantly different. I am probably being a bit slow but line 183

if (my_edegrees[j].ewgt > my_edegrees[k].ewgt ||
(my_edegrees[j].ewgt == my_edegrees[k].ewgt &&
IsHBalanceBetterTT(ncon,gnpwgts+oldto*ncon,gnpwgts+to*ncon,nvwgt,ubvec))){
k = j;
oldto = my_edegrees[k].edge;
}

can make move that makes the balance worse via the first condition and arbitrarily weighted edges?

It's probably me but am I understanding correctly?

Many thanks

Dominic Walsh