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

Define a "unique event ID" different from event counter #1447

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

sethrj
Copy link
Member

@sethrj sethrj commented Oct 14, 2024

ATLAS integration is currently failing because the framework is now setting the Geant4 event ID based on the global event context, whose event number is a globally unique identifier. In contrast, Celeritas expected the event number to be a counter (and a thread-local one at that). Since there are far more than 4 billion total events simulated across all runs and all simulations, and each event should have a unique random sequence, we need to define a special long integer for seeding.

Since the unique event ID (aka the event ID from geant4) doesn't necessarily correlate to the event counter, I'm forcing the EventId that we use for the primary (used for track counting) to zero. This may hurt "debuggability" but means that we can eliminate the "max events" from Geant4 integration. A follow-on PR will add support a special mode for resetting the track counter at the beginning of each event (and having a single "global" event ID) rather than using a unique event-ID-based slot.

A follow-on pull request should map our internal "event ID" (which is consecutive from zero and local to a thread) to the external "event ID" (which is some arbitrary integer used to reference an event, whether from ATLAS or a HepMC3 file etc) for user output.

See #1144 , #1233

Experiment frameworks expect to have more than 4 billion globally unique
event identifiers, and these aren't run sequentially in a single
simulation. Define a "unique event ID" as UID-like integer only for
reseeding and not for tracking.
@sethrj sethrj added bug Something isn't working external Dependencies and framework-oriented features labels Oct 14, 2024
@pcanal
Copy link
Contributor

pcanal commented Oct 14, 2024

A follow-on pull request should map our internal "event ID"

We may want to rename our internal "event ID" to avoid confusion with the external ones.

Copy link

Test summary

 3 279 files   5 076 suites   3m 30s ⏱️
 1 528 tests  1 501 ✅ 27 💤 0 ❌
16 929 runs  16 866 ✅ 63 💤 0 ❌

Results for commit 4342e42.

@sethrj sethrj merged commit 51f7e37 into celeritas-project:develop Oct 14, 2024
34 checks passed
@sethrj sethrj deleted the single-event branch October 14, 2024 15:14
@@ -199,7 +198,7 @@ void LocalTransporter::Push(G4Track const& g4track)
* back to Geant4.
*/
track.track_id = TrackId{track_counter_++};
track.event_id = event_id_;
track.event_id = EventId{0};
Copy link
Contributor

Choose a reason for hiding this comment

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

So this is just temporary, and the plan is to set the Celeritas event ID from a global counter and to reset the (single, local) sim data track counter at the start of a new event? And I guess until we do that our track IDs won't be meaningful...

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, the next PR will include a function to reset these at every event. Track IDs aren't currently very meaningful anyway since they're nondeterministic.

sethrj added a commit to sethrj/celeritas that referenced this pull request Oct 15, 2024
…oject#1447)

* Use a longer integer for event reseeding

Experiment frameworks expect to have more than 4 billion globally unique
event identifiers, and these aren't run sequentially in a single
simulation. Define a "unique event ID" as UID-like integer only for
reseeding and not for tracking.

* Force event ID to be zero
sethrj added a commit to sethrj/celeritas that referenced this pull request Oct 15, 2024
…oject#1447)

* Use a longer integer for event reseeding

Experiment frameworks expect to have more than 4 billion globally unique
event identifiers, and these aren't run sequentially in a single
simulation. Define a "unique event ID" as UID-like integer only for
reseeding and not for tracking.

* Force event ID to be zero
sethrj added a commit to sethrj/celeritas that referenced this pull request Oct 15, 2024
…oject#1447)

* Use a longer integer for event reseeding

Experiment frameworks expect to have more than 4 billion globally unique
event identifiers, and these aren't run sequentially in a single
simulation. Define a "unique event ID" as UID-like integer only for
reseeding and not for tracking.

* Force event ID to be zero
sethrj added a commit to sethrj/celeritas that referenced this pull request Oct 15, 2024
…oject#1447)

* Use a longer integer for event reseeding

Experiment frameworks expect to have more than 4 billion globally unique
event identifiers, and these aren't run sequentially in a single
simulation. Define a "unique event ID" as UID-like integer only for
reseeding and not for tracking.

* Force event ID to be zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external Dependencies and framework-oriented features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants