This is a CPU-consuming assignment since the number of photons hitting the sensor is just a small fraction of the total number of photons emitted. Images can take hours to generate. To utilize all the CPU power, the program is written to support threads. Besides, instead of output only the image, the program also output the accumulative sum of the buffer so far. This way, I don't have to run the simulation all at once. Just run them whenever I have CPU time. All experiments are done on a dual dual-core Opteron, i.e. 4 cores.


