Skip to content

Conversation

@Rashika-Gupta
Copy link
Member

@Rashika-Gupta Rashika-Gupta commented Dec 1, 2025

This PR introduces optical track offloading from Geant4 to Celeritas #2103

  • LocalOpticalOffload is renamed to LocalOpticalGenOffload to distinguish generator-based optical offloading from track-based offloading.
  • TrackOffloadInterface generalizes the tracking manager to support both EM and optical track offload implementations.
  • LocalOpticalTrackOffload classes provide a dedicated pathway for buffering and transporting (in the follow up PR) optical photon tracks.

@Rashika-Gupta Rashika-Gupta added enhancement New feature or request physics Particles, processes, and stepping algorithms external Dependencies and framework-oriented features labels Dec 1, 2025
@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 11.38211% with 109 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.45%. Comparing base (62c3034) to head (e6272d0).

Files with missing lines Patch % Lines
src/accel/LocalOpticalTrackOffload.cc 0.00% 75 Missing ⚠️
src/accel/detail/IntegrationSingleton.cc 39.13% 12 Missing and 2 partials ⚠️
src/celeritas/setup/Problem.cc 8.33% 11 Missing ⚠️
src/accel/LocalOpticalTrackOffload.hh 0.00% 8 Missing ⚠️
src/accel/TrackOffloadInterface.hh 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2135      +/-   ##
===========================================
- Coverage    83.68%   83.45%   -0.24%     
===========================================
  Files         1257     1260       +3     
  Lines        42470    42588     +118     
  Branches     13287    13330      +43     
===========================================
- Hits         35542    35541       -1     
- Misses        4597     4704     +107     
- Partials      2331     2343      +12     
Files with missing lines Coverage Δ
src/accel/LocalTransporter.hh 95.00% <ø> (ø)
src/accel/SetupOptions.hh 90.62% <100.00%> (+0.30%) ⬆️
src/accel/SharedParams.cc 81.75% <ø> (ø)
src/accel/TrackingManager.cc 100.00% <ø> (ø)
src/accel/TrackingManager.hh 100.00% <100.00%> (ø)
src/accel/TrackingManagerConstructor.cc 97.77% <100.00%> (+0.05%) ⬆️
src/accel/detail/IntegrationSingleton.hh 80.00% <ø> (ø)
src/celeritas/inp/Events.hh 61.53% <ø> (ø)
src/accel/TrackOffloadInterface.hh 0.00% <0.00%> (ø)
src/accel/LocalOpticalTrackOffload.hh 0.00% <0.00%> (ø)
... and 3 more

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Test summary

 2 517 files   4 084 suites   1m 29s ⏱️
 1 345 tests  1 331 ✅ 14 💤 0 ❌
13 385 runs  13 349 ✅ 36 💤 0 ❌

Results for commit 91c9469.

♻️ This comment has been updated with latest results.

@Rashika-Gupta Rashika-Gupta marked this pull request as ready for review December 19, 2025 20:14
Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

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

Nice! Just a couple of comments. Swing by my office if you have any questions.

"cacheVariables": {
"CELERITAS_VecGeom_SURFACE": {"type": "BOOL", "value": "OFF"}
}
},
Copy link
Member

Choose a reason for hiding this comment

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

I think this may have been unintentional?

}
auto* lt = dynamic_cast<LocalOpticalTrackOffload*>(offload.get());
CELER_VALIDATE(lt,
<< "Cannot access LocalOpticalTrtackOffload when "
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<< "Cannot access LocalOpticalTrtackOffload when "
<< "Cannot access LocalOpticalTrackOffload when "

Comment on lines +149 to +150
"optical "
"track offload at the same time");
Copy link
Member

Choose a reason for hiding this comment

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

Reformatting after breaking a string can introduce some weirdness like this (I wish clang-format could auto-join strings too). To avoid this you can do like on line 190 and use R"(...)" which is unbreakable


//---------------------------------------------------------------------------//
/*!
* Generate optical photons track.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Generate optical photons track.
* Generate with individual optical photon tracks copied from CPU.

Comment on lines +722 to +735
// Build optical track transporter
optical::Transporter::Input inp;
inp.params = optical_params;
if (action_times)
{
inp.action_times = ActionTimes::make_and_insert(
optical_params->action_reg(),
core_params->aux_reg(),
"optical-action-times");
}

result.optical_transporter
= std::make_shared<optical::Transporter>(
std::move(inp));
Copy link
Member

Choose a reason for hiding this comment

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

Consolidate this duplicate code with the above into a free function build_optical_transporter and use it for both cases:

Suggested change
// Build optical track transporter
optical::Transporter::Input inp;
inp.params = optical_params;
if (action_times)
{
inp.action_times = ActionTimes::make_and_insert(
optical_params->action_reg(),
core_params->aux_reg(),
"optical-action-times");
}
result.optical_transporter
= std::make_shared<optical::Transporter>(
std::move(inp));
result.optical_transporter
= build_optical_transporter(core_params, optical_params, action_times);

Comment on lines +48 to +51
std::shared_ptr<optical::Transporter> optical_transporter; // optical
// primary w/
// haydens
// class
Copy link
Member

Choose a reason for hiding this comment

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

Delete comment

{
return std::make_unique<LSOOTrackingAction>();
}
};
Copy link
Member

Choose a reason for hiding this comment

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

Can you also override EndOfRunAction (see LarSphereOptical::EndOfRunAction in TrackingManagerIntegration) to check that optical tracks were run?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request external Dependencies and framework-oriented features physics Particles, processes, and stepping algorithms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants