mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-08 22:22:04 +02:00
Merge remote-tracking branch 'origin/binary_buffer' into binary_buffer
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# != 1 ]
|
||||
then
|
||||
systemctl start JF01-buffer-worker@{00..02}
|
||||
exit
|
||||
fi
|
||||
|
||||
M=$1
|
||||
|
||||
# Add ourselves to the user cpuset.
|
||||
# echo $$ > /sys/fs/cgroup/cpuset/user/tasks
|
||||
|
||||
coreAssociatedBuffer=(12 12 12)
|
||||
|
||||
initialUDPport=50010
|
||||
port=$((${initialUDPport}+10#${M}))
|
||||
DETECTOR=JF01T03V01
|
||||
|
||||
taskset -c ${coreAssociatedBuffer[10#${M}]} /usr/bin/sf_buffer ${DETECTOR} M${M} ${port} /gpfs/photonics/swissfel/buffer/${DETECTOR} ${M}
|
||||
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=JF01 UDP2buffer worker instance as a service, instance %i
|
||||
Requires=JF01-buffer.service
|
||||
Before=JF01-buffer.service
|
||||
BindsTo=JF01-buffer.service
|
||||
|
||||
[Service]
|
||||
PermissionsStartOnly=true
|
||||
Type=idle
|
||||
User=root
|
||||
ExecStart=/usr/bin/sh /home/writer/git/sf_daq_buffer/scripts/JF01-buffer-worker.sh %i
|
||||
TimeoutStartSec=10
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=JF01-buffer.service
|
||||
@@ -1,9 +1,9 @@
|
||||
[Unit]
|
||||
Description=All replay instances of JF07
|
||||
Description=All UDP-buffer instances of JF01
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/sh /home/writer/git/sf_daq_buffer/scripts/JF07-replay-worker.sh
|
||||
ExecStart=/usr/bin/sh /home/writer/git/sf_daq_buffer/scripts/JF01-buffer-worker.sh
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=stream service (to streamvis and live analysis) of JF01
|
||||
|
||||
[Service]
|
||||
PermissionsStartOnly=true
|
||||
Type=idle
|
||||
User=root
|
||||
ExecStart=/usr/bin/sh /home/writer/git/sf_daq_buffer/scripts/JF01-stream.sh
|
||||
TimeoutStartSec=10
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
coreAssociated="24"
|
||||
|
||||
taskset -c ${coreAssociated} /usr/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF01.json
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# != 1 ]
|
||||
then
|
||||
systemctl start JF07-replay-worker@{00..32}
|
||||
exit
|
||||
fi
|
||||
|
||||
M=$1
|
||||
|
||||
#8 replay workers per core, last (stream to visualisation) worker occupies 4
|
||||
coreAssociated=(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 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}"
|
||||
|
||||
if [ ${M} == 32 ]
|
||||
then
|
||||
# taskset -c ${coreAssociated[10#${M}]} /usr/bin/sf_writer /gpfs/photonics/swissfel/buffer/test.${first_pulse_id}-${last_pulse_id}.h5 ${first_pulse_id} ${last_pulse_id}
|
||||
taskset -c ${coreAssociated[10#${M}]} /usr/bin/sf_stream tcp://129.129.241.42:9007 10 tcp://192.168.30.29:9107 30
|
||||
else
|
||||
taskset -c ${coreAssociated[10#${M}]} /usr/bin/sf_replay /gpfs/photonics/swissfel/buffer/JF07T32V01 M${M} ${M} ${first_pulse_id} ${last_pulse_id}
|
||||
fi
|
||||
@@ -1,16 +0,0 @@
|
||||
[Unit]
|
||||
Description=JF07 replay worker instance as a service, instance %i
|
||||
Requires=JF07-replay.service
|
||||
Before=JF07-replay.service
|
||||
BindsTo=JF07-replay.service
|
||||
|
||||
[Service]
|
||||
PermissionsStartOnly=true
|
||||
Type=idle
|
||||
User=root
|
||||
ExecStart=/usr/bin/sh /home/writer/git/sf_daq_buffer/scripts/JF07-replay-worker.sh %i
|
||||
TimeoutStartSec=10
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=JF07-replay.service
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# != 1 ]
|
||||
then
|
||||
systemctl start JF13-buffer-worker@00
|
||||
exit
|
||||
fi
|
||||
|
||||
M=$1
|
||||
|
||||
# Add ourselves to the user cpuset.
|
||||
# echo $$ > /sys/fs/cgroup/cpuset/user/tasks
|
||||
|
||||
coreAssociatedBuffer=(13)
|
||||
|
||||
initialUDPport=50190
|
||||
port=$((${initialUDPport}+10#${M}))
|
||||
DETECTOR=JF13T01V01
|
||||
|
||||
taskset -c ${coreAssociatedBuffer[10#${M}]} /usr/bin/sf_buffer ${DETECTOR} M${M} ${port} /gpfs/photonics/swissfel/buffer/${DETECTOR} ${M}
|
||||
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=JF13 UDP2buffer worker instance as a service, instance %i
|
||||
Requires=JF13-buffer.service
|
||||
Before=JF13-buffer.service
|
||||
BindsTo=JF13-buffer.service
|
||||
|
||||
[Service]
|
||||
PermissionsStartOnly=true
|
||||
Type=idle
|
||||
User=root
|
||||
ExecStart=/usr/bin/sh /home/writer/git/sf_daq_buffer/scripts/JF13-buffer-worker.sh %i
|
||||
TimeoutStartSec=10
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=JF13-buffer.service
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=All UDP-buffer instances of JF13
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/sh /home/writer/git/sf_daq_buffer/scripts/JF13-buffer-worker.sh
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=stream service (to streamvis and live analysis) of JF13
|
||||
|
||||
[Service]
|
||||
PermissionsStartOnly=true
|
||||
Type=idle
|
||||
User=root
|
||||
ExecStart=/usr/bin/sh /home/writer/git/sf_daq_buffer/scripts/JF13-stream.sh
|
||||
TimeoutStartSec=10
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
coreAssociated="25"
|
||||
|
||||
taskset -c ${coreAssociated} /usr/bin/sf_stream /gpfs/photonics/swissfel/buffer/config/stream-JF13.json
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
hours=5
|
||||
threshold=80
|
||||
|
||||
if [ $# = 1 ]
|
||||
then
|
||||
threshold=$1
|
||||
fi
|
||||
if [ $# = 2 ]
|
||||
then
|
||||
hours=$2
|
||||
fi
|
||||
|
||||
df -h | grep BUFFER > /dev/null
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
# BUFFER is not present
|
||||
exit
|
||||
fi
|
||||
|
||||
occupancy=`df -h /gpfs/photonics/swissfel/buffer | grep BUFFER | awk '{print $5}' | sed 's/%//'`
|
||||
if [ ${occupancy} -lt ${threshold} ]
|
||||
then
|
||||
# echo OK, not action
|
||||
exit
|
||||
fi
|
||||
|
||||
#find /gpfs/photonics/swissfel/buffer/JF* -type f -mmin +$((${hours}*60)) -delete
|
||||
find /gpfs/photonics/swissfel/buffer/JF*/M* -type d -mmin +$((${hours}*60)) -delete
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo "Usage : $0 DETECTOR_NAME <number_of_cycles>"
|
||||
echo " DETECTOR_NAME: JF07 or JF01..."
|
||||
echo " number_of_cycles : optional, default 100"
|
||||
exit
|
||||
fi
|
||||
|
||||
DETECTOR=$1
|
||||
case ${DETECTOR} in
|
||||
'JF01')
|
||||
D=1
|
||||
;;
|
||||
'JF07')
|
||||
D=7
|
||||
;;
|
||||
'JF13')
|
||||
D=13
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported detector"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
||||
n_cycles=100
|
||||
if [ $# == 2 ]
|
||||
then
|
||||
n_cycles=$2
|
||||
fi
|
||||
|
||||
export PATH=/home/dbe/miniconda3/bin:$PATH
|
||||
source deactivate
|
||||
source activate dia
|
||||
|
||||
sls_detector_put ${D}-timing trigger
|
||||
sls_detector_put ${D}-cycles ${n_cycles}
|
||||
sls_detector_put ${D}-exptime 5e-06
|
||||
sls_detector_put ${D}-frames 1
|
||||
sls_detector_put ${D}-dr 16
|
||||
#sls_detector_put ${D}-clearbit to 0x5d 0 # normal mode, not highG0
|
||||
sls_detector_put ${D}-status start
|
||||
|
||||
echo "Now start trigger"
|
||||
@@ -140,7 +140,7 @@ int main (int argc, char *argv[])
|
||||
header.AddMember("pedestal_file", pedestal_file, header_alloc);
|
||||
|
||||
rapidjson::Value gain_file;
|
||||
gain_file.SetString(PEDE_FILENAME.c_str(), header_alloc);
|
||||
gain_file.SetString(GAIN_FILENAME.c_str(), header_alloc);
|
||||
header.AddMember("gain_file", gain_file, header_alloc);
|
||||
|
||||
header.AddMember("number_frames_expected", 10000, header_alloc);
|
||||
@@ -170,7 +170,7 @@ int main (int argc, char *argv[])
|
||||
}
|
||||
if ( send_streamvis == 0 ) {
|
||||
auto& shape = header["shape"];
|
||||
shape[0] = 16384;
|
||||
shape[0] = n_modules*512;
|
||||
shape[1] = 1024;
|
||||
} else{
|
||||
auto& shape = header["shape"];
|
||||
@@ -210,7 +210,7 @@ int main (int argc, char *argv[])
|
||||
}
|
||||
if ( send_live_analysis == 0 ) {
|
||||
auto& shape = header["shape"];
|
||||
shape[0] = 16384;
|
||||
shape[0] = n_modules*512;
|
||||
shape[1] = 1024;
|
||||
} else{
|
||||
auto& shape = header["shape"];
|
||||
|
||||
Reference in New Issue
Block a user