MC321.ipynb: Tutorial of Monte Carlo simulation in Python modified from mc321.c
- photonGenerator.chpl: a module to generate a photon
- With
forloop - Random generator: NPBRandom()
- With
forloop - Random generator: Random()
fortofor allwith (+ reduce Csph, + reduce Ccyl, + reduce Cpla )The reduction prevents race conditions or inconsistent updates, which can occur when multiple tasks try to update the same variables simultaneously in parallel code.
- MC321T.c:
gcc -O3 --ansi MC321T.c -o MC321T -lm - **.chpl:
chpl **.chpl --fast
| NP = 1million | C | Chapel | Chapel Parallel @CPU | Chapel Parallel @GPU | Python |
|---|---|---|---|---|---|
|
|
3.65 s | 3.81 s | 0.5 s/5.2s* | 3s* | 290 s |
|
|
7.08 s | 7.33 s | 0.9 s/8.0s* | 5.7s* | |
|
|
13.92 s | 14.45 s | 1.7s/16s* | 10s* | |
|
|
25.54 s | 28.56 s | 3.46s/34s* | 19s* | |
|
|
53.18 s | 57.17 s | 6.76s/70s* | 37s* |
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 24
On-line CPU(s) list: 0-23
Vendor ID: AuthenticAMD
Model name: AMD Ryzen Threadripper 1920X 12-Core Processor
CPU family: 23
Model: 1
Thread(s) per core: 2
Core(s) per socket: 12
- Run python MC simulation with Gaussian focused light source
- Including the refraction from the top surface
- Save all the coordinates at each scattered position
- Call functions throguh mcOCTFunctions
- Plot photon traces
- git config --global user.name "osimlab"
- git config --global user.name "osimlab"