Presentation is loading. Please wait.

Presentation is loading. Please wait.

Common Geometry Primitives library WP3 – date

Similar presentations


Presentation on theme: "Common Geometry Primitives library WP3 – date"— Presentation transcript:

1 Common Geometry Primitives library WP3 – date
M. Gheata, CERN EP/SFT for the USolids/VecGeom team

2 M.Gheata - Common Geometry Primitives library
Outline Motivation Status Directions and work plan Conclusions 16/06/16 M.Gheata - Common Geometry Primitives library

3 Motivation for the development
Originally seen as a consolidation of solids algorithms in Geant4 and ROOT, for better performance and easier maintainability Scope extended due to new requirements added by GeantV Vectorization Portability to other architectures (GPU, MIC, …) The larger scope required developing a new geometry package: VecGeom Development of USolids an VecGeom merged into a single package This path aiming to release a single high performance product used more or less everywhere Activity part of AIDA-2020/WP3 ~1995 ~2002 ~2010 ~2013 Geant4 geometry modeler ROOT/TGeo AIDA USolids VecGeom 16/06/16 M.Gheata - Common Geometry Primitives library

4 VecGeom: targeting vectorization
Vector signatures Internal algorithm vectorization internal loop over lateral planes for distance calculation “parallel” collision detection For vectorized transport (GeantV) Beneficial for current scalar simulations 16/06/16 M.Gheata - Common Geometry Primitives library

5 Available shapes: status
Both in USolids and VecGeom: Box, Orb, Trapezoid (Trap), Simple Trapezoid (Trd), Sphere (+ sphere section), Tube (+ cylindrical section) , Cone (+ conical section), Generic Trapezoid (Arb8), Polycone, Polyhedron Only in USolids: Tetrahedron (Tet), Multi-Union, Tessellated Solid, Extruded Solid, Generic Polycone Only in VecGeom: Paraboloid, Parallelepiped (Para), Hyperboloid, Ellipsoid, Torus (+ torus section), Scaled Solid, Boolean (addition, subtraction, intersection) Missing: Elliptical Cone, Elliptical Tube, Cut Tube (composable) Twisted shapes (box, trap, tube) – complex & infrequent use Working on a comprehensive common set 16/06/16 M.Gheata - Common Geometry Primitives library

6 Correctness: ShapeTester testing suite
Geant4 tests - Unit tests - SBT(solid batch test) - SurfaceChecker - OpticalEscape - SurfaceVisTest - testDistanceAccuracy.cc Extensive Testing Suite USolids tests -SBT -OpticalEscape -SBTperformance (Comparison Usolids, Root, Geant4) Root tests CheckShape: -ShapesDistances() -ShapesSafety() -ShapeNormal() Possibility to run tests interactively through ROOT Shape Tester Geant4+USolids+Root tests New 'X-Ray Scan' Test SBTperformance Unit tests VecGeom Testing Suite 16/06/16 M.Gheata - Common Geometry Primitives library

7 Coverage extension in Shape Tester - ongoing
One shape for each different topology Sections, shells, … Degenerated configurations Pathological cases (long/thin shapes, …) Shapes selection from a DB DB generated from imported LHC experiments geometries Random generation of shapes Per type, dimension and position in space Batch or interactive mode 16/06/16 M.Gheata - Common Geometry Primitives library

8 New features: precision on boundaries
p1 = p0 + Dref*v v ε = max|Dback-Dref|vn -v Dback= DistanceToIn(p1, -v) p0 p1 n Systematic check in Shape Tester for every shape 16/06/16 M.Gheata - Common Geometry Primitives library

9 Performance monitoring after changes
Goal: develop algorithms as accurate but faster than Geant4/ROOT/USolids Plot on polyhedron performance, evolution with commits Needs systematic checks Time[s] Less accurate: using bbox Less accurate: limited to current Z segment 16/06/16 M.Gheata - Common Geometry Primitives library

10 Current status of shapes in Shape Tester
Conventions test Stress tests Box OK Tube Trapezoid Generic Trapezoid (Arb8) Simple Trapezoid (Trd) Orb Sphere Cone (x) Parallelepiped (Para) Polycone (x) Failures Polyhedron (x) Torus (x) All other shapes either missing or showing failures -> to be addressed (x) Being worked out now… 16/06/16 M.Gheata - Common Geometry Primitives library

11 Shapes: immediate open issues to address
Fix errors reported by Shape Tester Including any new added topologies Provide missing auxiliary functions (GetPointOnSurface, Capacity, SurfaceArea) Already implemented in USolids Required by Geant4 Improve Trap and Cone performance DistanceToIn() in UTrap is faster Scalar performance for Cone can be improved for distance functions Improve scalability for Polycone and Polyhedron Poor performance with high number of Z-sections in VecGeom shapes Internal vectorisation on Z sections not yet working – to be developed Review application of conventions for points on the “wrong side” Final validation: robustness and fixes for problems detected only when running on complex setups 16/06/16 M.Gheata - Common Geometry Primitives library

12 Integration with Geant4 and ROOT
Objective: profit from demonstrated VecGeom scalar performance improvements in existing setups Without requiring user code to change Important step for validating the new package as replacement of geometry Usolids/VecGeom integrated with Geant4 as optional alternative Work done to integrate VecGeom solids with ROOT Implementation: bridge classes deriving from the base class for solids (G4VSolid, TGeoShape) Delegating navigation methods to the VecGeom library 16/06/16 M.Gheata - Common Geometry Primitives library

