From 1fe163512277e6733d42b4278e1576799ef994fc Mon Sep 17 00:00:00 2001 From: Andres Rios Tascon Date: Tue, 30 Apr 2024 07:31:55 -0700 Subject: [PATCH 1/5] Make code compatible with LSTCore structure --- Makefile | 2 +- SDL/EndcapGeometry.h | 4 ++++ SDL/Event.h | 14 +++++++++----- SDL/Globals.h | 6 ++++++ SDL/Hit.h | 5 +++++ SDL/Kernels.h | 8 +++++++- SDL/LST.cc | 17 ++++++++++++++++- SDL/LST.h | 4 ++++ SDL/Makefile | 6 +++--- SDL/MiniDoublet.h | 8 +++++++- SDL/Module.h | 5 +++++ SDL/ModuleConnectionMap.h | 4 ++++ SDL/ModuleMethods.h | 6 ++++++ SDL/NeuralNetwork.h | 8 +++++++- SDL/PixelMap.h | 4 ++++ SDL/PixelTriplet.h | 16 ++++++++++++++-- SDL/Quintuplet.h | 8 +++++++- SDL/Segment.h | 8 +++++++- SDL/TiltedGeometry.h | 4 ++++ SDL/TrackCandidate.h | 8 +++++++- SDL/Triplet.h | 8 +++++++- 21 files changed, 134 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 8a64dd8f..9af23202 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ ROCMINCLUDE = -I${ROCM_ROOT}/include ALPAKA_CPU = -DALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED ALPAKA_CUDA = -DALPAKA_ACC_GPU_CUDA_ENABLED -DALPAKA_HOST_ONLY ALPAKA_ROCM = -DALPAKA_ACC_GPU_HIP_ENABLED -DALPAKA_HOST_ONLY -DALPAKA_DISABLE_VENDOR_RNG -D__HIP_PLATFORM_HCC__ -D__HIP_PLATFORM_AMD__ -EXTRAFLAGS = -ITMultiDrawTreePlayer -Wunused-variable -lTMVA -lEG -lGenVector -lXMLIO -lMLP -lTreePlayer -fopenmp +EXTRAFLAGS = -ITMultiDrawTreePlayer -Wunused-variable -lTMVA -lEG -lGenVector -lXMLIO -lMLP -lTreePlayer -fopenmp -DLST_STANDALONE DOQUINTUPLET = PTCUTFLAG = CUTVALUEFLAG = diff --git a/SDL/EndcapGeometry.h b/SDL/EndcapGeometry.h index df9d7ef7..8b3b31c3 100644 --- a/SDL/EndcapGeometry.h +++ b/SDL/EndcapGeometry.h @@ -9,7 +9,11 @@ #include #include +#ifdef LST_STANDALONE #include "Constants.h" +#else +#include +#endif #include "HeterogeneousCore/AlpakaInterface/interface/host.h" diff --git a/SDL/Event.h b/SDL/Event.h index 408ffc2e..8eabe29b 100644 --- a/SDL/Event.h +++ b/SDL/Event.h @@ -1,8 +1,15 @@ #ifndef Event_cuh #define Event_cuh -#include "Hit.h" +#ifdef LST_STANDALONE +#include "Constants.h" #include "Module.h" +#else +#include +#include +#endif + +#include "Hit.h" #include "ModuleMethods.h" #include "Segment.h" #include "Triplet.h" @@ -11,7 +18,6 @@ #include "MiniDoublet.h" #include "PixelTriplet.h" #include "TrackCandidate.h" -#include "Constants.h" #include "HeterogeneousCore/AlpakaInterface/interface/host.h" @@ -179,9 +185,7 @@ namespace SDL { modulesBuffer* getModules(bool isFull = false); //read from file and init - static void initModules(QueueAcc& queue, - const MapPLStoLayer& pLStoLayer, - const char* moduleMetaDataFilePath); + static void initModules(QueueAcc& queue, const MapPLStoLayer& pLStoLayer, const char* moduleMetaDataFilePath); }; } // namespace SDL diff --git a/SDL/Globals.h b/SDL/Globals.h index 4aa5f95c..355a3fb6 100644 --- a/SDL/Globals.h +++ b/SDL/Globals.h @@ -1,8 +1,14 @@ #ifndef Globals_h #define Globals_h +#ifdef LST_STANDALONE #include "Constants.h" #include "Module.h" +#else +#include +#include +#endif + #include "TiltedGeometry.h" #include "EndcapGeometry.h" #include "ModuleConnectionMap.h" diff --git a/SDL/Hit.h b/SDL/Hit.h index 49cfb7cd..d17f965c 100644 --- a/SDL/Hit.h +++ b/SDL/Hit.h @@ -1,8 +1,13 @@ #ifndef Hit_cuh #define Hit_cuh +#ifdef LST_STANDALONE #include "Constants.h" #include "Module.h" +#else +#include +#include +#endif namespace SDL { struct hits { diff --git a/SDL/Kernels.h b/SDL/Kernels.h index 909ee561..747b06fe 100644 --- a/SDL/Kernels.h +++ b/SDL/Kernels.h @@ -1,14 +1,20 @@ #ifndef Kernels_cuh #define Kernels_cuh +#ifdef LST_STANDALONE +#include "Constants.h" #include "Module.h" +#else +#include +#include +#endif + #include "Hit.h" #include "MiniDoublet.h" #include "Segment.h" #include "Triplet.h" #include "Quintuplet.h" #include "PixelTriplet.h" -#include "Constants.h" namespace SDL { ALPAKA_FN_ACC ALPAKA_FN_INLINE void rmQuintupletFromMemory(struct SDL::quintuplets& quintupletsInGPU, diff --git a/SDL/LST.cc b/SDL/LST.cc index 8b6da5ef..cf29f086 100644 --- a/SDL/LST.cc +++ b/SDL/LST.cc @@ -1,4 +1,9 @@ +#ifdef LST_STANDALONE #include "LST.h" +#else +#include +#endif + #include "Event.h" #include "Globals.h" @@ -6,7 +11,17 @@ using XYZVector = ROOT::Math::XYZVector; namespace { - std::string trackLooperDir() { return getenv("LST_BASE"); } + std::string trackLooperDir() { + const char* path = getenv("LST_BASE"); + std::string path_str; + if (path != nullptr) { + path_str = path; + } else { + path_str = getenv("CMSSW_BASE"); + path_str += "/src/RecoTracker/LSTCore/TrackLooper"; + } + return path_str; + } std::string get_absolute_path_after_check_file_exists(const std::string name) { std::filesystem::path fullpath = std::filesystem::absolute(name.c_str()); diff --git a/SDL/LST.h b/SDL/LST.h index 4e467ebc..89898dbf 100644 --- a/SDL/LST.h +++ b/SDL/LST.h @@ -1,7 +1,11 @@ #ifndef LST_H #define LST_H +#ifdef LST_STANDALONE #include "Constants.h" +#else +#include +#endif #include #include diff --git a/SDL/Makefile b/SDL/Makefile index 4c6ebefe..84a7ee50 100644 --- a/SDL/Makefile +++ b/SDL/Makefile @@ -44,9 +44,9 @@ LIBS=$(LIB_CPU) $(LIB_CUDA) $(LIB_ROCM) GENCODE_CUDA := -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_89,code=[sm_89,compute_89] CXX = g++ -CXXFLAGS_CPU = -march=native -mtune=native -Ofast -fno-reciprocal-math -fopenmp-simd -g -Wall -Wshadow -Woverloaded-virtual -fPIC -fopenmp -I.. -CXXFLAGS_CUDA = -O3 -g --compiler-options -Wall --compiler-options -Wshadow --compiler-options -Woverloaded-virtual --compiler-options -fPIC --compiler-options -fopenmp -dc -lineinfo --ptxas-options=-v --cudart shared $(GENCODE_CUDA) --use_fast_math --default-stream per-thread -I.. -CXXFLAGS_ROCM = -O3 -g -Wall -Wshadow -Woverloaded-virtual -fPIC -I${ROCM_ROOT}/include -I.. +CXXFLAGS_CPU = -march=native -mtune=native -Ofast -fno-reciprocal-math -fopenmp-simd -g -Wall -Wshadow -Woverloaded-virtual -fPIC -fopenmp -DLST_STANDALONE -I.. +CXXFLAGS_CUDA = -O3 -g --compiler-options -Wall --compiler-options -Wshadow --compiler-options -Woverloaded-virtual --compiler-options -fPIC --compiler-options -fopenmp -dc -lineinfo --ptxas-options=-v --cudart shared $(GENCODE_CUDA) --use_fast_math --default-stream per-thread -DLST_STANDALONE -I.. +CXXFLAGS_ROCM = -O3 -g -Wall -Wshadow -Woverloaded-virtual -fPIC -I${ROCM_ROOT}/include -DLST_STANDALONE -I.. CMSSWINCLUDE := -I${CMSSW_BASE}/src ifdef CMSSW_RELEASE_BASE CMSSWINCLUDE := ${CMSSWINCLUDE} -I${CMSSW_RELEASE_BASE}/src diff --git a/SDL/MiniDoublet.h b/SDL/MiniDoublet.h index 01035229..6c265aa1 100644 --- a/SDL/MiniDoublet.h +++ b/SDL/MiniDoublet.h @@ -1,9 +1,15 @@ #ifndef MiniDoublet_cuh #define MiniDoublet_cuh +#ifdef LST_STANDALONE #include "Constants.h" -#include "EndcapGeometry.h" #include "Module.h" +#else +#include +#include +#endif + +#include "EndcapGeometry.h" #include "Hit.h" namespace SDL { diff --git a/SDL/Module.h b/SDL/Module.h index b6498f48..9f7b37af 100644 --- a/SDL/Module.h +++ b/SDL/Module.h @@ -2,7 +2,12 @@ #define Module_cuh #include + +#ifdef LST_STANDALONE #include "Constants.h" +#else +#include +#endif namespace SDL { enum SubDet { InnerPixel = 0, Barrel = 5, Endcap = 4 }; diff --git a/SDL/ModuleConnectionMap.h b/SDL/ModuleConnectionMap.h index 48290007..010e5269 100644 --- a/SDL/ModuleConnectionMap.h +++ b/SDL/ModuleConnectionMap.h @@ -8,7 +8,11 @@ #include #include +#ifdef LST_STANDALONE #include "Constants.h" +#else +#include +#endif namespace SDL { //FIXME: move to non-alpaka single arch build diff --git a/SDL/ModuleMethods.h b/SDL/ModuleMethods.h index 442068cd..c1e58c3c 100644 --- a/SDL/ModuleMethods.h +++ b/SDL/ModuleMethods.h @@ -4,8 +4,14 @@ #include #include +#ifdef LST_STANDALONE #include "Constants.h" #include "Module.h" +#else +#include +#include +#endif + #include "TiltedGeometry.h" #include "EndcapGeometry.h" #include "ModuleConnectionMap.h" diff --git a/SDL/NeuralNetwork.h b/SDL/NeuralNetwork.h index 431251f5..766ff94d 100644 --- a/SDL/NeuralNetwork.h +++ b/SDL/NeuralNetwork.h @@ -1,11 +1,17 @@ #ifndef NeuralNetwork_cuh #define NeuralNetwork_cuh +#ifdef LST_STANDALONE #include "Constants.h" +#include "Module.h" +#else +#include +#include +#endif + #include "NeuralNetworkWeights.h" #include "Segment.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" #include "Triplet.h" diff --git a/SDL/PixelMap.h b/SDL/PixelMap.h index 01a58cb0..7478006c 100644 --- a/SDL/PixelMap.h +++ b/SDL/PixelMap.h @@ -4,7 +4,11 @@ #include #include +#ifdef LST_STANDALONE #include "Constants.h" +#else +#include +#endif namespace SDL { // PixelMap is never allocated on the device. diff --git a/SDL/PixelTriplet.h b/SDL/PixelTriplet.h index 087762ee..47e9e986 100644 --- a/SDL/PixelTriplet.h +++ b/SDL/PixelTriplet.h @@ -1,11 +1,17 @@ #ifndef PixelTriplet_cuh #define PixelTriplet_cuh +#ifdef LST_STANDALONE #include "Constants.h" +#include "Module.h" +#else +#include +#include +#endif + #include "Triplet.h" #include "Segment.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" #include "Quintuplet.h" @@ -1878,10 +1884,16 @@ namespace SDL { #ifndef PixelQuintuplet_cuh #define PixelQuintuplet_cuh +#ifdef LST_STANDALONE #include "Constants.h" +#include "Module.h" +#else +#include +#include +#endif + #include "Segment.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" #include "Triplet.h" #include "Quintuplet.h" diff --git a/SDL/Quintuplet.h b/SDL/Quintuplet.h index 13e34d68..b500d089 100644 --- a/SDL/Quintuplet.h +++ b/SDL/Quintuplet.h @@ -1,12 +1,18 @@ #ifndef Quintuplet_cuh #define Quintuplet_cuh +#ifdef LST_STANDALONE #include "Constants.h" +#include "Module.h" +#else +#include +#include +#endif + #include "NeuralNetwork.h" #include "EndcapGeometry.h" #include "Segment.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" #include "Triplet.h" diff --git a/SDL/Segment.h b/SDL/Segment.h index 40b61a3c..1e41dc1a 100644 --- a/SDL/Segment.h +++ b/SDL/Segment.h @@ -1,10 +1,16 @@ #ifndef Segment_cuh #define Segment_cuh +#ifdef LST_STANDALONE #include "Constants.h" +#include "Module.h" +#else +#include +#include +#endif + #include "EndcapGeometry.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" namespace SDL { diff --git a/SDL/TiltedGeometry.h b/SDL/TiltedGeometry.h index 68d55880..cf922f8e 100644 --- a/SDL/TiltedGeometry.h +++ b/SDL/TiltedGeometry.h @@ -9,7 +9,11 @@ #include #include +#ifdef LST_STANDALONE #include "Constants.h" +#else +#include +#endif namespace SDL { template diff --git a/SDL/TrackCandidate.h b/SDL/TrackCandidate.h index 94628a17..aaa5e188 100644 --- a/SDL/TrackCandidate.h +++ b/SDL/TrackCandidate.h @@ -1,13 +1,19 @@ #ifndef TrackCandidate_cuh #define TrackCandidate_cuh +#ifdef LST_STANDALONE #include "Constants.h" +#include "Module.h" +#else +#include +#include +#endif + #include "Triplet.h" #include "Segment.h" #include "MiniDoublet.h" #include "PixelTriplet.h" #include "Quintuplet.h" -#include "Module.h" #include "Hit.h" namespace SDL { diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 7bb937c6..08287073 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -1,10 +1,16 @@ #ifndef Triplet_cuh #define Triplet_cuh +#ifdef LST_STANDALONE #include "Constants.h" +#include "Module.h" +#else +#include +#include +#endif + #include "Segment.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" namespace SDL { From 1b00919e22750e607a26c646145ca124e92707c9 Mon Sep 17 00:00:00 2001 From: Andres Rios Tascon Date: Tue, 30 Apr 2024 09:17:35 -0700 Subject: [PATCH 2/5] Fixed include syntax --- SDL/EndcapGeometry.h | 2 +- SDL/Event.h | 4 ++-- SDL/Globals.h | 4 ++-- SDL/Hit.h | 4 ++-- SDL/Kernels.h | 4 ++-- SDL/LST.cc | 2 +- SDL/LST.h | 2 +- SDL/MiniDoublet.h | 4 ++-- SDL/Module.h | 2 +- SDL/ModuleConnectionMap.h | 2 +- SDL/ModuleMethods.h | 4 ++-- SDL/NeuralNetwork.h | 4 ++-- SDL/PixelMap.h | 2 +- SDL/PixelTriplet.h | 8 ++++---- SDL/Quintuplet.h | 4 ++-- SDL/Segment.h | 4 ++-- SDL/TiltedGeometry.h | 2 +- SDL/TrackCandidate.h | 4 ++-- SDL/Triplet.h | 4 ++-- 19 files changed, 33 insertions(+), 33 deletions(-) diff --git a/SDL/EndcapGeometry.h b/SDL/EndcapGeometry.h index 8b3b31c3..d4371f64 100644 --- a/SDL/EndcapGeometry.h +++ b/SDL/EndcapGeometry.h @@ -12,7 +12,7 @@ #ifdef LST_STANDALONE #include "Constants.h" #else -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #endif #include "HeterogeneousCore/AlpakaInterface/interface/host.h" diff --git a/SDL/Event.h b/SDL/Event.h index 8eabe29b..ddd88410 100644 --- a/SDL/Event.h +++ b/SDL/Event.h @@ -5,8 +5,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "Hit.h" diff --git a/SDL/Globals.h b/SDL/Globals.h index 355a3fb6..acc424c0 100644 --- a/SDL/Globals.h +++ b/SDL/Globals.h @@ -5,8 +5,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "TiltedGeometry.h" diff --git a/SDL/Hit.h b/SDL/Hit.h index d17f965c..60e23687 100644 --- a/SDL/Hit.h +++ b/SDL/Hit.h @@ -5,8 +5,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif namespace SDL { diff --git a/SDL/Kernels.h b/SDL/Kernels.h index 747b06fe..704b6090 100644 --- a/SDL/Kernels.h +++ b/SDL/Kernels.h @@ -5,8 +5,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "Hit.h" diff --git a/SDL/LST.cc b/SDL/LST.cc index cf29f086..850fcb22 100644 --- a/SDL/LST.cc +++ b/SDL/LST.cc @@ -1,7 +1,7 @@ #ifdef LST_STANDALONE #include "LST.h" #else -#include +#include "RecoTracker/LSTCore/interface/alpaka/LST.h" #endif #include "Event.h" diff --git a/SDL/LST.h b/SDL/LST.h index 89898dbf..87ed93d9 100644 --- a/SDL/LST.h +++ b/SDL/LST.h @@ -4,7 +4,7 @@ #ifdef LST_STANDALONE #include "Constants.h" #else -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #endif #include diff --git a/SDL/MiniDoublet.h b/SDL/MiniDoublet.h index 6c265aa1..be902ca4 100644 --- a/SDL/MiniDoublet.h +++ b/SDL/MiniDoublet.h @@ -5,8 +5,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "EndcapGeometry.h" diff --git a/SDL/Module.h b/SDL/Module.h index 9f7b37af..237b8def 100644 --- a/SDL/Module.h +++ b/SDL/Module.h @@ -6,7 +6,7 @@ #ifdef LST_STANDALONE #include "Constants.h" #else -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #endif namespace SDL { diff --git a/SDL/ModuleConnectionMap.h b/SDL/ModuleConnectionMap.h index 010e5269..b00db23b 100644 --- a/SDL/ModuleConnectionMap.h +++ b/SDL/ModuleConnectionMap.h @@ -11,7 +11,7 @@ #ifdef LST_STANDALONE #include "Constants.h" #else -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #endif namespace SDL { diff --git a/SDL/ModuleMethods.h b/SDL/ModuleMethods.h index c1e58c3c..fa44d07c 100644 --- a/SDL/ModuleMethods.h +++ b/SDL/ModuleMethods.h @@ -8,8 +8,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "TiltedGeometry.h" diff --git a/SDL/NeuralNetwork.h b/SDL/NeuralNetwork.h index 766ff94d..e33c8a94 100644 --- a/SDL/NeuralNetwork.h +++ b/SDL/NeuralNetwork.h @@ -5,8 +5,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "NeuralNetworkWeights.h" diff --git a/SDL/PixelMap.h b/SDL/PixelMap.h index 7478006c..7ce70ace 100644 --- a/SDL/PixelMap.h +++ b/SDL/PixelMap.h @@ -7,7 +7,7 @@ #ifdef LST_STANDALONE #include "Constants.h" #else -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #endif namespace SDL { diff --git a/SDL/PixelTriplet.h b/SDL/PixelTriplet.h index 47e9e986..67166f80 100644 --- a/SDL/PixelTriplet.h +++ b/SDL/PixelTriplet.h @@ -5,8 +5,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "Triplet.h" @@ -1888,8 +1888,8 @@ namespace SDL { #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "Segment.h" diff --git a/SDL/Quintuplet.h b/SDL/Quintuplet.h index b500d089..f9946140 100644 --- a/SDL/Quintuplet.h +++ b/SDL/Quintuplet.h @@ -5,8 +5,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "NeuralNetwork.h" diff --git a/SDL/Segment.h b/SDL/Segment.h index 1e41dc1a..a12a5f8f 100644 --- a/SDL/Segment.h +++ b/SDL/Segment.h @@ -5,8 +5,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "EndcapGeometry.h" diff --git a/SDL/TiltedGeometry.h b/SDL/TiltedGeometry.h index cf922f8e..21e0a682 100644 --- a/SDL/TiltedGeometry.h +++ b/SDL/TiltedGeometry.h @@ -12,7 +12,7 @@ #ifdef LST_STANDALONE #include "Constants.h" #else -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #endif namespace SDL { diff --git a/SDL/TrackCandidate.h b/SDL/TrackCandidate.h index aaa5e188..b8bd0f4a 100644 --- a/SDL/TrackCandidate.h +++ b/SDL/TrackCandidate.h @@ -5,8 +5,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "Triplet.h" diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 08287073..067d657b 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -5,8 +5,8 @@ #include "Constants.h" #include "Module.h" #else -#include -#include +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" #endif #include "Segment.h" From 62c82f0c462431e726fbd2cf85a97f62b844bddd Mon Sep 17 00:00:00 2001 From: Andres Rios Tascon Date: Tue, 30 Apr 2024 15:23:35 -0400 Subject: [PATCH 3/5] Added note to clarify that this is a temporary solution Co-authored-by: Slava Krutelyov --- SDL/LST.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SDL/LST.cc b/SDL/LST.cc index 850fcb22..746722c1 100644 --- a/SDL/LST.cc +++ b/SDL/LST.cc @@ -17,6 +17,8 @@ namespace { if (path != nullptr) { path_str = path; } else { + // FIXME: temporary solution, will need to pass a value from FileInPath or CMSSW search path + // in the `LSTProducer` or a related ES producer path_str = getenv("CMSSW_BASE"); path_str += "/src/RecoTracker/LSTCore/TrackLooper"; } From 013e7fda0c5e393ba125e830747a1dd904c56dca Mon Sep 17 00:00:00 2001 From: Andres Rios Tascon Date: Thu, 2 May 2024 06:48:25 -0700 Subject: [PATCH 4/5] Switched to using LST_IS_CMSSW_PACKAGE --- Makefile | 2 +- SDL/EndcapGeometry.h | 6 +++--- SDL/Event.h | 8 ++++---- SDL/Globals.h | 8 ++++---- SDL/Hit.h | 8 ++++---- SDL/Kernels.h | 8 ++++---- SDL/LST.cc | 6 +++--- SDL/LST.h | 6 +++--- SDL/Makefile | 6 +++--- SDL/MiniDoublet.h | 8 ++++---- SDL/Module.h | 6 +++--- SDL/ModuleConnectionMap.h | 6 +++--- SDL/ModuleMethods.h | 8 ++++---- SDL/NeuralNetwork.h | 8 ++++---- SDL/PixelMap.h | 6 +++--- SDL/PixelTriplet.h | 16 ++++++++-------- SDL/Quintuplet.h | 8 ++++---- SDL/Segment.h | 8 ++++---- SDL/TiltedGeometry.h | 6 +++--- SDL/TrackCandidate.h | 8 ++++---- SDL/Triplet.h | 8 ++++---- 21 files changed, 77 insertions(+), 77 deletions(-) diff --git a/Makefile b/Makefile index 9af23202..8a64dd8f 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ ROCMINCLUDE = -I${ROCM_ROOT}/include ALPAKA_CPU = -DALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED ALPAKA_CUDA = -DALPAKA_ACC_GPU_CUDA_ENABLED -DALPAKA_HOST_ONLY ALPAKA_ROCM = -DALPAKA_ACC_GPU_HIP_ENABLED -DALPAKA_HOST_ONLY -DALPAKA_DISABLE_VENDOR_RNG -D__HIP_PLATFORM_HCC__ -D__HIP_PLATFORM_AMD__ -EXTRAFLAGS = -ITMultiDrawTreePlayer -Wunused-variable -lTMVA -lEG -lGenVector -lXMLIO -lMLP -lTreePlayer -fopenmp -DLST_STANDALONE +EXTRAFLAGS = -ITMultiDrawTreePlayer -Wunused-variable -lTMVA -lEG -lGenVector -lXMLIO -lMLP -lTreePlayer -fopenmp DOQUINTUPLET = PTCUTFLAG = CUTVALUEFLAG = diff --git a/SDL/EndcapGeometry.h b/SDL/EndcapGeometry.h index d4371f64..61ae01fc 100644 --- a/SDL/EndcapGeometry.h +++ b/SDL/EndcapGeometry.h @@ -9,10 +9,10 @@ #include #include -#ifdef LST_STANDALONE -#include "Constants.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else +#include "Constants.h" #endif #include "HeterogeneousCore/AlpakaInterface/interface/host.h" diff --git a/SDL/Event.h b/SDL/Event.h index ddd88410..7c799dcb 100644 --- a/SDL/Event.h +++ b/SDL/Event.h @@ -1,12 +1,12 @@ #ifndef Event_cuh #define Event_cuh -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "Hit.h" diff --git a/SDL/Globals.h b/SDL/Globals.h index acc424c0..9366405f 100644 --- a/SDL/Globals.h +++ b/SDL/Globals.h @@ -1,12 +1,12 @@ #ifndef Globals_h #define Globals_h -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "TiltedGeometry.h" diff --git a/SDL/Hit.h b/SDL/Hit.h index 60e23687..22699955 100644 --- a/SDL/Hit.h +++ b/SDL/Hit.h @@ -1,12 +1,12 @@ #ifndef Hit_cuh #define Hit_cuh -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif namespace SDL { diff --git a/SDL/Kernels.h b/SDL/Kernels.h index 704b6090..6ee85f3f 100644 --- a/SDL/Kernels.h +++ b/SDL/Kernels.h @@ -1,12 +1,12 @@ #ifndef Kernels_cuh #define Kernels_cuh -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "Hit.h" diff --git a/SDL/LST.cc b/SDL/LST.cc index 746722c1..4c453e29 100644 --- a/SDL/LST.cc +++ b/SDL/LST.cc @@ -1,7 +1,7 @@ -#ifdef LST_STANDALONE -#include "LST.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/LST.h" +#else +#include "LST.h" #endif #include "Event.h" diff --git a/SDL/LST.h b/SDL/LST.h index 87ed93d9..a0360932 100644 --- a/SDL/LST.h +++ b/SDL/LST.h @@ -1,10 +1,10 @@ #ifndef LST_H #define LST_H -#ifdef LST_STANDALONE -#include "Constants.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else +#include "Constants.h" #endif #include diff --git a/SDL/Makefile b/SDL/Makefile index 84a7ee50..4c6ebefe 100644 --- a/SDL/Makefile +++ b/SDL/Makefile @@ -44,9 +44,9 @@ LIBS=$(LIB_CPU) $(LIB_CUDA) $(LIB_ROCM) GENCODE_CUDA := -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_89,code=[sm_89,compute_89] CXX = g++ -CXXFLAGS_CPU = -march=native -mtune=native -Ofast -fno-reciprocal-math -fopenmp-simd -g -Wall -Wshadow -Woverloaded-virtual -fPIC -fopenmp -DLST_STANDALONE -I.. -CXXFLAGS_CUDA = -O3 -g --compiler-options -Wall --compiler-options -Wshadow --compiler-options -Woverloaded-virtual --compiler-options -fPIC --compiler-options -fopenmp -dc -lineinfo --ptxas-options=-v --cudart shared $(GENCODE_CUDA) --use_fast_math --default-stream per-thread -DLST_STANDALONE -I.. -CXXFLAGS_ROCM = -O3 -g -Wall -Wshadow -Woverloaded-virtual -fPIC -I${ROCM_ROOT}/include -DLST_STANDALONE -I.. +CXXFLAGS_CPU = -march=native -mtune=native -Ofast -fno-reciprocal-math -fopenmp-simd -g -Wall -Wshadow -Woverloaded-virtual -fPIC -fopenmp -I.. +CXXFLAGS_CUDA = -O3 -g --compiler-options -Wall --compiler-options -Wshadow --compiler-options -Woverloaded-virtual --compiler-options -fPIC --compiler-options -fopenmp -dc -lineinfo --ptxas-options=-v --cudart shared $(GENCODE_CUDA) --use_fast_math --default-stream per-thread -I.. +CXXFLAGS_ROCM = -O3 -g -Wall -Wshadow -Woverloaded-virtual -fPIC -I${ROCM_ROOT}/include -I.. CMSSWINCLUDE := -I${CMSSW_BASE}/src ifdef CMSSW_RELEASE_BASE CMSSWINCLUDE := ${CMSSWINCLUDE} -I${CMSSW_RELEASE_BASE}/src diff --git a/SDL/MiniDoublet.h b/SDL/MiniDoublet.h index be902ca4..aa63d513 100644 --- a/SDL/MiniDoublet.h +++ b/SDL/MiniDoublet.h @@ -1,12 +1,12 @@ #ifndef MiniDoublet_cuh #define MiniDoublet_cuh -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "EndcapGeometry.h" diff --git a/SDL/Module.h b/SDL/Module.h index 237b8def..a6b86e78 100644 --- a/SDL/Module.h +++ b/SDL/Module.h @@ -3,10 +3,10 @@ #include -#ifdef LST_STANDALONE -#include "Constants.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else +#include "Constants.h" #endif namespace SDL { diff --git a/SDL/ModuleConnectionMap.h b/SDL/ModuleConnectionMap.h index b00db23b..45d629a7 100644 --- a/SDL/ModuleConnectionMap.h +++ b/SDL/ModuleConnectionMap.h @@ -8,10 +8,10 @@ #include #include -#ifdef LST_STANDALONE -#include "Constants.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else +#include "Constants.h" #endif namespace SDL { diff --git a/SDL/ModuleMethods.h b/SDL/ModuleMethods.h index fa44d07c..e7d781ec 100644 --- a/SDL/ModuleMethods.h +++ b/SDL/ModuleMethods.h @@ -4,12 +4,12 @@ #include #include -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "TiltedGeometry.h" diff --git a/SDL/NeuralNetwork.h b/SDL/NeuralNetwork.h index e33c8a94..a786e249 100644 --- a/SDL/NeuralNetwork.h +++ b/SDL/NeuralNetwork.h @@ -1,12 +1,12 @@ #ifndef NeuralNetwork_cuh #define NeuralNetwork_cuh -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "NeuralNetworkWeights.h" diff --git a/SDL/PixelMap.h b/SDL/PixelMap.h index 7ce70ace..d6cbdffe 100644 --- a/SDL/PixelMap.h +++ b/SDL/PixelMap.h @@ -4,10 +4,10 @@ #include #include -#ifdef LST_STANDALONE -#include "Constants.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else +#include "Constants.h" #endif namespace SDL { diff --git a/SDL/PixelTriplet.h b/SDL/PixelTriplet.h index 67166f80..26ad87e1 100644 --- a/SDL/PixelTriplet.h +++ b/SDL/PixelTriplet.h @@ -1,12 +1,12 @@ #ifndef PixelTriplet_cuh #define PixelTriplet_cuh -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "Triplet.h" @@ -1884,12 +1884,12 @@ namespace SDL { #ifndef PixelQuintuplet_cuh #define PixelQuintuplet_cuh -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "Segment.h" diff --git a/SDL/Quintuplet.h b/SDL/Quintuplet.h index f9946140..894f4a71 100644 --- a/SDL/Quintuplet.h +++ b/SDL/Quintuplet.h @@ -1,12 +1,12 @@ #ifndef Quintuplet_cuh #define Quintuplet_cuh -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "NeuralNetwork.h" diff --git a/SDL/Segment.h b/SDL/Segment.h index a12a5f8f..61e91eef 100644 --- a/SDL/Segment.h +++ b/SDL/Segment.h @@ -1,12 +1,12 @@ #ifndef Segment_cuh #define Segment_cuh -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "EndcapGeometry.h" diff --git a/SDL/TiltedGeometry.h b/SDL/TiltedGeometry.h index 21e0a682..578d2ca8 100644 --- a/SDL/TiltedGeometry.h +++ b/SDL/TiltedGeometry.h @@ -9,10 +9,10 @@ #include #include -#ifdef LST_STANDALONE -#include "Constants.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else +#include "Constants.h" #endif namespace SDL { diff --git a/SDL/TrackCandidate.h b/SDL/TrackCandidate.h index b8bd0f4a..d6546494 100644 --- a/SDL/TrackCandidate.h +++ b/SDL/TrackCandidate.h @@ -1,12 +1,12 @@ #ifndef TrackCandidate_cuh #define TrackCandidate_cuh -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "Triplet.h" diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 067d657b..92ed04a5 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -1,12 +1,12 @@ #ifndef Triplet_cuh #define Triplet_cuh -#ifdef LST_STANDALONE -#include "Constants.h" -#include "Module.h" -#else +#ifdef LST_IS_CMSSW_PACKAGE #include "RecoTracker/LSTCore/interface/alpaka/Constants.h" #include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" +#include "Module.h" #endif #include "Segment.h" From 0dac2456dab0e5ebd598621c37f095dbfb41fcda Mon Sep 17 00:00:00 2001 From: Andres Rios Tascon Date: Thu, 2 May 2024 07:05:35 -0700 Subject: [PATCH 5/5] Use std::getenv --- SDL/LST.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDL/LST.cc b/SDL/LST.cc index 4c453e29..776663ea 100644 --- a/SDL/LST.cc +++ b/SDL/LST.cc @@ -12,14 +12,14 @@ using XYZVector = ROOT::Math::XYZVector; namespace { std::string trackLooperDir() { - const char* path = getenv("LST_BASE"); + const char* path = std::getenv("LST_BASE"); std::string path_str; if (path != nullptr) { path_str = path; } else { // FIXME: temporary solution, will need to pass a value from FileInPath or CMSSW search path // in the `LSTProducer` or a related ES producer - path_str = getenv("CMSSW_BASE"); + path_str = std::getenv("CMSSW_BASE"); path_str += "/src/RecoTracker/LSTCore/TrackLooper"; } return path_str;