Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 8m30s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 10m13s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 9m45s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 11m13s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 9m51s
Build Packages / build:rpm (rocky8) (push) Successful in 8m29s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 9m31s
Build Packages / build:rpm (rocky9) (push) Successful in 9m42s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 8m47s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 8m23s
Build Packages / Generate python client (push) Successful in 19s
Build Packages / Build documentation (push) Successful in 38s
Build Packages / Create release (push) Skipped
Build Packages / XDS test (durin plugin) (push) Successful in 6m18s
Build Packages / XDS test (neggia plugin) (push) Successful in 6m4s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 6m35s
Build Packages / DIALS test (push) Successful in 10m39s
Build Packages / Unit tests (push) Successful in 1h24m58s
NUMA CPU/memory pinning is no longer worthwhile: the FPGA DMA buffers are placed device-local by the kernel (dma_alloc_coherent), the big RAM ring buffer is random-access (first-touch handles placement), and GPU work is already spread across all visible devices. So drop the pinning entirely and with it libnuma. - Delete NUMAHWPolicy; the only concern worth keeping - GPU selection - is done directly via pin_gpu() (round-robin over visible GPUs) in the indexer pool and the Lite analysis threads. CPU-only threads (FPGA acquire/pedestal/summation/frame-transform) no longer bind anything. - Drop get_gpu_numa_node() (sysfs lookup) - only SelectGPUAndItsNUMA used it. - numa_policy broker setting is deprecated and ignored (kept in the API for backward compatibility; warns once on startup). - Remove NUMA_LIBRARY / numa.h / numaif.h detection from CMake. - Docs: drop the NUMA dependency, remove the numa_policy config example, and document running multiple brokers on disjoint GPUs via CUDA_VISIBLE_DEVICES. - Remove NUMA_GPU_REVIEW.md (the planning note; this work is now done). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
89 lines
3.6 KiB
C++
89 lines
3.6 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include <mutex>
|
|
#include <memory>
|
|
|
|
#include "JFJochReceiver.h"
|
|
#include "../acquisition_device/AcquisitionDeviceGroup.h"
|
|
|
|
#include "../preview/ZMQMetadataSocket.h"
|
|
#include "../preview/ZMQPreviewSocket.h"
|
|
|
|
class JFJochReceiverService {
|
|
std::unique_ptr<JFJochReceiver> receiver;
|
|
AcquisitionDeviceGroup &aq_devices;
|
|
Logger &logger;
|
|
ImageBuffer image_buffer;
|
|
ImagePusher &image_pusher;
|
|
std::shared_ptr<ImagePuller> image_puller;
|
|
int64_t nthreads = 8;
|
|
|
|
enum class ReceiverState {Idle, Running};
|
|
ReceiverState state = ReceiverState::Idle;
|
|
mutable std::mutex state_mutex;
|
|
std::condition_variable measurement_done;
|
|
std::future<void> measurement;
|
|
void FinalizeMeasurement();
|
|
void FinalizeMeasurementChangeState();
|
|
SpotFindingSettings spot_finding_settings;
|
|
|
|
PreviewImage preview_image;
|
|
std::unique_ptr<ZMQPreviewSocket> zmq_preview_socket;
|
|
std::unique_ptr<ZMQMetadataSocket> zmq_metadata_socket;
|
|
std::unique_ptr<IndexerThreadPool> indexer_thread_pool;
|
|
|
|
JFJochReceiverCurrentStatus receiver_status;
|
|
JFJochReceiverPlots plots;
|
|
public:
|
|
JFJochReceiverService(AcquisitionDeviceGroup &aq_devices,
|
|
Logger &logger,
|
|
ImagePusher &pusher,
|
|
size_t send_buffer_size_MiB = 512);
|
|
JFJochReceiverService& NumThreads(int64_t input);
|
|
JFJochReceiverService& PreviewSocket(const std::string &addr, const std::optional<int32_t> &watermark = {});
|
|
JFJochReceiverService& MetadataSocket(const std::string &addr);
|
|
|
|
JFJochReceiverService& PreviewSocketSettings(const ZMQPreviewSettings &input);
|
|
JFJochReceiverService& MetadataSocketSettings(const ZMQMetadataSettings &input);
|
|
JFJochReceiverService& Indexing(const IndexingSettings& input);
|
|
|
|
ZMQPreviewSettings GetPreviewSocketSettings() const;
|
|
ZMQMetadataSettings GetMetadataSocketSettings() const;
|
|
|
|
std::string GetPreviewSocketAddress() const;
|
|
std::string GetMetadataSocketAddress() const;
|
|
|
|
void LoadInternalGeneratorImage(const DiffractionExperiment& experiment,
|
|
const std::vector<uint16_t> &raw_expected_image,
|
|
uint64_t image_number);
|
|
void Start(const DiffractionExperiment &experiment,
|
|
const PixelMask &pixel_mask,
|
|
const JFCalibration *calibration,
|
|
std::shared_ptr<ImagePuller> puller = {});
|
|
void Cancel(bool silent);
|
|
JFJochReceiverOutput Stop();
|
|
void SetSpotFindingSettings(const SpotFindingSettings& settings);
|
|
MultiLinePlot GetDataProcessingPlot(const PlotRequest& request);
|
|
void GetPlotRaw(std::vector<float> &v, PlotType type, const std::string &roi);
|
|
|
|
std::optional<JFJochReceiverStatus> GetStatus();
|
|
std::vector<AcquisitionDeviceNetConfig> GetNetworkConfig();
|
|
std::vector<DeviceStatus> GetDeviceStatus() const;
|
|
std::optional<float> GetProgress() const;
|
|
|
|
void GetXFELEventCode(std::vector<uint64_t> &v) const;
|
|
void GetXFELPulseID(std::vector<uint64_t> &v) const;
|
|
|
|
void GetStartMessageFromBuffer(std::vector<uint8_t> &v);
|
|
bool GetImageFromBuffer(std::vector<uint8_t> &v, int64_t image_number = ImageBuffer::MaxImage);
|
|
std::string GetTIFFFromBuffer(int64_t image_number = ImageBuffer::MaxImage);
|
|
std::string GetJPEGFromBuffer(const PreviewImageSettings &settings, int64_t image_number = ImageBuffer::MaxImage);
|
|
ImageBufferStatus GetImageBufferStatus() const;
|
|
void ClearImageBuffer();
|
|
|
|
ImagePusherStatus GetImagePusherStatus() const;
|
|
};
|