-
Notifications
You must be signed in to change notification settings - Fork 13
Conversation
This PR will also remove the sizes defined in Constants.h right? Now that these are no longer globals. #380 |
Oh yeah, I wasn't planning on it, but we should do that on this PR too |
That turned out to be much more convoluted than I anticipated. I'll try again once this PR is more complete, but I might also defer it to a future PR. |
I think it should all be working now. I'll test it with the CI while I check if there's things that could be cleaned up a bit. Also, I'll check to see how much it needs to be changed to fix the issue @GNiendorf mentioned. /run standalone |
The PR was built and ran successfully in standalone mode. Here are some of the comparison plots. The full set of validation and comparison plots can be found here. Here is a timing comparison:
|
After thinking about it a bit more, I think that a way to make this cleaner is to have the load functions construct the shared pointers instead of only filling them, which would make #380 much easier to address. Also, I should probably move the |
The PR was built and ran successfully with CMSSW. Here are some plots. OOTB All TracksThe full set of validation and comparison plots can be found here. |
This is PR is close to being ready for review. I did end up fixing #380, but it needed quite a few changes. I made things as const as possible. Also, I found out the out of bounds issue I mentioned above, which we should look into. I'll run the CI to make sure that things look fine. I still have to work on the CMSSW side. /run standalone |
Thanks @GNiendorf for pointing out that /run standalone |
The PR was built and ran successfully in standalone mode. Here are some of the comparison plots. The full set of validation and comparison plots can be found here. Here is a timing comparison:
|
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.
a few classes and methods will now appear as identical visible symbols in all sdl_
library backend builds.
Is there some first principles justification that this is safe?
SDL/EndcapGeometry.h
Outdated
class EndcapGeometry; | ||
|
||
template <> | ||
class EndcapGeometry<DevHost, false> { |
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.
isn't this an ODR violation? EndcapGeometry<DevHost, false>
will appear in all alpaka backend builds.
A separate non-template EndcapGeometryZZZ
(put something clear in ZZZ) would be more appropriate; it will be in non-alpaka part of LSTCore
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 think that's not an ODR violation. That's why I added the second template parameter so that for cpu builds it doesn't end up having a duplicate definition. But I agree that a non-template class would be better.
SDL/Event.h
Outdated
const uint16_t nModules; | ||
const uint16_t nLowerModules; | ||
const unsigned int nPixels; | ||
const std::shared_ptr<const modulesBuffer<Dev>> modulesBuffers; | ||
const std::shared_ptr<const pixelMap> pixelMapping; | ||
const std::shared_ptr<const EndcapGeometry<Dev, true>> endcapGeometry; |
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.
CMSSW naming rules suggest using a trailing underscore for (private) data members (m_
or the
or some distrinct prefix/suffix are also acceptable). This makes the implementation more readable.
This PR could be a good opportunity to denote these are data members now
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.
That's a good point, thanks!
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 trailing underscores to these new private data members since I was already modifying those lines in this PR. There are more that could be added, but maybe it would be better to have a PR that only focuses on style fixes since this PR is already sizable. For example, according to the guidelines we should declare class section in public -> protected -> private order, but we mostly have private -> public.
SDL/LST.h
Outdated
pixelMapping(std::const_pointer_cast<const pixelMap>(pixelMappingIn)) {} | ||
}; | ||
|
||
std::unique_ptr<LSTESHostData> loadAndFillESHost(); |
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.
another ODR violation
SDL/ModuleConnectionMap.h
Outdated
class ModuleConnectionMap; | ||
template <> | ||
class ModuleConnectionMap<SDL::Dev> { | ||
class ModuleConnectionMap { |
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.
the FIXME
was here for a reason
SDL/TiltedGeometry.h
Outdated
class TiltedGeometry; | ||
template <> | ||
class TiltedGeometry<SDL::Dev> { | ||
class TiltedGeometry { |
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.
and another n-plicate definition
For now, should we keep using templated classes even for things that don't use any alpaka buffers or should we figure out how to move them into a non-alpaka part now? As far as I can tell, CMSSW only loads one library at a time, so there probably wouldn't be symbol conflicts, but I'm not sure if in more general scenarios there could be issues. |
I think for now it doesn't matter if we have potential symbol conflicts. When we move to CMSSW (hopefully pretty soon) it will be a lot easier to separate non-alpaka parts by moving them out of the |
/run standalone |
The PR was built and ran successfully in standalone mode. Here are some of the comparison plots. The full set of validation and comparison plots can be found here. Here is a timing comparison:
|
SDL/LSTESData.h
Outdated
std::shared_ptr<EndcapGeometryHost<Dev>> endcapGeometryIn, | ||
std::shared_ptr<TiltedGeometry<Dev>> tiltedGeometryIn, | ||
std::shared_ptr<ModuleConnectionMap<Dev>> moduleConnectionMapIn) | ||
: mapPLStoLayer(std::const_pointer_cast<const MapPLStoLayer>(mapPLStoLayerIn)), |
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.
is the cast actually needed?
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.
https://godbolt.org/z/o8Ms81c97 from non-const to const works
as for the member constness, it's probably an overkill, since ES will share only const LSTESHostData
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.
Ah okay, I'll fix that
/run standalone @ariostas will the previous run cmssw actually complete or does the request/job get killed by the PR update? |
It will complete, but let's run a new one to make sure that the new changes don't break anything. /run cmssw 26 |
The PR was built and ran successfully in standalone mode. Here are some of the comparison plots. The full set of validation and comparison plots can be found here. Here is a timing comparison:
|
There seems to be some issue with CUDA. I'll look into it. |
I moved some functions back into an unnamed namespace. I didn't realize that there was a reason for it. Now it also works with CUDA. I ran a timing comparison on cgpu-1, but the pLS time is too small to notice a difference.
|
The PR was built and ran successfully with CMSSW. Here are some plots. OOTB All TracksThe full set of validation and comparison plots can be found here. |
I also verified that it works with GPU in CMSSW, so it's all ready now. |
This PR removes the remaining global variables. The standalone version works now, but I still need to work on the CMSSW side. I'll mark it as ready for review once everything works and there's a companion PR on the CMSSW repo.