Skip to content

Commit

Permalink
Merge pull request #358 from SegmentLinking/compileFlags
Browse files Browse the repository at this point in the history
Clean up T3T3 flag and add flag to allow triplet pLSs in TCs
  • Loading branch information
ariostas authored Jan 10, 2024
2 parents d0effe6 + 7b9fbd4 commit 50d8a25
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 1,060 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ EXTRACFLAGS = $(shell rooutil-config) -g
EXTRAFLAGS = -fPIC -ITMultiDrawTreePlayer -Wunused-variable -lTMVA -lEG -lGenVector -lXMLIO -lMLP -lTreePlayer -L${CUDA_HOME}/lib64 -lcudart -fopenmp
DOQUINTUPLET = #-DFP16_Base
PTCUTFLAG =
T3T3EXTENSION=
CUTVALUEFLAG =
CUTVALUEFLAG_FLAGS = -DCUT_VALUE_DEBUG

Expand All @@ -46,13 +45,13 @@ cutvalue_primitive: $(ROOUTIL) efficiency $(EXES)


bin/doAnalysis: bin/doAnalysis.o $(OBJECTS)
$(CXX) $(PTCUTFLAG) $(T3T3EXTENSION) $(LDFLAGS) $^ $(ROOTLIBS) $(EXTRACFLAGS) $(CUTVALUEFLAG) $(PRIMITIVEFLAG) $(EXTRAFLAGS) $(DOQUINTUPLET) $(ALPAKAINCLUDE) $(ALPAKASERIAL) -o $@
$(CXX) $(PTCUTFLAG) $(LDFLAGS) $^ $(ROOTLIBS) $(EXTRACFLAGS) $(CUTVALUEFLAG) $(PRIMITIVEFLAG) $(EXTRAFLAGS) $(DOQUINTUPLET) $(ALPAKAINCLUDE) $(ALPAKASERIAL) -o $@

bin/sdl: bin/sdl.o $(OBJECTS)
$(CXX) $(PTCUTFLAG) $(T3T3EXTENSION) $(LDFLAGS) $^ $(ROOTLIBS) $(EXTRACFLAGS) $(CUTVALUEFLAG) $(PRIMITIVEFLAG) $(EXTRAFLAGS) $(DOQUINTUPLET) $(ALPAKAINCLUDE) $(ALPAKASERIAL) -o $@
$(CXX) $(PTCUTFLAG) $(LDFLAGS) $^ $(ROOTLIBS) $(EXTRACFLAGS) $(CUTVALUEFLAG) $(PRIMITIVEFLAG) $(EXTRAFLAGS) $(DOQUINTUPLET) $(ALPAKAINCLUDE) $(ALPAKASERIAL) -o $@

%.o: %.cc
$(CXX) $(PTCUTFLAG) $(T3T3EXTENSION) $(CFLAGS) $(EXTRACFLAGS) $(CUTVALUEFLAG) $(PRIMITIVEFLAG) $(DOQUINTUPLET) $(ALPAKAINCLUDE) $(ALPAKASERIAL) $< -c -o $@
$(CXX) $(PTCUTFLAG) $(CFLAGS) $(EXTRACFLAGS) $(CUTVALUEFLAG) $(PRIMITIVEFLAG) $(DOQUINTUPLET) $(ALPAKAINCLUDE) $(ALPAKASERIAL) $< -c -o $@

$(ROOUTIL):
$(MAKE) -C code/rooutil/
Expand Down
3 changes: 0 additions & 3 deletions SDL/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ namespace SDL {
int getNumberOfPixelTriplets();
int getNumberOfPixelQuintuplets();

unsigned int getNumberOfExtendedTracks();
unsigned int getNumberOfT3T3ExtendedTracks();

objectRangesBuffer<alpaka::DevCpu>* getRanges();
hitsBuffer<alpaka::DevCpu>* getHits();
hitsBuffer<alpaka::DevCpu>* getHitsInCMSSW();
Expand Down
4 changes: 2 additions & 2 deletions SDL/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ LST_cuda.o: LST.cc
$(CXX) -c $(CXXFLAGS_CPU) $(ROOTLIBS) $(PRINTFLAG) $(CACHEFLAG) $(DUPLICATES) $(LSTWARNINGSFLAG) $(ROOTCFLAGS) $(ALPAKAINCLUDE) $(PTCUTFLAG) $(ALPAKASERIAL) $< -o $@

%_cpu.o: %.cc
$(COMPILE_CMD_CPU) $(CXXFLAGS_CPU) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(T5CUTFLAGS) $(NOPLSDUPCLEANFLAG) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CPU) $< -o $@
$(COMPILE_CMD_CPU) $(CXXFLAGS_CPU) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(T5CUTFLAGS) $(NOPLSDUPCLEANFLAG) $(TCPLSTRIPLETSFLAG) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CPU) $< -o $@

