jfjoch_action_test: Enable pinning modes for mock acquisition device

This commit is contained in:
2023-08-04 12:52:38 +02:00
parent 7d945c8195
commit ca5def57ec

View File

@@ -15,6 +15,8 @@ void print_usage(Logger &logger) {
logger.Info(" -M use mock device");
logger.Info(" -B blocking mode (FPGA)");
logger.Info(" -v verbose");
logger.Info(" -H mock aq. dev. with HBM (DL380 with Intel MAX only)");
logger.Info(" -D mock aq. dev. with DDR (2 NUMA node machines only)");
logger.Info(" -s<num> number of data streams (acquisition devices)");
logger.Info(" -m<num> number of modules per data stream");
logger.Info(" -i<num> number of images");
@@ -38,6 +40,8 @@ int main(int argc, char **argv) {
bool nonblocking_mode = true;
bool verbose = false;
std::string numa_policy_name;
bool use_hbm_for_aq_dev = false;
bool use_ddr_for_aq_dev = false;
if (argc == 1)
print_usage(logger);
@@ -75,6 +79,12 @@ int main(int argc, char **argv) {
case 'P':
numa_policy_name = std::string(optarg);
break;
case 'H':
use_hbm_for_aq_dev = true;
break;
case 'D':
use_ddr_for_aq_dev = true;
break;
default: /* '?' */
print_usage(logger);
exit(EXIT_FAILURE);
@@ -116,8 +126,19 @@ int main(int argc, char **argv) {
if (nmodules > 1) {
logger.Warning("Conversion results will be wrong with more than 1 module per stream");
}
for (int i = 0; i < nstreams; i++) {
mock_devices.push_back(std::make_unique<MockAcquisitionDevice>(i, 1024));
int16_t numa_node = -1;
if (use_hbm_for_aq_dev)
numa_node = 2 + (i % 2);
else if (use_ddr_for_aq_dev)
numa_node = i % 2;
if (numa_node != -1)
logger.Info("Pinning stream {} to NUMA node {}", i, numa_node);
mock_devices.push_back(std::make_unique<MockAcquisitionDevice>(i, 1024, numa_node));
mock_devices[i]->SetCustomInternalGeneratorFrame(input);
mock_devices[i]->EnableLogging(&logger);
aq_devices.push_back(mock_devices[i].get());