Skip to content

MCCL Parallel Processing

Carole Hayakawa edited this page May 22, 2021 · 7 revisions

Running Simulations in Parallel

The ability to run a single Monte Carlo simulation across multiple CPUs can be invoked using the "cpucount" command line option. The usage to specify using 8 CPUs is:

mc cpucount=8 infile=myinfile.txt

Usage Notes

  1. If there are only 4 CPUs resident on the computer, four simulations will be started and the remaining four will be started as the first four finish.
  2. If the N, total photons to be launched, specified in the infile is not divisible by 8, the number of resulting photons that are run is floor(N/8)*8. The normalization of the results will be determined by this number instead of N.

Technical Information

  1. To ensure that the random number generator used on the different CPUs generates streams that are uncorrelated, we employ the Dynamic Creator Mersenne Twister (https://github.com/MersenneTwister-Lab/dcmt). This Dynamic Creator Mersenne Twister (dcmt) finds sub-streams within the original Mersenne Twister (MT) that do not overlap and are long enough to encompass all random numbers needed in a simulation.
  2. The dcmt code was written in C and we ported it to C#. The details of the code can be seen by cloning a copy of our source code. Comments were added that describe the code when known.
Clone this wiki locally