%_cuda.o: %.cc
$(COMPILE_CMD_CUDA) $(CXXFLAGS_CUDA) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(T5CUTFLAGS) $(NOPLSDUPCLEANFLAG) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CUDA) $< -o $@
$(COMPILE_CMD_CUDA) $(CXXFLAGS_CUDA) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(T5CUTFLAGS) $(NOPLSDUPCLEANFLAG) $(TCPLSTRIPLETSFLAG) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CUDA) $< -o $@

$(LIB_CUDA): $(CCOBJECTS_CUDA) $(LSTOBJECTS_CUDA)
$(LD_CUDA) $(SOFLAGS_CUDA) $^ -o $@
Expand Down
4 changes: 4 additions & 0 deletions SDL/TrackCandidate.h
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,11 @@ namespace SDL {
unsigned int nPixels = segmentsInGPU.nSegments[nLowerModules];
for (int pixelArrayIndex = globalThreadIdx[2]; pixelArrayIndex < nPixels;
pixelArrayIndex += gridThreadExtent[2]) {
#ifdef TC_PLS_TRIPLETS
if (segmentsInGPU.isDup[pixelArrayIndex])
#else
if ((!segmentsInGPU.isQuad[pixelArrayIndex]) || (segmentsInGPU.isDup[pixelArrayIndex]))
#endif
continue;

unsigned int trackCandidateIdx =
Expand Down
22 changes: 11 additions & 11 deletions bin/sdl_make_tracklooper
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ usage()
echo " -m make clean binaries (Make clean binaries before remake. e.g. when header files changed in SDL/*.h)"
echo " -d cut value ntuple (With extra variables in a debug ntuple file)"
echo " -p primitive object ntuple (With extra variables related to primitive objects)"
echo " -3 do T3T3 extensions (-e turned on if not specified)"
echo " -3 TC pLS triplets (Allow triplet pLSs in TC collection)"
echo " -N neural networks (Toggle LST neural networks)"
echo " -G GPU (CUDA) backend (Compile only for CUDA, takes priority over -C)"
echo " -C CPU serial backend (Compile only for CPU)"
Expand All @@ -43,7 +43,7 @@ while getopts ":cxgsmdp3NGC2ehwP:" OPTION; do
m) MAKECLEANBINARIES=true;;
d) MAKECUTVALUES=true;;
p) PRIMITIVE=true;;
3) T3T3EXTENSION=true;;
3) TCPLSTRIPLETS=true;;
N) DONTUSENN=true;;
G) ONLYCUDABACKEND=true;;
C) ONLYCPUBACKEND=true;;
Expand All @@ -61,7 +61,7 @@ if [ -z ${SHOWLOG} ]; then SHOWLOG=false; fi
if [ -z ${MAKECLEANBINARIES} ]; then MAKECLEANBINARIES=false; fi
if [ -z ${MAKECUTVALUES} ]; then MAKECUTVALUES=false; fi
if [ -z ${PRIMITIVE} ]; then PRIMITIVE=false; fi
if [ -z ${T3T3EXTENSION} ]; then T3T3EXTENSION=false; fi
if [ -z ${TCPLSTRIPLETS} ]; then TCPLSTRIPLETS=false; fi
if [ -z ${DONTUSENN} ]; then DONTUSENN=false; fi
if [ -z ${ONLYCUDABACKEND} ]; then ONLYCUDABACKEND=false; fi
if [ -z ${ONLYCPUBACKEND} ]; then ONLYCPUBACKEND=false; fi
Expand Down Expand Up @@ -97,7 +97,7 @@ echo " SHOWLOG : ${SHOWLOG}" | tee -a ${LOG}
echo " MAKECLEANBINARIES : ${MAKECLEANBINARIES}" | tee -a ${LOG}
echo " MAKECUTVALUES : ${MAKECUTVALUES}" | tee -a ${LOG}
echo " PRIMITIVE : ${PRIMITIVE}" | tee -a ${LOG}
echo " T3T3EXTENSION : ${T3T3EXTENSION}" | tee -a ${LOG}
echo " TCPLSTRIPLETS : ${TCPLSTRIPLETS}" | tee -a ${LOG}
echo " DONTUSENN : ${DONTUSENN}" | tee -a ${LOG}
echo " ONLYCUDABACKEND : ${ONLYCUDABACKEND}" | tee -a ${LOG}
echo " ONLYCPUBACKEND : ${ONLYCPUBACKEND}" | tee -a ${LOG}
Expand Down Expand Up @@ -138,9 +138,9 @@ if $PRIMITIVE; then
echo "debug : MAKETARGET=${MAKETARGET}"
fi

