Skip to content

more performant build of Geant4 by default #92

@tomeichlersmith

Description

@tomeichlersmith

The default value of a few configuration parameters in Geant4 have values that are helpful for initial development of a Geant4 application but are unhelpful when attempting to scale up to larger production systems. I think, especially with the introduction of #83 enabling local custom G4 builds, we could update the configuration of G4 to be focused on performance only and guide people to rebuild locally with different configuration if they need more information from the G4 side for debugging/development purposes.

I use cmake -LAH to list all of the available options and noticed a few that have some non-performant defaults.

Option Default Description
CMAKE_BUILD_TYPE RelWithDebInfo type of build, this reduces the optimization and enables storing of the debug flags
GEANT4_BUILD_VERBOSE_CODE ON include extra comments and checks during the simulation
GEANT4_BUILD_STORE_TRAJECTORY ON build full trajectories during the simulation for visualization purposes

I think the last option could be significantly contributing to simulation time since Geant4 is storing a particles full trajectory during its lifetime which could amount to many hundreds of steps that it needs to allocate and de-allocate on each track.

Context

Discovered while working on LDMX-Software/geant4#13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions