diff --git a/core-buffer/include/buffer_config.hpp b/core-buffer/include/buffer_config.hpp index 3507fb2..78d0ae7 100644 --- a/core-buffer/include/buffer_config.hpp +++ b/core-buffer/include/buffer_config.hpp @@ -6,6 +6,8 @@ namespace core_buffer { + const std::string BUFFER_BASE_DIR = "/gpfs/photonics/swissfel/buffer/"; + const size_t MODULE_X_SIZE = 1024; const size_t MODULE_Y_SIZE = 512; const size_t MODULE_N_PIXELS = MODULE_X_SIZE * MODULE_Y_SIZE; diff --git a/scripts/retrieve_detector_data.sh b/scripts/retrieve_detector_data.sh new file mode 100755 index 0000000..2a437a1 --- /dev/null +++ b/scripts/retrieve_detector_data.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +if [ $# != 3 ] +then + echo "Usage : $0 detector_name start_pulse_id end_pulse_id" + echo "Example : $0 JF07T32V01 11709404000 11709405000" + exit +fi + +DETECTOR=$1 +START_PULSE_ID=$2 +STOP_PULSE_ID=$3 + +#8 replay workers per core, last (writer) worker occupies 4 +coreAssociated_replay=(20 20 20 20 20 20 20 20 21 21 21 21 21 21 21 21 22 22 22 22 22 22 22 22 23 23 23 23 23 23 23 23) +coreAssociated_writer="24,25,26,27" + +#latest_file=`cat /gpfs/photonics/swissfel/buffer/JF07T32V01/M00/LATEST` +#last_pulse_id=`basename ${latest_file} | sed 's/.h5//'` +#first_pulse_id=$((${last_pulse_id}-360000)) + +#echo "First/last pulse_id : ${first_pulse_id} ${last_pulse_id}" + +touch /tmp/detector_retrieve.log + +for M in {00..31} +do + taskset -c ${coreAssociated_replay[10#${M}]} /usr/bin/sf_replay ${DETECTOR} M${M} ${M} ${START_PULSE_ID} ${STOP_PULSE_ID} >> /tmp/detector_retrieve.log & +done + +taskset -c ${coreAssociated_writer} /usr/bin/sf_writer /gpfs/photonics/swissfel/buffer/test.${START_PULSE_ID}-${STOP_PULSE_ID}.h5 ${START_PULSE_ID} ${STOP_PULSE_ID} >> /tmp/detector_retrieve.log & + +wait + diff --git a/sf-buffer/src/sf_replay.cpp b/sf-buffer/src/sf_replay.cpp index 37cda9e..50ed4ea 100644 --- a/sf-buffer/src/sf_replay.cpp +++ b/sf-buffer/src/sf_replay.cpp @@ -77,7 +77,7 @@ void sf_replay ( base_pulse_id *= core_buffer::FILE_MOD; size_t current_pulse_id = base_pulse_id; - string filename_base = device + "/" + channel_name + "/"; + string filename_base = core_buffer::BUFFER_BASE_DIR + "/" + device + "/" + channel_name + "/"; for (const auto& filename_suffix:path_suffixes) {