From 32f4ef6dba258bfc21b9f9875245c03bfef46393 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Wed, 27 May 2020 10:43:22 +0200 Subject: [PATCH] Change logic from pulse_id to block sending --- sf-replay/src/main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sf-replay/src/main.cpp b/sf-replay/src/main.cpp index 81d9937..e7b65b7 100644 --- a/sf-replay/src/main.cpp +++ b/sf-replay/src/main.cpp @@ -89,10 +89,13 @@ int main (int argc, char *argv[]) { ReplayZmqSender sender(ipc_id, source_id); - // "<= stop_pulse_id" because we include the stop_pulse_id in the file. - for (uint64_t curr_pulse_id=start_pulse_id; - curr_pulse_id <= stop_pulse_id; - curr_pulse_id++) { + uint64_t start_block = start_pulse_id / BUFFER_BLOCK_SIZE; + uint64_t stop_block = stop_pulse_id / BUFFER_BLOCK_SIZE; + + // "<= stop_block" because we include the stop_block in the transfer. + for (uint64_t curr_block=start_block; + curr_block <= stop_block; + curr_block++) { int slot_id; while((slot_id = queue.read()) == -1) {