#!/bin/bash if [ -e @SIMPATH@/bin/fairmq-shmmonitor ]; then @SIMPATH@/bin/fairmq-shmmonitor --cleanup fi if [ $# -ge 1 ]; then _nbmoni=$1 ((_pubfreqts = $_nbmoni*100 )) _pubminsec=1.0 _pubmaxsec=10.0 if [ $# -ge 4 ]; then _filename="" _dirname="" _hostname=$4 if [ $# -ge 5 ]; then _pubfreqts=$5 if [ $# -ge 6 ]; then _pubminsec=$6 if [ $# -ge 7 ]; then _pubmaxsec=$7 fi fi fi elif [ $# -ge 2 ]; then _filename=$2 _hostname="" if [ $# -eq 3 ]; then _dirname=$3 else _dirname="" fi else echo 'Starting connection to local stream' echo ' for other usages, please supply at least a filename.' echo 'Possible usages are:' echo 'startMQSamplerTofMonitor2020.sh' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> <full filename pattern list>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> <filename pattern> <folder_path>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s> <Max Hist pub. in s>' _filename="" _dirname="" _hostname="localhost" fi else echo 'Starting connection to local stream with 1 monitor process' echo ' for other usages, please supply at least a filename.' echo 'Possible usages are:' echo 'startMQSamplerTofMonitor2020.sh' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> <full filename pattern list>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> <filename pattern> <folder_path>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s>' echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s> <Max Hist pub. in s>' _filename="" _dirname="" _hostname="localhost" _nbmoni=1 _pubfreqts=100 _pubminsec=1.0 _pubmaxsec=10.0 fi _paramfile=@VMCWORKDIR@/macro/beamtime/mcbm2020/mTofPar.par SAMPLER="MultiTsaSampler" SAMPLER+=" --id sampler1" SAMPLER+=" --max-timeslices 0" SAMPLER+=" --severity info" #SAMPLER+=" --flib-port 10" if [ "$_hostname" != "" ]; then SAMPLER+=" --flib-host $_hostname" elif [ "$_filename" != "" ]; then SAMPLER+=" --filename $_filename" if [ "$_dirname" != "" ]; then SAMPLER+=" --dirname $_dirname" fi fi SAMPLER+=" --high-water-mark 1000" #SAMPLER+=" --no-split-ts 1" SAMPLER+=" --send-ts-per-channel 1" SAMPLER+=" --sysid-chan 0x60:tofcomponent" SAMPLER+=" --sysid-chan 0x90:tofcomponent" SAMPLER+=" --channel-config name=tofcomponent,type=push,method=bind,address=tcp://127.0.0.1:11555" #SAMPLER+=" --transport shmem" SAMPLER+=" --transport zeromq" #SAMPLER+=" --transport nanomsg" xterm -l -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER & _iMoni=0 ((_oubfreqts = $_nbmoni*100 )) while (( _iMoni < _nbmoni )); do (( _yOffset=100*_iMoni )) (( _iMoni += 1 )) MONITOR="TofMonitorMcbm2018" MONITOR+=" --id mon$_iMoni" MONITOR+=" --severity info" # MONITOR+=" --DebugMoni 1" MONITOR+=" --PubFreqTs $_pubfreqts" MONITOR+=" --PubTimeMin $_pubminsec" MONITOR+=" --PubTimeMax $_pubmaxsec" MONITOR+=" --channel-config name=tofcomponent,type=pull,method=connect,address=tcp://127.0.0.1:11555" #MONITOR+=" --transport shmem" MONITOR+=" --transport zeromq" #MONITOR+=" --transport nanomsg" MONITOR+=" --channel-config name=parameters,type=req,method=connect,transport=zeromq,address=tcp://127.0.0.1:11005,rateLogging=0" MONITOR+=" --channel-config name=histogram-in,type=pub,method=connect,transport=zeromq,address=tcp://127.0.0.1:11666" MONITOR+=" --channel-config name=histo-conf,type=pub,method=connect,transport=zeromq,address=tcp://127.0.0.1:11667" MONITOR+=" --channel-config name=canvas-conf,type=pub,method=connect,transport=zeromq,address=tcp://127.0.0.1:11668" xterm -l -geometry 80x23+500+$_yOffset -hold -e @CMAKE_BINARY_DIR@/bin/MQ/monitor/$MONITOR & done PARAMETERSERVER="parmq-server" PARAMETERSERVER+=" --id parmq-server" PARAMETERSERVER+=" --severity info" PARAMETERSERVER+=" --channel-name parameters" PARAMETERSERVER+=" --channel-config name=parameters,type=rep,method=bind,transport=zeromq,address=tcp://127.0.0.1:11005,rateLogging=0" PARAMETERSERVER+=" --first-input-name $_paramfile" PARAMETERSERVER+=" --first-input-type ASCII" PARAMETERSERVER+=" --libs-to-load=libCbmFlibMcbm2018" # doesn't work due to runtime problem xterm -geometry 80x23+1000+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/parmq/$PARAMETERSERVER & HISTSERVER="MqHistoServer" HISTSERVER+=" --id server1" HISTSERVER+=" --channel-config name=histogram-in,type=sub,method=bind,transport=zeromq,address=tcp://127.0.0.1:11666" HISTSERVER+=" --channel-config name=histo-conf,type=sub,method=bind,transport=zeromq,address=tcp://127.0.0.1:11667" HISTSERVER+=" --channel-config name=canvas-conf,type=sub,method=bind,transport=zeromq,address=tcp://127.0.0.1:11668" xterm -geometry 80x23+1500+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/histogramServer/$HISTSERVER &