#! /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 "$@"