13 Using VecGeom from Geant4 - status
USolids can be used in Geant4 since release 10.0 Passing the whole Geant4 testing suite Some run-time warnings with CMS bench VecGeom solids can be used seamlessly since Geant as external library Now part of nightly builds in Geant4 VecGeom shapes from Git master Tested on CentOS/gcc-5.3 Several tests failing or showing run-time errors/warnings In release 10.3-beta, VecGeom will work in batch and interactive mode Also in multi-threading (MT) Still failing parameterisations in MT mode Missing some auxiliary methods in VecGeom 16/06/16 M.Gheata - Common Geometry Primitives library

14 Building Geant4 to use USolids/VecGeom
Install USolids/VecGeom libraries Configure to either use USolids implementation: cmake -DBACKEND=Scalar -DGEANT4=OFF -DUSOLIDS=ON -DUSOLIDS_VECGEOM=OFF \ [...other optional VecGeom switches as needed...] \ -DCMAKE_INSTALL_PREFIX=${VecGeomINSTALLDIR} ${VecGeomSOURCE} make install or VecGeom implementation: cmake -DBACKEND=Scalar -DGEANT4=OFF -DUSOLIDS=ON -DUSOLIDS_VECGEOM=ON \ Install Geant4 export USolids_DIR=${VecGeomINSTALLDIR}/lib/Cmake/USolids Add -DGEANT4_USE_USOLIDS=ON when configuring Geant4 with CMake 16/06/16 M.Gheata - Common Geometry Primitives library

15 Expected geometry features in Geant4 10.3
Release 10.3 of Geant4 planned for December 2016 Beta preview (10.3-beta) at end of June Ability to exercise a limited set of shapes from VecGeom Box, Tube, Cone, Orb, Sphere, Trap, Trd, Torus, Polycone, Polyhedron Approaching “production quality” in terms of correctness and robustness Extension of Geant4 CMake build system to enable use of shapes individually Ability to scale shapes along Cartesian axes Extended GDML schema (new version 3.1.4) Future plan: Provide specialised navigation interface class to VecGeom navigation 16/06/16 M.Gheata - Common Geometry Primitives library

16 VecGeom solids used in ROOT TGeo
TPluginManager Using ROOT plugin mechanism to avoid direct library dependencies Load library, create the converter TGeoVGConverter TVirtualGeoConverter::instance()::ConvertGeometry() A single call to convert the shapes in any TGeo geometry to VecGeom ones libVGConverter.so libvecgeom.a libGeom.so TVirtualGeoConverter The base interface is defined in the TGeo library ::ConvertGeometry() = 0 derives TGeoVGShape Make VecGeom solid look like a regular ROOT shape TGeoBBox TGeoTube TGeoCone fShape VPlacedVolume Keep the original ROOT shape and the corresponding converted solid Navigation using the VecGeom converted solid General functionality not available in VecGeom Graphics, alignment, … Contains() DistanceToIn() Safety() 16/06/16 M.Gheata - Common Geometry Primitives library

17 Status and availability
Supports any ROOT geometry (shapes not yet available are not converted) Alignment, graphics, navigation, geometry checking, … Used as debugging tool (ray-tracing, root shape tester) Expecting important gains for some methods Still to measure overheads/gains systematically (per shape) and in full transport Committed to ROOT master (commit 0bdd34b) New module created in geom/vecgeom creating libConverterVG.so(dyld) Requirement – compilation of ROOT after VecGeom (and Vc) are installed Assuming $VCROOT and $VECGEOMROOT are the install prefixes for Vc and VecGeom -DCMAKE_PREFIX_PATH=$VCROOT/lib/cmake/Vc;$VECGEOMROOT/lib/CMake/VecGeom -Dvc=ON –Dvecgeom=ON 16/06/16 M.Gheata - Common Geometry Primitives library

18 M.Gheata - Common Geometry Primitives library
Summary Most of the common shapes now implemented in VecGeom Missing still some auxiliary methods to allow for full usage in Geant4 Shapes passing Shape Tester: box, tube, cone, orb, para, sphere, trd, trap, generic trap, polyhedron Performance issues: cone, trap, polycone, polyhedron In process to extend Shape Tester Added new checks like boundary precision checks/tuning Ongoing extension of coverage for shapes topologies VecGeom through Geant4 and ROOT in place (shapes level) Expecting near to “production quality” performance in VecGeom release in time for Geant4 10.3 16/06/16 M.Gheata - Common Geometry Primitives library

19 M.Gheata - Common Geometry Primitives library
Contributors EP/SFT+ AIDA 2020: J.Apostolakis, G.Cosmo, A.Gheata, M. Gheata, F.Carminati, T.Nikitina, W.Pokorski G.Amadio(UNESP), G.Lima(FNAL), R.Sehgal(BARC), E.Tcherniaev(RAS), S.Wenzel(CERN) 16/06/16 M.Gheata - Common Geometry Primitives library


Download ppt "Common Geometry Primitives library WP3 – date"

Similar presentations


Ads by Google