#!/bin/bash binary=./release/benchmarks/basic preload="LD_PRELOAD=~bachelet/local/kephren/lib64/libstdc++.so.6" repeat=20 outdir="rtbenchmarks/data_basic" [ -x "${binary}" ] || exit 1 run() { coreset=$1 size=$2 method=$3 sample=$4 ncores=$5 prefix="${size}:${method}:${sample}:${ncores}" for i in $(seq ${repeat}); do t=$(eval "${preload} taskset -c ${coreset} ${binary} ${size} ${method} ${sample} ${ncores}"|cut -d' ' -f2) echo "${prefix}:${t}" done } benchSeq() { sizes=(100 1000 10000 100000 1000000 10000000) coreset=0 sample=0 # seq ncores=1 echo "---- benchSeq ----" for method in seq omp gen_omp gen_thread; do echo "==== ${method}" for size in ${sizes[@]}; do run "${coreset}" "${size}" "${method}" "${sample}" "${ncores}" done|tee "${outdir}/rt_seq_${method}" done } benchCores() { cores=(1 2 4 6 8 10 12 14 16 18) size=10000000 sample=1 # par echo "---- benchCores ----" for method in omp gen_omp gen_thread; do echo "==== ${method}" for ncores in ${cores[@]}; do maxcore=$((ncores*4 - 1)) coreset="$(seq -s, 0 4 ${maxcore})" run "${coreset}" "${size}" "${method}" "${sample}" "${ncores}" done|tee "${outdir}/rt_cores_${method}" done } benchSize() { sizes=(100 1000 10000 100000 1000000 10000000) ncores=$1 maxcore=$((ncores*4 - 1)) coreset="$(seq -s, 0 4 ${maxcores})" sample=1 # par echo "---- benchSize (ncores: ${ncores}) ----" for method in seq omp gen_omp gen_thread; do echo "==== ${method}" for size in ${sizes[@]}; do run "${coreset}" "${size}" "${method}" "${sample}" "${ncores}" done|tee "${outdir}/rt_size_${ncores}_${method}" done } eval "$*"