summaryrefslogtreecommitdiffstats
path: root/fig10_experiments.sh
blob: 5d4823589f0d4ddd6653e00c7e7b64355c373eb4 (plain) (blame)
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
#!/bin/bash
# Needs sudo to drop caches between CPU paging experiments
if [ $# -eq 0 ]; then
    echo "Usage: $0 <number of sampling iterations>"
    exit
fi

if [ "$EUID" != 0 ]; then
    sudo "$0" "$@"
    exit $?
fi

iters=$1

echo "Running GPU paging experiments..."
gpu_times=$(date +"%b%d-%H")-gpu-times.tsv
echo "# Generated by './fig10_experiments.sh' with $iters iters" > $gpu_times
# GPU paging needs to be run as a non-root user
for ((i = 1; i <= $iters; i++)); do sudo -u ae ./gpu_paging_speed | tr -cd '[[:digit:]]\t\n' | sed "/\t$/d"; done >> $gpu_times

echo "Done. Running direct I/O experiments..."
directio_times=$(date +"%b%d-%H")-directio-times.tsv
./directio_paging_speed $iters > $directio_times

echo "Done. Running demand paging experiments..."
demand_paging_times=$(date +"%b%d-%H")-demand-paging-times.tsv
./demand_paging_speed $iters > $demand_paging_times

echo "Done! Results are saved in $gpu_times, $directio_times, and $demand_paging_times"