Clean-up: merge JFJOCH_USE_NUMA_H and JFJOCH_USE_NUMA, remove two unnecessary helper programs
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include "../jungfrau/JFPedestalCalc.h"
|
||||
#include "../indexing/IndexerWrapper.h"
|
||||
|
||||
#ifdef JFJOCH_USE_NUMA_H
|
||||
#ifdef JFJOCH_USE_NUMA
|
||||
#include <numa.h>
|
||||
#endif
|
||||
|
||||
@@ -632,7 +632,7 @@ void JFJochReceiver::PrepareConversionOnCPU() {
|
||||
}
|
||||
|
||||
void JFJochReceiver::PinThreadToDevice(uint16_t data_stream) {
|
||||
#ifdef JFJOCH_USE_NUMA_H
|
||||
#ifdef JFJOCH_USE_NUMA
|
||||
if (numa_available() != -1)
|
||||
numa_run_on_node(acquisition_device[data_stream]->GetNUMANode());
|
||||
#endif
|
||||
|
||||
@@ -5,7 +5,6 @@ ADD_LIBRARY(JungfraujochHost STATIC
|
||||
HLSSimulatedDevice.cpp HLSSimulatedDevice.h
|
||||
Completion.cpp Completion.h ActionConfig.h
|
||||
PCIExpressDevice.cpp PCIExpressDevice.h
|
||||
MakeAcquisitionDevice.cpp MakeAcquisitionDevice.h
|
||||
AcquisitionOfflineCounters.cpp AcquisitionOfflineCounters.h
|
||||
IBWrappers.cpp IBWrappers.h
|
||||
RawEthDevice.cpp RawEthDevice.h
|
||||
@@ -22,10 +21,12 @@ IF(IBVERBS)
|
||||
MESSAGE(STATUS "JFJochReceiver compiled with IBVerbs support")
|
||||
ENDIF()
|
||||
|
||||
IF(HAS_NUMA_H AND NUMA_LIBRARY)
|
||||
TARGET_COMPILE_DEFINITIONS(JungfraujochHost PRIVATE -DJFJOCH_USE_NUMA_H)
|
||||
IF(HAS_NUMAIF AND HAS_NUMA_H AND NUMA_LIBRARY)
|
||||
TARGET_COMPILE_DEFINITIONS(JungfraujochHost PUBLIC -DJFJOCH_USE_NUMA)
|
||||
TARGET_LINK_LIBRARIES(JungfraujochHost ${NUMA_LIBRARY})
|
||||
MESSAGE(STATUS "JFJochReceiver compiled with NUMA thread pinning")
|
||||
MESSAGE(STATUS "NUMA memory/CPU pinning enabled")
|
||||
ELSE()
|
||||
MESSAGE(WARNING "NUMA memory/CPU pinning disabled")
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(jfjoch_pcie_status jfjoch_pcie_status.cpp)
|
||||
@@ -36,19 +37,6 @@ ADD_EXECUTABLE(jfjoch_pcie_set_network jfjoch_pcie_set_network.cpp)
|
||||
TARGET_LINK_LIBRARIES(jfjoch_pcie_set_network JungfraujochHost)
|
||||
INSTALL(TARGETS jfjoch_pcie_set_network RUNTIME)
|
||||
|
||||
ADD_EXECUTABLE(jfjoch_pcie_fill_buffer jfjoch_pcie_fill_buffer.cpp)
|
||||
TARGET_LINK_LIBRARIES(jfjoch_pcie_fill_buffer JungfraujochHost)
|
||||
INSTALL(TARGETS jfjoch_pcie_fill_buffer RUNTIME)
|
||||
|
||||
ADD_EXECUTABLE(jfjoch_pcie_print_dev_buf jfjoch_pcie_print_dev_buf.cpp)
|
||||
TARGET_LINK_LIBRARIES(jfjoch_pcie_print_dev_buf JungfraujochHost)
|
||||
INSTALL(TARGETS jfjoch_pcie_print_dev_buf RUNTIME)
|
||||
|
||||
ADD_EXECUTABLE(jfjoch_pcie_clear_net_counters jfjoch_pcie_clear_net_counters.cpp)
|
||||
TARGET_LINK_LIBRARIES(jfjoch_pcie_clear_net_counters JungfraujochHost)
|
||||
INSTALL(TARGETS jfjoch_pcie_clear_net_counters RUNTIME)
|
||||
|
||||
IF(HAS_NUMAIF AND NUMA_LIBRARY)
|
||||
TARGET_COMPILE_DEFINITIONS(JungfraujochHost PRIVATE -DJFJOCH_USE_NUMA)
|
||||
TARGET_LINK_LIBRARIES(JungfraujochHost ${NUMA_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
@@ -6,14 +6,11 @@
|
||||
#include "IBReceiver.h"
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#ifdef JFJOCH_USE_NUMA
|
||||
#include <numaif.h>
|
||||
#endif
|
||||
|
||||
#ifdef JFJOCH_USE_NUMA_H
|
||||
#include <numa.h>
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#include "../common/JFJochException.h"
|
||||
@@ -95,7 +92,7 @@ IBReceiver::IBReceiver(IBContext &context,
|
||||
}
|
||||
|
||||
void IBReceiver::Run(uint8_t numa_node) {
|
||||
#ifdef JFJOCH_USE_NUMA_H
|
||||
#ifdef JFJOCH_USE_NUMA
|
||||
if (numa_available() != -1)
|
||||
numa_run_on_node(numa_node);
|
||||
#endif
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
// Copyright (2019-2022) Paul Scherrer Institute
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
|
||||
#include "../common/JFJochException.h"
|
||||
#include "PCIExpressDevice.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
if (argc != 2) {
|
||||
std::cout << "Usage: ./jfjoch_pcie_status <device name>" << std::endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
std::cout << "Device " << argv[1] << std::endl;
|
||||
std::cout << std::endl;
|
||||
try {
|
||||
PCIExpressDevice test(argv[1], 0);
|
||||
|
||||
auto ptr = test.GetDeviceBuffer(9);
|
||||
|
||||
for (int i = 0; i < RAW_MODULE_SIZE; i++)
|
||||
ptr[i] = i % 16;
|
||||
|
||||
} catch (const JFJochException &e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
// Copyright (2019-2022) Paul Scherrer Institute
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
|
||||
#include "../common/JFJochException.h"
|
||||
#include "PCIExpressDevice.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
if (argc != 2) {
|
||||
std::cout << "Usage: ./jfjoch_pcie_status <device name>" << std::endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
std::cout << "Device " << argv[1] << std::endl;
|
||||
std::cout << std::endl;
|
||||
try {
|
||||
PCIExpressDevice test(argv[1], 0);
|
||||
|
||||
for (int i = 0; i < test.GetNumKernelBuffers(); i++) {
|
||||
auto ptr = test.GetDeviceBuffer(i);
|
||||
std::cout << std::hex << i << " ";
|
||||
for (int j = 0; j < 32; j++)
|
||||
std::cout << ptr[j] << " ";
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
} catch (const JFJochException &e) {
|
||||
std::cout << e.what() << std::endl;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user