[parsec-users] fluidanimate bug

Cedomir Segulja seguljac at eecg.toronto.edu
Wed Oct 16 13:37:33 EDT 2013


Hi all,

While analyzing the performance of fluidanimate benchmark, I think I
discovered a bug.

In functions ComputeDensitiesMT and ComputeForcesMT,  the address of a
particle is used to avoid calculating densities and forces twice per
each pair of neighbouring particles - something like:

if (&particle1 < &particle2) {
...
}

For this to work,  the above-mentioned functions indeed need to
iterate over each pair of neighbouring particles twice. However, this
is not the case, which can be easily verified by reversing the
direction of comparison, i.e., changing '<' to '>' and counting the
number of updates in each case gives different results - and
performance.

Digging deeper, I think the culprit of this bug is in the function
InitNeighCellList, which when generating the list of neighbouring
cells already 'filters' the cells ("index < my_index"). Removing this
filter (i.e. changing "index < my_index" to "index != my_index"), then
gives the same number of updates, no matter what the direction of the
address comparison discussed above is.

Can the author of this code verify that this is indeed a bug and that
the proposed solution fixes it?

Thanks,
-- Cedomir


More information about the parsec-users mailing list