nrc-cnrc / EGSnrc

Toolkit for Monte Carlo simulation of ionizing radiation — Trousse d'outils logiciels pour la simulation Monte Carlo du rayonnement ionisant
http://nrc-cnrc.github.io/EGSnrc
GNU Affero General Public License v3.0
242 stars 146 forks source link

Fix parallel phsp source partition #1126

Closed blakewalters closed 2 months ago

blakewalters commented 6 months ago

This fix divides phase space sources used in parallel runs into npar*nchunk equal segments, where npar is the no. of parallel runs and nchunk is the no. of chunks (defaults to 10). Each chunk of the parallel run is then assigned its own segment of the phase space source outside of which it will not sample. This scheme, identical to that used in the Mortran codes, should ensure relatively even sampling of the phase space source over the entire parallel run. Note that any remaining histories after completion of npar*nchunk chunks are assigned to the last segment.

Fixes issue #1117 and #1156

ftessier commented 3 months ago

Squashed some commits, fixed commit messages. No content diff with tip of original pull request branch.