summaryrefslogtreecommitdiffstats
path: root/run_all_casestudies.sh
blob: e15518d67b4b3968ea31947ec244f41b5c80b5ef (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash

# run this with sudo

casestudies=("12" "20" "21" "30" "31" "32") #("10" "11" "12" "20" "21" "30" "31" "32")
# for 1.5 inflation:
periods=(129 69 90 126 164 189) #(86 104 129 69 90 126 164 189) #ms

# for 1.1 inflation:
# periods=(63 76 95 51 67 93 121 140)

iterations=10000
iteration_safety_margin=20

safety_wait_secs=5

sudo /home/ae/liblitmus/setsched P-FP
sudo /home/ae/liblitmus/showsched


if ! cat /proc/litmus/stats | grep -q 'real-time tasks   = 0'; then
  echo "ERROR: NOT ALL TASKS OUT OF SYSTEM."
fi

for i in ${!casestudies[@]}; do
  echo "------RELEASING sched-${casestudies[i]}------"
  stderr_name=deadline_misses_sched-${casestudies[i]}_${iterations}
  echo "stderr file goes to ${stderr_name}"
  sudo python3 run_case_study_dag.py sched-${casestudies[i]} 1 ${stderr_name}
  sleep $safety_wait_secs
  sudo /home/ae/liblitmus/release_ts

  if cat /proc/litmus/stats | grep -q 'real-time tasks   = 0'; then
    echo "ERROR: problem releasing tasks."
  fi
  sleep_dur=$(( ($iterations+$iteration_safety_margin)*${periods[i]}/1000+$safety_wait_secs ))
  echo "sleeping for $sleep_dur s..."
  sleep $sleep_dur
  while ! cat /proc/litmus/stats | grep -q 'real-time tasks   = 0'; do
    sleep_dur=$(( ($iteration_safety_margin)*${periods[i]}/1000+$safety_wait_secs ))
    echo "sleeping for $sleep_dur s..."
    sleep $sleep_dur
  done

  if cat ${stderr_name} | grep -q 'tardy'; then
    echo "**********************DEADLINE MISS**********************"
  fi
done
echo "printing deadline misses:"
cat ${stderr_name}
echo "-------------------------"