T3T3EXTENSIONOPT=
if $T3T3EXTENSION; then
T3T3EXTENSIONOPT="T3T3EXTENSION=-DT3T3_EXTENSIONS"
TCPLSTRIPLETSOPT=
if $TCPLSTRIPLETS; then
TCPLSTRIPLETSOPT="TCPLSTRIPLETSFLAG=-DTC_PLS_TRIPLETS"
fi

T5CUTOPT=
Expand Down Expand Up @@ -181,9 +181,9 @@ echo "--------------------------------------------------------------------------
echo "---------------------------------------------------------------------------------------------" >> ${LOG} 2>&1
echo "---------------------------------------------------------------------------------------------" >> ${LOG} 2>&1
if $SHOWLOG; then
(cd SDL && make clean && make ${T3T3EXTENSIONOPT} ${T5CUTOPT} ${BACKENDOPT} ${PRINTWARNINGSOPT} ${NOPLSDUPCLEANOPT} ${PTCUTOPT} -j 32 ${MAKETARGET} && cd -) 2>&1 | tee -a ${LOG}
(cd SDL && make clean && make ${TCPLSTRIPLETSOPT} ${T5CUTOPT} ${BACKENDOPT} ${PRINTWARNINGSOPT} ${NOPLSDUPCLEANOPT} ${PTCUTOPT} -j 32 ${MAKETARGET} && cd -) 2>&1 | tee -a ${LOG}
else
(cd SDL && make clean && make ${T3T3EXTENSIONOPT} ${T5CUTOPT} ${BACKENDOPT} ${PRINTWARNINGSOPT} ${NOPLSDUPCLEANOPT} ${PTCUTOPT} -j 32 ${MAKETARGET} && cd -) >> ${LOG} 2>&1
(cd SDL && make clean && make ${TCPLSTRIPLETSOPT} ${T5CUTOPT} ${BACKENDOPT} ${PRINTWARNINGSOPT} ${NOPLSDUPCLEANOPT} ${PTCUTOPT} -j 32 ${MAKETARGET} && cd -) >> ${LOG} 2>&1
fi

if ([[ "$BACKENDOPT" == *"all"* ]] || [[ "$BACKENDOPT" == *"cpu"* ]]) && [ ! -f SDL/libsdl_cpu.so ]; then
Expand Down Expand Up @@ -215,9 +215,9 @@ echo "--------------------------------------------------------------------------
echo "---------------------------------------------------------------------------------------------" >> ${LOG} 2>&1
echo "---------------------------------------------------------------------------------------------" >> ${LOG} 2>&1
if $SHOWLOG; then
make ${T3T3EXTENSIONOPT} ${TRACKLOOPERTARGET} ${PTCUTOPT} -j 2>&1 | tee -a ${LOG}
make ${TRACKLOOPERTARGET} ${PTCUTOPT} -j 2>&1 | tee -a ${LOG}
else
make ${T3T3EXTENSIONOPT} ${TRACKLOOPERTARGET} ${PTCUTOPT} -j >> ${LOG} 2>&1
make ${TRACKLOOPERTARGET} ${PTCUTOPT} -j >> ${LOG} 2>&1
fi

if [ ! -f bin/sdl ]; then
Expand Down
2 changes: 1 addition & 1 deletion efficiency/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $(EXE): src/performance.o src/helper_v2.o src/SDL.o
$(LD) $(CXXFLAGS) $(LDFLAGS) src/performance.o src/helper_v2.o src/SDL.o $(ROOTLIBS) $(EXTRAFLAGS) -o $@

src/SDL.o: src/SDL.cc src/SDL.h
$(CC) $(T3T3EXTENSION) $(CFLAGS) $(EXTRACFLAGS) $< -c -o $@
$(CC) $(CFLAGS) $(EXTRACFLAGS) $< -c -o $@

src/performance.o: src/performance.cc src/performance.h src/sdl_types.h
$(CC) $(CFLAGS) $(EXTRACFLAGS) $< -c -o $@
Expand Down
Loading

0 comments on commit 50d8a25

Please sign in to comment.