summaryrefslogtreecommitdiffstats
path: root/tests/roof.sh
blob: 3e977388da48efb1104d78c62687b0a0257dfbb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#! /bin/bash

. config.sh

function pyroof {
#    numactl --cpunodebind=1 
    LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib$arch" GI_TYPELIB_PATH="/usr/local/lib$arch/girepository-1.0/" \
	python3 roof.py "$@"
#	numactl --cpunodebind=1 python3 roof.py "$@"
}

if [[ "$0" =~ roof-vma ]]; then
  function roof {
    bufs=800000
    bufs=$((bufs * 4))

    ulimit -l unlimited
    echo 1000000000 > /proc/sys/kernel/shmmax	        # 18446744073692774399
    echo 8000 > /proc/sys/vm/nr_hugepages		# 0


    tuned-adm profile latency-performance
    cpupower frequency-set --governor performance # powersave
    echo 100000000 > /proc/sys/kernel/sched_min_granularity_ns # 3000000
    echo 50000000 > /proc/sys/kernel/sched_migration_cost_ns # 500000
    echo 0 > /proc/sys/kernel/numa_balancing # 1

    echo 0 > /proc/sys/vm/swappiness
    sysctl -w vm.swappiness=0
    sysctl -w vm.zone_reclaim_mode=0
    echo never > /sys/kernel/mm/transparent_hugepage/enabled

    #VMA_SPEC=latency  VMA_INTERNAL_THREAD_AFFINITY=1
    VMA_THREAD_MODE=3 VMA_MTU=0 VMA_RX_POLL=10 VMA_SELECT_POLL=10 VMA_RING_ALLOCATION_LOGIC_RX=20 VMA_MEM_ALLOC_TYPE=2 VMA_RX_BUFS=$bufs VMA_CQ_AIM_INTERRUPTS_RATE_PER_SEC=1000 LD_PRELOAD=$vma_lib \
    pyroof "$@"
  }
else 
  function roof {
    pyroof "$@"
  }
fi

#cat roof.yaml | sed '/simulation/,$d' | yq . > roof.json
#cat roof.yaml | yq r - -j | jq '' | sed -r '/\[$/ {:a;N;s/\]/&/;Ta;s/\n +//g;s/,(.)/, \1/}' > roof.json
#This is real
#cat roof.yaml | python3 yaml2json.py | sed -r '/\[$/ {:a;N;s/\]/&/;Ta;s/\n +//g;s/,(.)/, \1/}' > roof.json

roof "$@"