mit-crpg/openmc — pull request #212 by paulromano (2013-09-05 04:28:49+00:00)
Title: Improve how particles are assigned to processes

This pull request is rather simple -- it merely changes how many particles are assigned to each processor. The problem with the prior method was mentioned in #201. If you were running on N processors, the first N-1 processors would have ceiling(M/N) particles where M is the total number of particles. This can result in more than M particles on the first N-1 processors. In the new method here floor(M/N) particles are given to each process, and then the remainder are assigned to as many processors as are needed to reach M particles total.

Under the hood, I've removed the `maxwork`, `bank_first`, and `bank_last` variables and introduced a new array `work_index` that gives the starting particle index for each process.