Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[geom] Add cache layer for TGeoParallelWorld safeties in TGeoNavigator #16470

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sawenzel
Copy link
Contributor

This commit provides an (optional) optimization to reduce the cost of safety evaluations associated with TGeoParallelWorld.

The approach consists in the introduction of additional cache-state in TGeoNavigator. This state remembers the last location for which TGeoParallelWorld::Safety was evaluated, together with the corresponding value returned.

Since TGeoNavigator follows the evolution of tracks step-by-step, we have some sort of history-locality. This means that the cache-state has a high-probability of being relevant for multiple track locations in a row.

The optimization proposed here is orthogonal to other improvements. It adds on top of algorithmic improvements within TGeoParallelWorld (bounding volume hierarchies, see separate PR), gaining a few extra percent in speed.

By default, the new feature is not enabled by default for backward compatibility. Once fully verified, we can make it the default mode.

That said, in ALICE simulations, the caching did not modify stepping behaviour and yielded identical results compared to not doing the caching.

Checklist:

  • tested changes locally

This commit provides an (optional) optimization to reduce
the cost of safety evaluations associated with TGeoParallelWorld.

The approach consists in the introduction of additional cache-state
in TGeoNavigator. This state remembers the last location for which
TGeoParallelWorld::Safety was evaluated, together with the corresponding
value returned.

Since TGeoNavigator follows the evolution of tracks step-by-step,
we have some sort of history-locality. This means that the cache-state
has a high-probability of being relevant for multiple track locations in
a row.

The optimization proposed here is orthogonal to other improvements.
It adds on top of algorithmic improvements within TGeoParallelWorld
(bounding volume hierarchies, see separate PR), gaining a few extra percent
in speed.

By default, the new feature is not enabled by default for backward compatibility.
Once fully verified, we can make it the default mode.

That said, in ALICE simulations, the caching did not modify stepping
behaviour and yielded identical results compared to not doing the caching.
Copy link
Member

@agheata agheata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment, otherwise it looks good to me.

geom/geom/inc/TGeoNavigator.h Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Sep 19, 2024

Test Results

    12 files      12 suites   2d 23h 25m 55s ⏱️
 2 694 tests  2 694 ✅ 0 💤 0 ❌
30 334 runs  30 334 ✅ 0 💤 0 ❌

Results for commit c19ac8e.

♻️ This comment has been updated with latest results.

take away factor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants