mit-crpg/OpenMOC — pull request #82 by theshuo (2014-07-01 16:57:56+00:00)
Title: Modified CPUSolver to have locally allocated accumulator in transportSweep()

Made a small change to CPUSolver so that scalarFluxTally() is passed in thread-allocated arrays instead of references to global array. This reduces what appears to be false sharing, and was causing a large performance degradation from that of ThreadPrivateSolver.

Now, CPUSolver seems to be at the same performance level as ThreadPrivateSolver and in addition does not use extra memory making thread-local copies of the FSR array.

There are other ways to prevent this false sharing, (adding padding to the global array, modifying scalarFluxTally() to use a scalar accumulator, etc.), but the performance differences seemed minor between any of these solutions. Perhaps one would be better than another depending on specific architectures, but for now this should do the trick.