diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/config.sh | 15 | ||||
-rw-r--r-- | tests/roof.json | 7 | ||||
-rw-r--r-- | tests/roof.py | 33 | ||||
-rwxr-xr-x | tests/roof.sh | 16 | ||||
-rw-r--r-- | tests/roof.yaml | 11 | ||||
-rw-r--r-- | tests/test_file.sh | 10 | ||||
-rwxr-xr-x | tests/vma-analyze.sh | 35 |
7 files changed, 105 insertions, 22 deletions
diff --git a/tests/config.sh b/tests/config.sh new file mode 100644 index 0000000..c1c656b --- /dev/null +++ b/tests/config.sh @@ -0,0 +1,15 @@ +uname -r | grep el7 &> /dev/null +el7=$(($? == 0)) + +ods_path=/mnt/ands/ods/bin-fedora/ +vma_path=/mnt/ands/ +vma_lib_path=/mnt/ands/lib64-fedora/ + +[ $el7 -eq 1 ] && ods_path="${ods_path/fedora/centos}" +[ $el7 -eq 1 ] && vma_lib_path="${vma_lib_path/fedora/centos}" + +# Standard library +vma_lib=${vma_lib_path}/libvma.so.8.6.10 + +# With Mellanox OFED extensions (./configure --enable-socketxtreme) +#vma_lib=${vma_lib_path}/mlx/libvma.so.8.6.10 diff --git a/tests/roof.json b/tests/roof.json index 0dcd1e7..784fb6d 100644 --- a/tests/roof.json +++ b/tests/roof.json @@ -3,17 +3,14 @@ "protocol": "udp", "port": 4000, "streams": 16, + "header_size": 10, "payload_size": 1280, "dataset_size": 1024000 }, "performance": { - "buffer_size": 2, + "buffer_size": 10, "packets_at_once": 100 }, - "simulation": { - "first_file_number": 1, - "path": "/mnt/fast/ROOF2/roof2-data.pumpe256/meas/data_pumpe_dyn_192.168.100_%02u.dat" - }, "setup": { "planes": 2, "modules": 16, diff --git a/tests/roof.py b/tests/roof.py index 2138931..a859069 100644 --- a/tests/roof.py +++ b/tests/roof.py @@ -1,8 +1,9 @@ import gi import sys import json -import gobject +import argparse +gi.require_version('Ufo', '0.0') from gi.repository import Ufo from gi.repository import GObject @@ -16,24 +17,40 @@ class RoofConfig: self.streams = cfg["network"]["streams"] elif cfg.get("setup", {}).get("modules") != None: self.streams = cfg["setup"]["modules"] - + + config = "roof.json" -cfg = RoofConfig(config) +output = None + +parser = argparse.ArgumentParser() +parser.add_argument('-c', '--config', dest="config", default="roof.json", help="ROOF configuration (JSON)") +parser.add_argument('-o', '--output', dest="output", default=None, help="Output file") +parser.add_argument('-n', '--number', dest="number", default=None, help="Specify number of frames to capture") +args = parser.parse_args() + + +cfg = RoofConfig(args.config) pm = Ufo.PluginManager() graph = Ufo.TaskGraph() scheduler = Ufo.Scheduler() +if args.output is None: + print ("Starting ROOF using NULL writter") + write = pm.get_task('null') + if args.number is None: args.number = 0 +else: + print ("Starting ROOF streaming to {}".format(args.output)) + write = pm.get_task('write') + write.set_properties(filename=args.output) + if args.number is None: args.number = 5 build = pm.get_task('roof-build') -build.set_properties(config=config, number=0) - -write = pm.get_task('write') -write.set_properties(filename="test.raw") +build.set_properties(config=args.config, number=args.number) for id in range(cfg.streams): read = pm.get_task('roof-read') - read.set_properties(config=config, id=id) + read.set_properties(config=args.config, id=id) graph.connect_nodes(read, build) build.bind_property('stop', read, 'stop', GObject.BindingFlags.DEFAULT) diff --git a/tests/roof.sh b/tests/roof.sh index d0ec30a..df51679 100755 --- a/tests/roof.sh +++ b/tests/roof.sh @@ -1,3 +1,17 @@ +#! /bin/bash + +. config.sh + +bufs=800000 +bufs=$((bufs * 4)) + cat roof.yaml | yq . > roof.json -GI_TYPELIB_PATH="/usr/local/lib64/girepository-1.0/" python roof.py +ulimit -l unlimited +echo 1000000000 > /proc/sys/kernel/shmmax # 18446744073692774399 +echo 8000 > /proc/sys/vm/nr_hugepages # 0 + + +#VMA_THREAD_MODE=3 VMA_MTU=0 VMA_RX_POLL=0 VMA_SELECT_POLL=0 VMA_RING_ALLOCATION_LOGIC_RX=20 VMA_RX_BUFS=$bufs LD_PRELOAD=$vma_lib \ + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib64" GI_TYPELIB_PATH="/usr/local/lib64/girepository-1.0/" \ + python roof.py "$@" diff --git a/tests/roof.yaml b/tests/roof.yaml index a49d53b..2a24d08 100644 --- a/tests/roof.yaml +++ b/tests/roof.yaml @@ -2,16 +2,17 @@ network: protocol: udp port: 4000 streams: 16 -# header_size: 0 + header_size: 10 payload_size: 1280 # max_packet_size: 1284 dataset_size: 1024000 performance: - buffer_size: 2 + buffer_size: 10 +# drop_buffers: 0 packets_at_once: 100 -simulation: - first_file_number: 1 - path: "/mnt/fast/ROOF2/roof2-data.pumpe256/meas/data_pumpe_dyn_192.168.100_%02u.dat" +#simulation: +# first_file_number: 1 +# path: "/mnt/fast/ROOF2/roof2-data.pumpe256/meas/data_pumpe_dyn_192.168.100_%02u.dat" setup: planes: 2 modules: 16 diff --git a/tests/test_file.sh b/tests/test_file.sh index 5f47e45..1eb29ca 100644 --- a/tests/test_file.sh +++ b/tests/test_file.sh @@ -1,11 +1,15 @@ #! /bin/bash +shopt -s extglob + packet_size=1280 packets_per_dataset=50 +rm -f roof_test.raw for packet in $(seq 0 24); do - for id in $(seq 0 15); do - name=$(ls *$id.dat | grep -P "_0?$id.dat") - dd if=$name of="roof_test.raw" bs=$packet_size count=$packets_per_dataset skip=$((packet * $packets_per_dataset)) oflag=append conv=notrunc + for id in $(seq 1 16); do + name=$(ls -- *$id.@(fx|dat) | grep -P "_0?$id\.\w+") + echo "Appending packet $packet from $name " + dd if=$name of="roof_test.raw" bs=$packet_size count=$packets_per_dataset skip=$((packet * $packets_per_dataset)) oflag=append conv=notrunc status=none done done diff --git a/tests/vma-analyze.sh b/tests/vma-analyze.sh new file mode 100755 index 0000000..7000922 --- /dev/null +++ b/tests/vma-analyze.sh @@ -0,0 +1,35 @@ +#! /bin/bash + +sleep=1 + +# This doesn't work properly... Something is wrong with counters... + +path=/mnt/ands/bin/vma_stats_mlx +#-z seems ignored +#$path -p $(pidof onlineDetectorSimulatorServer) -c 1 -z &> /dev/null +stats1=($($path -p $(pidof python) -c 1 | grep Rx | awk '{ print $3, $4 }')) +sleep $sleep +stats2=($($path -p $(pidof python) -c 1 | grep Rx | awk '{ print $3, $4 }')) + +pksum=0 +bwsum=0 +for i in "${!stats2[@]}"; do + if [ -n "$stats1" ]; then + diff=$(bc <<< "(${stats2[$i]} - ${stats1[$i]}) / $sleep") + else + diff=$(bc <<< "${stats2[$i]} / $sleep") + fi + + if [ $((i & 1)) -eq 0 ]; then + echo -n "Queue: " + printf "packets: %9.3f kpps" $(bc -l <<< "1. * $diff / 1000") + pksum=$(($pksum + diff)) + else + printf ", bandwidth: %9.3f Gb/s\n" $(bc -l <<< "8. * $diff / 1024 / 1024") + bwsum=$(($bwsum + diff)) + fi +done + +echo -n "Total: " +printf "packets: %9.3f kpps" $(bc -l <<< "1. * $pksum / 1000") +printf ", bandwidth: %9.3f Gb/s\n" $(bc -l <<< "8. * $bwsum / 1024 / 1024") |