mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
51 lines
1.4 KiB
Bash
Executable File
51 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
export FAIRMQ_PATH=@FAIRMQ_BIN_DIR@
|
|
|
|
transport="zeromq"
|
|
|
|
if [[ $1 =~ ^[a-z]+$ ]]; then
|
|
transport=$1
|
|
fi
|
|
|
|
session="$(@CMAKE_BINARY_DIR@/fairmq/fairmq-uuid-gen -h)"
|
|
chan="data"
|
|
chanAddr=""
|
|
chanIpcFile="/tmp/fmq_$session""_""$chan""_""$transport"
|
|
if [ $transport = "ofi" ]; then
|
|
chanAddr="tcp://127.0.0.1:5656"
|
|
else
|
|
chanAddr="ipc://""$chanIpcFile"
|
|
fi
|
|
|
|
# setup a trap to kill everything if the test fails/timeouts
|
|
trap 'kill -TERM $SAMPLER_PID; kill -TERM $SINK_PID; wait $SAMPLER_PID; wait $SINK_PID; rm $chanIpcFile' TERM
|
|
|
|
SAMPLER="fairmq-ex-multipart-sampler"
|
|
SAMPLER+=" --id sampler1"
|
|
SAMPLER+=" --transport $transport"
|
|
SAMPLER+=" --verbosity veryhigh"
|
|
SAMPLER+=" --session $session"
|
|
SAMPLER+=" --shm-segment-size 100000000"
|
|
SAMPLER+=" --max-iterations 1"
|
|
SAMPLER+=" --control static --color false"
|
|
SAMPLER+=" --channel-config name=$chan,type=pair,method=connect,rateLogging=0,address=$chanAddr,linger=1000"
|
|
@CMAKE_CURRENT_BINARY_DIR@/$SAMPLER &
|
|
SAMPLER_PID=$!
|
|
|
|
SINK="fairmq-ex-multipart-sink"
|
|
SINK+=" --id sink1"
|
|
SINK+=" --transport $transport"
|
|
SINK+=" --verbosity veryhigh"
|
|
SINK+=" --session $session"
|
|
SINK+=" --shm-segment-size 100000000"
|
|
SINK+=" --control static --color false"
|
|
SINK+=" --channel-config name=$chan,type=pair,method=bind,rateLogging=0,address=$chanAddr"
|
|
@CMAKE_CURRENT_BINARY_DIR@/$SINK &
|
|
SINK_PID=$!
|
|
|
|
wait $SAMPLER_PID
|
|
wait $SINK_PID
|
|
|
|
rm $chanIpcFile
|