Repository navigation
Conversation
|
@esseivaju, @sethrj This MR restores OnloadProcess and OnloadSteps with a dedicated OnloadData from the previous MR, which follows a similar pipeline to that of HitProcessor and DetectorSteps. There are no tests yet beyond the CI compilation checks, as a few additional minor MRs will follow. I would like to get this code merged as an intermediate step before proceeding with further code additions and modifications. Thank you for your review! |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #2715 +/- ##
===========================================
- Coverage 85.88% 85.82% -0.06%
===========================================
Files 1420 1424 +4
Lines 45535 45631 +96
Branches 11664 11690 +26
===========================================
+ Hits 39106 39164 +58
- Misses 4650 4748 +98
+ Partials 1779 1719 -60
🚀 New features to boost your workflow:
|
Test summary 8 203 files 13 495 suites 16m 9s ⏱️ Results for commit f729391. |
sethrj
left a comment
There was a problem hiding this comment.
Hi @whokion , at the risk of asking for a larger PR: since this code has zero percent coverage and we don't yet know what your subsequent work will be, it's hard to judge whether the functionality is correct or necessary. Can you ask claude to add tests, or at least draft the use case?
|
@sethrj No problem with asking claude to add tests or add more code if testing this MR in isolation would not be meaningful, given that OnloadAction, OnloadManager, and the related problem setups are not yet in place. My intention was to keep this MR relatively straightforward, following the existing parrtern with HitProcessor and DetectorSteps, and to break a larger PR into smaller pieces for review. I will be off tomorrow, but I will catch up afterward if the tests cannot be implemented independently with the code proposed in this MR. Thanks! |
| CELER_EXPECT(i < out.size()); | ||
|
|
||
| // TODO: reconstruct tracks and IDs if particles were provided | ||
|
|
||
| // TODO: invoke poststep processes | ||
| std::cout << "Call PostStep" << std::endl; |
There was a problem hiding this comment.
We should use the CELER_NOT_IMPLEMENTED and CELER_LOG_LOCAL macros here
| // Track and detector IDs are always set | ||
| PinnedVec<TrackId> track_id; | ||
|
|
||
| PinnedVec<Energy> energy; | ||
| PinnedVec<real_type> time; | ||
| PinnedVec<Real3> pos; | ||
| PinnedVec<Real3> dir; |
There was a problem hiding this comment.
In OnloadScratchCopyExecutor::operator() we're compacting weight and particle_id but there is no field for it on the host buffers
| DS_ASSIGN(track_id); | ||
| DS_ASSIGN(energy); | ||
| DS_ASSIGN(time); | ||
| DS_ASSIGN(pos); | ||
| DS_ASSIGN(dir); |
There was a problem hiding this comment.
Same here, we're not assigning weight and particle_id
| //! Navigator for finding points | ||
| std::unique_ptr<TouchableUpdaterInterface> update_touchable_; |
There was a problem hiding this comment.
Isupdate_touchable_ planed to be used later? At the moment it is not used at all and could be dropped
| * \c copy_pending_steps processes any previously copied steps first, and does | ||
| * nothing if no compacted steps are pending. | ||
| */ | ||
| class OnloadProcessor |
There was a problem hiding this comment.
I think now that we extracted the DtoH pipeline to StepTransfer, the different processors (OnloadProcessor, HitProcessor) could share a common base StepProcessor which holds and drive the StepTransfer.
Maybe that's fine as a follow-up
| explicit CELER_FUNCTION operator bool() const | ||
| { | ||
| return (gamma_nuclear || electro_nuclear); | ||
| } |
There was a problem hiding this comment.
having both set to false seems to be a valid state which would fail a CELER_EXPECT. Are we avoiding the resize call in such cases?
| //! Scratch space for gathering the data on device based on track validity | ||
| StepDataImpl scratch; | ||
|
|
||
| //! Thread IDs of active tracks that are in a detector |
There was a problem hiding this comment.
| //! Thread IDs of active tracks that are in a detector | |
| //! Thread IDs of active tracks that are undergoing nuclear interaction |
| template<MemSpace M> | ||
| struct OnloadState | ||
| { | ||
| //! Host pointer to externally owned onload data reference | ||
| OnloadStateData<Ownership::reference, M> const& steps; | ||
|
|
||
| //! Stream ID (local to each core state) | ||
| StreamId stream_id; | ||
| }; |
There was a problem hiding this comment.
Is this class really needed? OnloadStateData already holds a stream, it would then just be a type alias without the stream_id member.
| struct OnloadScratchCopyExecutor | ||
| { | ||
| NativeRef<OnloadStateData> state; | ||
| ObserverPtr<size_type const> num_valid; | ||
|
|
||
| // Gather results from selected tracks | ||
| inline CELER_FUNCTION void operator()(ThreadId id); | ||
| }; |
There was a problem hiding this comment.
As I mentioned in the previous PR, there is a lot of duplication between OnloadScratchCopyExecutor, StepScratchCopyExecutor, and their respective OnloadSteps, DetectorSteps compact and copy operations. I hope we can have this be generic over a step state. Maybe that's fine as is for now, and I can follow-up with a refactor to try to unify these
| // Get and reset the steps counted (generally once per event) | ||
| inline size_type exchange_hits(); |
There was a problem hiding this comment.
I think the name num_hits_ and exchange_hits is a bit confusing here since we're not counting hits. Maybe should be renamed exchange_steps and implemented in the base class.
This MR restores deleted OnloadProcess and OnloadSteps from #2672