Opticks > 1000x Geant4 (*)
GPU massive parallelism eliminates bottleneck.
[zero: effectively, compared to rest of simulation]
More Photons -> More Benefit
http://bitbucket.org/simoncblyth/opticks
(*) core extrapolated from mobile GPU speed
Optical Photon Problem
Optical photons:
Isolated nature -> easily separated propagation
Hybrid Solution Possible : Geant4 + Opticks
OptiX Pixel Calculation
NVIDIA® OptiX™
http://developer.nvidia.com/optix
https://research.nvidia.com/publication/optix-general-purpose-ray-tracing-engine
Volumes -> Boundaries
Material/surface boundary representation (4 indices)
Primitives labelled with unique boundary index
GPU textures also used for:
Geocache -> few seconds startup, instead of few minutes
Geometry analysed to find instances
JUNO: ~90M --> 0.1M triangles
OpenGL/OptiX instancing
Multiple Renderers
Analytic : more realistic, faster, less memory, much more effort
For Dayabay PMT:
Aim : analytic description of geometry on critical optical path, remainder tesselated
GPU Resident Photons
~Stacks collected before photon generation:
Thrust: high level C++ access to CUDA
Geant4/Detector Simulation
Opticks (OptiX/Thrust GPU interoperation)
Geant4/Detector Simulation
Multi-event handling
Sequence index -> interactive OpenGL selection of photons by flag sequence
Statistically consistent photon histories in the two simulations : Multiple orders of rainbow apparent
64-bit uint Opticks Geant4 chi2 (tag:5,-5) 8ccd 819160 819654 0.15 [4 ] TO BT BT SA (cross droplet) 8bd 102087 101615 1.09 [3 ] TO BR SA (external reflect) 8cbcd 61869 61890 0.00 [5 ] TO BT BR BT SA (bow 1) 8cbbcd 9618 9577 0.09 [6 ] TO BT BR BR BT SA (bow 2) 8cbbbcd 2604 2687 1.30 [7 ] TO BT BR BR BR BT SA (bow 3) 8cbbbbcd 1056 1030 0.32 [8 ] TO BT BR BR BR BR BT SA (bow 4) 86ccd 1014 1000 0.10 [5 ] TO BT BT SC SA 8cbbbbbcd 472 516 1.96 [9 ] TO BT BR BR BR BR BR BT SA (bow 5) 86d 498 473 0.64 [3 ] TO SC SA bbbbbbbbcd 304 294 0.17 [10] TO BT BR BR BR BR BR BR BR BR (bow 8+ truncated) 8cbbbbbbcd 272 247 1.20 [10] TO BT BR BR BR BR BR BR BT SA (bow 6) cbbbbbbbcd 183 161 1.41 [10] TO BT BR BR BR BR BR BR BR BT (bow 7 truncated)
Deviation angle(degrees) of 1M parallel monochromatic photons in disc shaped beam incident on water sphere. Numbered bands are visible range expectations of first 11 rainbows. S-Polarized intersection (E field perpendicular to plane of incidence) arranged by directing polarization radially.
Good agreement reached, after several fixes: geometry, total internal reflection, group velocity
Consistent : chi2/ndf ~ 1
Very good Opticks/Geant4 agreement
XYTZ: position, time ABCR: polarization, radius
4/PMT In Box/torch : | X | Y | Z | T | A | B | C | R |
---|---|---|---|---|---|---|---|---|
340271/340273 : [TO] BT SA | 1.15 | 1.00 | 0.00 | 0.00 | 1.06 | 1.03 | 0.00 | 1.21 |
340271/340273 : TO [BT] SA | 1.15 | 1.00 | 1.06 | 0.91 | 1.06 | 1.03 | 0.00 | 1.21 |
340271/340273 : TO BT [SA] | 0.97 | 1.02 | 1.05 | 0.99 | 1.06 | 1.03 | 0.00 | 1.29 |
107598/107251 : [TO] BT SD | 0.91 | 0.73 | 0.56 | 0.56 | 0.98 | 1.09 | 0.56 | 0.94 |
107598/107251 : TO [BT] SD | 0.91 | 0.73 | 0.81 | 0.93 | 0.98 | 1.09 | 0.56 | 0.94 |
107598/107251 : TO BT [SD] | 0.99 | 0.83 | 0.97 | 0.99 | 0.98 | 1.09 | 0.56 | 0.93 |
23217/23260 : [TO] BT BT SA | 0.94 | 0.82 | 0.04 | 0.04 | 0.97 | 0.89 | 0.04 | 0.57 |
23217/23260 : TO [BT] BT SA | 0.94 | 0.82 | 0.70 | 0.50 | 0.97 | 0.89 | 0.04 | 0.57 |
23217/23260 : TO BT [BT] SA | 0.91 | 0.94 | 0.43 | 0.60 | 0.97 | 0.89 | 0.04 | 0.05 |
23217/23260 : TO BT BT [SA] | 0.94 | 0.88 | 0.04 | 0.35 | 0.97 | 0.89 | 0.04 | 0.72 |
18866/19048 : [TO] AB | 0.99 | 1.10 | 0.87 | 0.87 | 0.85 | 0.84 | 0.87 | 1.00 |
18866/19048 : TO [AB] | 0.99 | 1.10 | 0.93 | 0.92 | 0.85 | 0.84 | 0.87 | 1.00 |
3179/3133 : [TO] SC SA | 1.07 | 0.83 | 0.34 | 0.34 | 0.86 | 0.96 | 0.34 | 0.73 |
3179/3133 : TO [SC] SA | 1.07 | 0.83 | 0.98 | 1.05 | 0.98 | 1.06 | 0.98 | 0.73 |
3179/3133 : TO SC [SA] | 0.96 | 1.04 | 0.93 | 0.97 | 0.98 | 1.06 | 0.98 | 1.10 |
2204/2249 : [TO] BT AB | 0.85 | 1.04 | 0.45 | 0.45 | 0.99 | 0.92 | 0.45 | 1.06 |
2204/2249 : TO [BT] AB | 0.85 | 1.04 | 0.95 | 0.88 | 0.99 | 0.92 | 0.45 | 1.06 |
2204/2249 : TO BT [AB] | 0.98 | 0.94 | 1.01 | 1.00 | 0.99 | 0.92 | 0.45 | 0.90 |
1696/1732 : [TO] BT BT AB | 1.05 | 0.85 | 0.38 | 0.38 | 0.86 | 1.09 | 0.38 | 0.26 |
1696/1732 : TO [BT] BT AB | 1.05 | 0.85 | 1.48 | 1.28 | 0.86 | 1.09 | 0.38 | 0.26 |
1696/1732 : TO BT [BT] AB | 0.99 | 0.86 | 1.17 | 1.40 | 0.86 | 1.09 | 0.38 | 0.86 |
1696/1732 : TO BT BT [AB] | 1.15 | 0.88 | 1.08 | 1.06 | 0.86 | 1.09 | 0.38 | 0.79 |
1446/1455 : [TO] BR SA | 1.21 | 0.94 | 0.03 | 0.03 | 0.90 | 0.87 | 0.03 | 1.09 |
1446/1455 : TO [BR] SA | 1.21 | 0.94 | 1.02 | 1.01 | 0.90 | 0.87 | 0.03 | 1.09 |
1446/1455 : TO BR [SA] | 1.00 | 0.93 | 0.97 | 0.99 | 0.90 | 0.87 | 0.03 | 1.04 |
Test | Geant4 10.2 | Opticks Interop | Opticks Compute |
---|---|---|---|
Rainbow 1M(S) | 56 s | 1.62 s | 0.28 s |
Rainbow 1M(P) | 58 s | 1.71 s | 0.25 s |
PmtInBox 0.5M | 41 s | 0.81 s | 0.15 s |
[1] MacBook Pro (2013), NVIDIA GeForce GT 750M, 2048 MB, 384 cores
Open Source Opticks
Documentation, install instructions. Repository.
Geometry/event data use NumPy serialization:
import numpy as np a = np.load("photons.npy")
(*) Windows VS2015, non-CUDA only so far
Overview
Opticks enables Geant4 based simulations to benefit from optical photon simulation taking effectively zero time and zero CPU memory, thanks to massive parallelism made accessible by NVIDIA OptiX.
- The more photons the bigger the overall speedup (99% -> 100x)
- Drastic speedup -> better detector understanding -> greater precision
- Large PMT based neutrino experiments, such as JUNO, can benefit the most