Skip to content

Commit b3e6b31

Browse files
committed
added support for (optional) numa + cleanup
1 parent 39542f0 commit b3e6b31

File tree

3 files changed

+45
-34
lines changed

3 files changed

+45
-34
lines changed

CMakeLists.txt

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,32 +63,18 @@ set(MODULE_NAME "Readout")
6363

6464
O2_SETUP(NAME ${MODULE_NAME})
6565

66-
set(SRCS
67-
src/Consumer.cxx
68-
src/ConsumerStats.cxx
69-
src/ConsumerFileRecorder.cxx
70-
src/ConsumerDataChecker.cxx
71-
src/ConsumerDataSampling.cxx
72-
# src/ConsumerFMQ.cxx
73-
src/ReadoutEquipment.cxx
74-
src/ReadoutEquipmentDummy.cxx
75-
src/ReadoutEquipmentRORC.cxx
76-
src/DataBlockAggregator.cxx
77-
src/mainReadout.cxx
78-
src/ReadoutUtils.cxx
79-
)
80-
8166
include_directories(
82-
${CMAKE_CURRENT_SOURCE_DIR}/../RORC/include
8367
${Boost_INCLUDE_DIRS}
8468
${Monitoring_INCLUDE_DIRS}
8569
${FAIRROOT_INCLUDE_DIR}
8670
${FAIRROOT_INCLUDE_DIR}/fairmq
87-
${ZeroMQ_INCLUDE_DIR}
71+
# ${ZeroMQ_INCLUDE_DIR}
8872
${Common_INCLUDE_DIRS}
8973
${Configuration_INCLUDE_DIRS}
9074
${InfoLogger_INCLUDE_DIRS}
9175
${ReadoutCard_INCLUDE_DIRS}
76+
${DataSampling_INCLUDE_DIRS}
77+
${Numa_INCLUDE_DIRS}
9278
)
9379

9480
add_library(
@@ -131,17 +117,11 @@ add_library(
131117
${CONSUMERS_SRCS}
132118
)
133119

134-
135-
set(LIBRARY_NAME ${MODULE_NAME})
136120
set(BUCKET_NAME o2_readout_bucket)
137-
138121
if (FAIRROOT_FOUND)
139-
list(APPEND SRCS src/ConsumerFMQ.cxx)
140122
set(BUCKET_NAME o2_readout_with_fair)
141123
endif ()
142124

143-
O2_GENERATE_LIBRARY()
144-
145125
add_subdirectory(doc)
146126

147127
O2_GENERATE_EXECUTABLE(
@@ -183,7 +163,7 @@ O2_GENERATE_EXECUTABLE(
183163
O2_GENERATE_EXECUTABLE(
184164
EXE_NAME testROC.exe
185165
SOURCES src/testROC.cxx $<TARGET_OBJECTS:objMemUtils>
186-
BUCKET_NAME o2_readout_numa_bucket
166+
BUCKET_NAME ${BUCKET_NAME}
187167
)
188168

189169
# Install some extra files

cmake/FindNuma.cmake

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Try to find the Numa package include dirs and libraries
2+
# Author: Sylvain Chapeland
3+
#
4+
# This script will set the following variables:
5+
# Numa_FOUND - System has Numa
6+
# Numa_INCLUDE_DIRS - The Numa include directories
7+
# Numa_LIBRARIES - The libraries needed to use Numa
8+
#
9+
# This script can use the following variables:
10+
# Numa_ROOT - Installation root to tell this module where to look.
11+
12+
13+
find_path(
14+
Numa_INCLUDE_DIRS NAMES numa.h
15+
PATHS ${Numa_ROOT} ${Numa_ROOT}/include)
16+
17+
find_library(
18+
Numa_LIBRARIES NAMES numa
19+
PATHS ${Numa_ROOT} ${Numa_ROOT}/lib)
20+
21+
include(FindPackageHandleStandardArgs)
22+
find_package_handle_standard_args(
23+
Numa DEFAULT_MSG Numa_INCLUDE_DIRS Numa_LIBRARIES)
24+
25+
if(${Numa_FOUND})
26+
message(
27+
STATUS
28+
"Found Numa (include: ${Numa_INCLUDE_DIRS} library: ${Numa_LIBRARIES}")
29+
endif()
30+
31+
mark_as_advanced(Numa_INCLUDE_DIRS Numa_LIBRARIES)

cmake/ReadoutDependencies.cmake

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ find_package(Common REQUIRED)
77
find_package(InfoLogger REQUIRED)
88
find_package(ReadoutCard REQUIRED)
99
find_package(DataSampling REQUIRED)
10-
find_package(ZeroMQ REQUIRED)
10+
#find_package(ZeroMQ REQUIRED)
11+
find_package(Numa)
1112

1213
if (FAIRROOT_FOUND)
1314
# this should go away when fairrot provides a proper Find script or proper config scripts
@@ -19,6 +20,12 @@ else (FAIRROOT_FOUND)
1920
message(WARNING "FairRoot not found, corresponding classes will not be compiled.")
2021
endif (FAIRROOT_FOUND)
2122

23+
if (Numa_FOUND)
24+
ADD_DEFINITIONS(-DWITH_NUMA)
25+
else (Numa_FOUND)
26+
message(WARNING "Numa not found, corresponding features will be disabled.")
27+
endif (Numa_FOUND)
28+
2229
ADD_DEFINITIONS(-DWITH_DATASAMPLING)
2330

2431
o2_define_bucket(
@@ -37,6 +44,7 @@ o2_define_bucket(
3744
${InfoLogger_LIBRARIES}
3845
${ReadoutCard_LIBRARIES}
3946
${DataSampling_LIBRARIES}
47+
${Numa_LIBRARIES}
4048

4149
SYSTEMINCLUDE_DIRECTORIES
4250
${Boost_INCLUDE_DIRS}
@@ -45,6 +53,7 @@ o2_define_bucket(
4553
${ReadoutCard_INCLUDE_DIRS}
4654
${DataSampling_INCLUDE_DIRS}
4755
${Configuration_INCLUDE_DIRS}
56+
${Numa_INCLUDE_DIRS}
4857
)
4958

5059

@@ -61,12 +70,3 @@ o2_define_bucket(
6170
${FAIRROOT_INCLUDE_DIR}
6271
${FAIRROOT_INCLUDE_DIR}/fairmq
6372
)
64-
65-
o2_define_bucket(
66-
NAME
67-
o2_readout_numa_bucket
68-
69-
DEPENDENCIES
70-
o2_readout_bucket
71-
numa
72-
)

0 commit comments

Comments
 (0)