diff --git a/tests/benchmarks/configs/infiniband.conf b/tests/benchmarks/configs/infiniband.conf new file mode 100644 index 000000000..3a27065ac --- /dev/null +++ b/tests/benchmarks/configs/infiniband.conf @@ -0,0 +1,49 @@ +source_node = { + type = "infiniband", + + rdma_transport_mode = "${IB_MODE}", + + in = { + address = "10.0.0.2:1337", + + max_wrs = 8192, + cq_size = 8192, + + buffer_subtraction = 128 + }, + out = { + address = "10.0.0.1:1337", + resolution_timeout = 1000, + + max_wrs = 4096, + cq_size = 5000, + periodic_signalling = 4500, + + send_inline = true, + max_inline_data = 128, + + use_fallback = true + } + +}, + +target_node = { + type = "infiniband", + + rdma_transport_mode = "${IB_MODE}", + + in = { + address = "10.0.0.1:1337", + + max_wrs = 8192, + cq_size = 8192, + + buffer_subtraction = 128, + + signals = { + count = ${NUM_VALUE}, + type = "float" + } + + } +} diff --git a/tests/benchmarks/configs/loopback.conf b/tests/benchmarks/configs/loopback.conf new file mode 100644 index 000000000..98049d1ef --- /dev/null +++ b/tests/benchmarks/configs/loopback.conf @@ -0,0 +1,5 @@ +source_node = { + type = "loopback", + queuelen = 8192, + mode = "polling" +} diff --git a/tests/benchmarks/configs/nanomsg.conf b/tests/benchmarks/configs/nanomsg.conf new file mode 100644 index 000000000..5ec6d3804 --- /dev/null +++ b/tests/benchmarks/configs/nanomsg.conf @@ -0,0 +1,21 @@ +source_node = { + type = "nanomsg", + + out = { + endpoints = [ "tcp://*:12000"] + } +}, + +target_node = { + type = "nanomsg", + + in = { + signals = { + count = ${NUM_VALUE}, + type = "float" + }, + endpoints = [ + "tcp://127.0.0.1:12000" + ] + }, +} diff --git a/tests/benchmarks/configs/shmem.conf b/tests/benchmarks/configs/shmem.conf new file mode 100644 index 000000000..5d5b6e040 --- /dev/null +++ b/tests/benchmarks/configs/shmem.conf @@ -0,0 +1,34 @@ +source_node = { + type = "shmem", + queuelen = 8192, + polling = true, + vectorize = 1, + + in = { + signals = { + count = ${NUM_VALUE}, + type = "float" + } + name = "/shmem_node", + }, + + out = { + name = "/shmem_node" + }, +} + +target_node = { + type = "shmem", + + in = { + signals = { + count = ${NUM_VALUE}, + type = "float" + } + name = "/shmem_node", + }, + + out = { + name = "/shmem_node" + } +} diff --git a/tests/benchmarks/configs/zeromq.conf b/tests/benchmarks/configs/zeromq.conf new file mode 100644 index 000000000..0921831df --- /dev/null +++ b/tests/benchmarks/configs/zeromq.conf @@ -0,0 +1,24 @@ +source_node = { + type = "zeromq", + pattern = "pubsub", + ipv6 = false, + + out = { + publish = "tcp://127.0.0.1:1235", + filter = "ab184" + } +} + +target_node = { + type = "zeromq", + + in = { + signals = { + count = ${NUM_VALUE}, + type = "float" + }, + subscribe = "tcp://127.0.0.1:1235", + filter = "ab184" + } + +} diff --git a/tests/benchmarks/node-infiniband-benchmark.sh b/tests/benchmarks/node-infiniband-benchmark.sh deleted file mode 100755 index b6612e1ac..000000000 --- a/tests/benchmarks/node-infiniband-benchmark.sh +++ /dev/null @@ -1,230 +0,0 @@ -#!/bin/bash -# -# Integration Infiniband test using villas-node. -# -# @author Dennis Potter -# @copyright 2018, Institute for Automation of Complex Power Systems, EONERC -# @license GNU General Public License (version 3) -# -# VILLASnode -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -################################################################################## - -# Check if user is superuser. SU is used for namespace -if [[ "$EUID" -ne 0 ]]; then - echo "Please run as root" - exit 99 -fi - -# Check if Infiniband card is present -if [[ ! $(lspci | grep Infiniband) ]]; then - echo "Did not find any Infiniband cards in system" - exit 99 -fi - - -SCRIPT=$(realpath $0) -SCRIPTPATH=$(dirname ${SCRIPT}) -source ${SCRIPTPATH}/../../tools/integration-tests-helper.sh - - -CONFIG_FILE=$(mktemp /tmp/ib-configuration-XXXX.conf) -CONFIG_FILE_TARGET=$(mktemp /tmp/ib-configuration-target-XXXX.conf) -CONFIG_FILE_SOURCE=$(mktemp /tmp/ib-configuration-source-XXXX.conf) -INPUT_FILE=$(mktemp) -LOG_DIR=benchmarks_$(date +%Y%m%d_%H-%M-%S) -mkdir ${LOG_DIR} - -NUM_VALUES=(2 4 8 16 32 64) -RATE_SAMPLES=(10 100 1000 10000 50000) -TIME_TO_RUN=30 - -# Declare modes -MODES=("RC" "UC" "UD") - -# Initialize counter -COUNT=0 - -# Set target and source config file, which is the same for both runs -cat > ${CONFIG_FILE_TARGET} < ${CONFIG_FILE_SOURCE} < ${CONFIG_FILE} < +# @copyright 2018, Institute for Automation of Complex Power Systems, EONERC +# @license GNU General Public License (version 3) +# +# VILLASnode +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +################################################################################## + +###################################### +# SETTINGS ########################### +###################################### + +# ${NUM_VALUES}, ${RATE_SAMPLES}, and ${IB_MODES} may be a list. + +NUM_VALUES=(1) +RATE_SAMPLES=(10) +TIME_TO_RUN=5 +IB_MODES=("RC") + +###################################### +###################################### +###################################### + +# Check if user is superuser. SU is used for namespace +if [[ "$EUID" -ne 0 ]]; then + echo "Please run as root" + exit 99 +fi + +# Check whether cpuset cset command is availble +if [[ ! $(command -v cset) ]]; then + echo "Cset is not availble for root. Please install it: https://github.com/lpechacek/cpuset" + exit 99 +fi + +# Check if Infiniband card is present +if [[ ! $(lspci | grep Infiniband) ]]; then + echo "Did not find any Infiniband cards in system" + exit 99 +fi + +# Create list of configs and check whether they are valid +OIFS=$IFS; IFS=$'\n'; CONFIG_FILES=($(ls configs | sed -e "s/.conf//")); IFS=$OIFS; + +NODETYPES=() + +if [[ ! $1 ]]; then + echo "Please define for which node-type to run the script" + exit 1 +elif [[ $1 == all ]]; then + echo "Benchmarking the following nodes:" + for NODETYPE in "${CONFIG_FILES[@]}" + do + echo ${NODETYPE} + NODETYPES+=(${NODETYPE}) + done + +else + FOUND=0 + + for NODETYPE in "${CONFIG_FILES[@]}" + do + if [[ $1 == ${NODETYPE} ]]; then + NODETYPES=$1 + FOUND=1 + break + fi + done + + if [[ ${FOUND} == 0 ]]; then + echo "Please define a valid node-type for which a config file is present in ./configs!" + exit 1 + fi +fi + +###################################### +# SET PATHS ########################## +###################################### +# Set paths +SCRIPT=$(realpath $0) +SCRIPTPATH=$(dirname ${SCRIPT}) +source ${SCRIPTPATH}/../../tools/integration-tests-helper.sh + +# Declare location of config files +CONFIG=$(mktemp /tmp/nodetype-benchmark-config-XXXX.conf) +CONFIG_TARGET=$(mktemp /tmp/nodetype-benchmark-config-target-XXXX.conf) +CONFIG_SOURCE=$(mktemp /tmp/nodetype-benchmark-config-source-XXXX.conf) + +# Initialize counter +COUNT=0 + + +###################################### +# START OF LOOPS THROUGH CONFIGS ##### +###################################### + +echo ${CONFIG_FILES[0]} +echo ${CONFIG_FILES[1]} + +for NODETYPE in "${NODETYPES[@]}" +do + ###################################### + # SPECIAL CASES FOR SOME NODES ####### + ###################################### + + # Some nodes require special treatment: + # * loopback node: target_node is identical to source_node + # * infiniband node: one node must be executed in a namespace + + # loopback + if [ "${NODETYPE}" == "loopback" ]; then + TARGET_NODE='source_node' + else + TARGET_NODE='target_node' + fi + + # infiniband + if [ "${NODETYPE}" == "infiniband" ]; then + NAMESPACE_CMD='ip netns exec namespace0' + else + NAMESPACE_CMD='' + fi + + ###################################### + # CREATE PATH CONFIG FILES ########### + ###################################### + + # Set target and source config file, which is the same for both runs +cat > ${CONFIG_TARGET} < ${CONFIG_SOURCE} < ${CONFIG} <> ${CONFIG} + +cat >> ${CONFIG} <