-
Notifications
You must be signed in to change notification settings - Fork 1
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
create pT2 object in Segment Linking #138
base: CMSSW_14_1_0_pre3_LST_X_LSTCore_realfiles_batch1_devel
Are you sure you want to change the base?
create pT2 object in Segment Linking #138
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is up to RecoTracker/LSTCore/standalone/code/core/AccessHelper.
I'm not sure I'll get to the rest later today
@@ -12,6 +12,7 @@ void lst::Event<Acc3D>::init(bool verbose) { | |||
trackCandidatesInGPU = nullptr; | |||
pixelTripletsInGPU = nullptr; | |||
pixelQuintupletsInGPU = nullptr; | |||
PT2sInGPU = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variables and functions should start with lower case, upper case is for type names
unsigned int nInnerSegments; | ||
auto nInnerSegments_src_view = alpaka::createView(devHost, &nInnerSegments, (size_t)1u); | ||
|
||
auto dev_view_nSegments = alpaka::createSubView(segmentsBuffers->nSegments_buf, (Idx)1u, (Idx)nLowerModules_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is reading nPLs, right?
It would be better to name accordingly
In some other code pixelModuleIndex
is used (which I'm guessing is the same value as nLowerModules_
(this applies to pT3/5 code from where this is copied)
|
||
auto dev_view_nSegments = alpaka::createSubView(segmentsBuffers->nSegments_buf, (Idx)1u, (Idx)nLowerModules_); | ||
|
||
alpaka::memcpy(queue, nInnerSegments_src_view, dev_view_nSegments); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memcpy method is (queue, destination, source)
please rename nInnerSegments_src_view
to nInnerSegments_host_view
to be less confusing
(this applies to pT3/5 code from where this is copied)
PT2sInGPU->setData(*PT2sBuffers); | ||
} | ||
|
||
unsigned int nInnerSegments; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not call this nPLS or nPixelSegments to match the naming more consistently (this applies to pT3/5 code from where this is copied)
for (unsigned int i = 0; i < nInnerSegments; i++) { // loop over # pLS | ||
int8_t pixelType = pixelTypes[i]; // Get pixel type for this pLS | ||
int superbin = superbins[i]; // Get superbin for this pixel | ||
if ((superbin < 0) or (superbin >= (int)size_superbins) or (pixelType > 2) or (pixelType < 0)) { | ||
connectedPixelSize_host[i] = 0; | ||
connectedPixelIndex_host[i] = 0; | ||
continue; | ||
} | ||
|
||
// Used pixel type to select correct size-index arrays | ||
if (pixelType == 0) { | ||
connectedPixelSize_host[i] = | ||
pixelMapping_->connectedPixelsSizes[superbin]; // number of connected modules to this pixel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like the same operations on the host side are done for the third time now.
It would be better to carry the connectedPixel*
device buffers from the ones filled in the pT5 creation
if (segmentsInGPU.partOfPT5[outerSegmentIndex]) | ||
continue; //don't create pT2s for T2s accounted in pT5s | ||
|
||
if (segmentsInGPU.partOfPT3[outerSegmentIndex]) | ||
continue; //don't create pT2s for T2s accounted in pT3s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably the origin of the crashes: partOf*
variables are in the pLS sub-SoA, not the OT LS.
This should be removed. If segments (OT LS) used somewhere else should be checked for use, new variables should be added to the OT part of the Segments SoA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added in the pT3 kernels and pT5 kernels, and check if the segment is used in their buildings. I think these lines are filling the partOfPT3 variable.
segmentsInGPU.partOfPT3[i_pLS] = true; |
@@ -41,6 +41,7 @@ namespace lst { | |||
|
|||
constexpr unsigned int n_max_pixel_md_per_modules = 2 * n_max_pixel_segments_per_module; | |||
|
|||
constexpr unsigned int n_max_pixel_segments = 15000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be pt2 already
constexpr unsigned int n_max_pixel_segments = 15000; | |
constexpr unsigned int n_max_pt2s = 15000; |
// =============== | ||
|
||
//____________________________________________________________________________________________ | ||
unsigned int getPixelLSFrompT2(lst::Event<Acc3D>* event, unsigned int PT2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsigned int getPixelLSFrompT2(lst::Event<Acc3D>* event, unsigned int PT2) { | |
unsigned int getPixelLSFromPT2(lst::Event<Acc3D>* event, unsigned int pT2) { |
} | ||
|
||
//____________________________________________________________________________________________ | ||
unsigned int getLSsFrompT2(lst::Event<Acc3D>* event, unsigned int PT2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unsigned int getLSsFrompT2(lst::Event<Acc3D>* event, unsigned int PT2) { | |
unsigned int getLSFromPT2(lst::Event<Acc3D>* event, unsigned int PT2) { |
one LS
I somewhat quickly checked the rest and didn't find problems; but I'm not particularly familiar with the eff/performance plotting to comment on those parts |
Index off Co-authored-by: Andres Rios Tascon <[email protected]>
fix the segment logical layers Co-authored-by: Slava Krutelyov <[email protected]>
@@ -872,6 +872,7 @@ namespace lst { | |||
tripletsInGPU.partOfPT5[quintupletsInGPU.tripletIndices[2 * quintupletIndex + 1]] = true; | |||
segmentsInGPU.partOfPT5[i_pLS] = true; | |||
quintupletsInGPU.partOfPT5[quintupletIndex] = true; | |||
segmentsInGPU.partOfPT5[i_pLS] = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this added by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a duplication. Thanks!
@YonsiG the rebased branch is |
Hi Andres, thank you so much for rebasing this work! I will check the rebase branch. Thank you! |
This is a draft PR of creating pT2 in Segment Linking