July 13th, 2014

An Old-Fashioned Butt Kicking

My calculations now appear to be running correctly when single-threaded, but do silly things when they are multi-threaded. I haven't yet figured out for sure what the problem is (I need to pull more data), but I strongly suspect that the failure is due to continuing problems with my multi-threaded topological sort of a doubly-linked list which is, at least at the moment, kicking my butt.

The problem -- I think -- is that I need to more aggressively sort cells that have been tentatively calculated to higher positions on the list so that they are guaranteed to be above any cell that depends on them. Right now, they may be calculated but below a cell that depends on them, which produces artifacts when looping. I can get rid of the artifacts via brute force, but the brute force approach is expensive for large lists, so I'd rather try a bit more finesse.

(If it were possible to trivially conclude that cell A is either above or below cell B in the list, that would make life simple, but that's not something that can be done without substantial maintenance of ordering information which is even more expensive. I considered a split-the-difference approach with ordered floating point values, but I would end up with all my cells with wonky values between 0 and 1. :) )

In any case, it is time to go to the swimming pool now... :)