aboutsummaryrefslogtreecommitdiffstats
path: root/case-swap-w-seq
blob: cf68990fb659abd97ab49ce55627b26aee3e3f3d (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
#!/bin/sh

. ./hw_vars

if [ "$SwapTotal" -eq 0 ]; then
	echo "No swap space. Please setup swap before running $0" >&2
	exit 1
fi

[ -n "$unit_size" ] || unit_size=$(( ((MemAvailable + SwapTotal) << 10) * 3 / 4))

testcase=$(basename $0)
if [ "${testcase%-mt}" != "$testcase" ]; then
	multi_task_option="-t"
else
	multi_task_option="-n"
fi

if [ "${testcase#*-rand}" != "$testcase" ]; then
	rand_seq_option="--random"
else
	rand_seq_option=""
fi

$USEMEM $multi_task_option $nr_task $rand_seq_option $((unit_size / nr_task))