https://bitbucket.org/simoncblyth/opticks |
Opticks API : split according to dependency -- Optical photons are GPU "resident", only hits need to be copied to CPU memory
CSGFoundry Model
Geant4 Geometry Model (JUNO: 400k PV, deep hierarchy)
PV | G4VPhysicalVolume | placed, refs LV |
LV | G4LogicalVolume | unplaced, refs SO |
SO | G4VSolid,G4BooleanSolid | binary tree of SO "nodes" |
Opticks CSGFoundry Geometry Model (index references)
struct | Notes | Geant4 Equivalent |
---|---|---|
CSGFoundry | vectors of the below, easily serialized + uploaded + used on GPU | None |
qat4 | 4x4 transform refs CSGSolid using "spare" 4th column (becomes IAS) | Transforms ref from PV |
CSGSolid | refs sequence of CSGPrim | Grouped Vols + Remainder |
CSGPrim | bbox, refs sequence of CSGNode, root of CSG Tree of nodes | root G4VSolid |
CSGNode | CSG node parameters (JUNO: ~23k CSGNode) | node G4VSolid |
NVIDIA OptiX 7+ Geometry Acceleration Structures (JUNO: 1 IAS + 10 GAS, 2-level hierarchy)
IAS | Instance Acceleration Structures | JUNO: 1 IAS created from vector of ~50k qat4 (JUNO) |
GAS | Geometry Acceleration Structures | JUNO: 10 GAS created from 10 CSGSolid (which refs CSGPrim,CSGNode ) |
JUNO : Geant4 ~400k volumes "factorized" into 1 OptiX IAS referencing ~10 GAS
WaterPoolConstruction + HBeamConstruction : Addition of DeadWater + Tyvek
FIX (MR 458) under test : simplify geometry using hierarchy approach (WaterPoolConstruction__CONFIG envvar)
FastenerAcrylicConstruction
FIX (MR 468) under test : using G4MultiUnion/list-node (FastenerAcrylicConstruction__CONFIG envvar)
Complex CSG => Tree Overheads
Generalizes binary to n-ary CSG trees
+---------------+----------------------+ | 2-ary tree | n-ary "list-node" | +===============+======================+ | U | U[A,B,C] | | / | | | U | | | / \ | | | U A | | | / \ | | | C B | | +---------------+----------------------+
HIERARCHY : Radically Simple
+---Air-----------------------+ | | | +--DeadWater--------------+ | | | +---Tyvek-------------+ | | | | | +----vetoWater----+ | | | | | | | | | | | | | | | +-+ +-+ | | | | | | | | |Steel | | | | | | | | | | +-+ +-+ | | | | | | | +-----------------+ | | | | | +---------------------+ | | | +-------------------------+ | +-----------------------------+
Geant4 "Russian doll" hierarchy
BUT: pillars need to be within vetoWater
"Sibling Soup" : (DeadWater, Tyvek, Air, Steel) in vetoWater
sDeadWater,sTyvekFilm : 6 plane G4Polycone with 31 holes +---------------------+ +----------------+---+ 1 plane | | | | + +-----------------+ +----------------+ + 2 planes | | | | | | | | | | | | | | | | | | | | | | | | | | | | + + + + + | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +--+ +---+ +------+------------------+ + 2 planes | | | | | | +------+ +---+ +------+----------------------+ 1 plane
ISSUES : with current "Sibling soup" geometry
blyth-WaterPoolConstruction__CONFIG-to-fix-pillar-impingement-and-opticks-translation
CONFIG | Notes on WaterPoolConstruction HBeamConstruction |
---|---|
0:ASIS | sibling soup => very complicated CSG |
1:ZERO_HOLES | skip 60 one-by-one hole subtractions from DeadWater Tyvek |
2:MULTIUNION_HOLES | collect holes into G4MultiUnion(listnode), subtract once |
3:HIERARCHY | radical simplification, minor geometry change :
|
https://code.ihep.ac.cn/JUNO/offline/junosw/-/merge_requests/458 MERGED: 2024-06-17
Set CONFIG envvar to change geometry, default is no change "sibling soup":
unset WaterPoolConstruction__CONFIG export WaterPoolConstruction__CONFIG=0 # ASIS : same as unset export WaterPoolConstruction__CONFIG=3 # HIERARCHY
Using G4MultiUnion/listnode for 62 subtracted holes works, BUT...
Impingment at bottom of WaterPool apparent, from angled cross-piece
Also impingement from vertical and tilted pillars
WaterPoolConstruction__CONFIG=HIERARCHY (much simpler)
* skip bottom angled cross piece
* raise pillar base 126mm (keep within vetoWater)
With list-node : shrink CSG tree
+------------------------------+ | U | | / \ | | / \ | | D U[A,B,C,D,E,F,G,H] | | / \ | | I J | +------------------------------+
Problematic deep CSG tree without list-node
+------------------------------------------+ | | | | | U | | / \ | | / \ | | / D | | U / \ | | / \ I J | | U H | | / \ | | U G | | / \ | | U F | | / \ | | U E | | / \ | | U D | | / \ | | U C | | / \ | | A B | | | +------------------------------------------+ U : Union A-J : Tubs (cylinder) primitive
FastenerAcrylicConstruction : hidden within support base
(0):xjfc:XJfixture
(1):xjac:XJanchor
Construction | # |
---|---|
XJfixture | 56 |
XJanchor | 56 |
XJfixture
XJanchor
TODO: compare validation + performance:
Counts in Geometry
Construction | # |
---|---|
SJCLSanchor | 2 |
SJfixture | 36 |
SJReceiver | 8 |
SJReceiverFastern | 8 |
SJCLSanchor
SJfixture
(0):sjcl:SJCLSanchor
(1):sjfx:SJfixture
(2):sjrc:SJReceiver
(3):sjrf:SJReceiverFastern
Virtual surface shifts used to avoid degeneracy, together with defaults (shifts avoid chi2 discrepancies from degenerate surfaces):
export Tub3inchPMTV3Manager__VIRTUAL_DELTA_MM=0.10 ## 1.e-3 export HamamatsuMaskManager__MAGIC_virtual_thickness_MM=0.10 ## 0.05 export NNVTMaskManager__MAGIC_virtual_thickness_MM=0.10 ## 0.05
Completing these three : will match GPU and CPU geometry
https://bitbucket.org/simoncblyth/opticks | code repository (day-to-day) |
https://github.com/simoncblyth/opticks | code repository (~month-to-month), releases |
https://simoncblyth.bitbucket.io https://simoncblyth.github.io https://juno.ihep.ac.cn/~blyth/ | publications, presentations, videos |
https://groups.io/g/opticks | forum/mailing list archive |
email:opticks+subscribe@groups.io | subscribe to mailing list |
JUNOSW+Opticks
DocDB-10968 | 2023/12/19 | Using first JUNOSW+Opticks Pre-Release at IHEP GPU cluster |
DocDB-10929 | 2023/12/11 | JUNOSW + Opticks : Profiling and Status |
WaterPool Overlaps+Opticks FIXED with simpler approach
FastenerAcrylic works with G4MultiUnion/"list-node"
Testing triangulated GuideTube + XJ + SJ solids
Option | Approach to equalize CPU/GPU geometry | Status | ||
---|---|---|---|---|
--no-guide_tube | triangulated with NumberOfRotationSteps precision control | GOOD | ||
--debug-disable-fa | FastenerAcrylic using G4MultiUnion/"list-node" works | GOOD | ||
--debug-disable-xj | XJfixture XJanchor | Trying triangulated (if too much validation deviation use "listnode") | ?? | |
--debug-disable-sj | SJCLSanchor SJFixture SJReceiver SJReceiverFastern |
Immediate Steps : Geometry + Performance + Validation
Optimization : measure performance as:
Production Prep : auto event splitting, depending on VRAM