aboutsummaryrefslogtreecommitdiffstats
path: root/case-remap
blob: daf0b9b48fc4930f447e229f2f39cdd316cd80a3 (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
#!/bin/sh

#
# Exercises functions in fremap.c of mm/
#
#
. ./hw_vars

USEMEM_REMAP=./usemem_remap

start_time=$(date +%s%N)
start_time=${start_time%???}

for i in $(seq $nr_task)
do
	create_sparse_file $SPARSE_FILE-$i $((mem / nr_task / 2))
	$USEMEM_REMAP  $SPARSE_FILE-$i $((mem / nr_task / 2)) &
done
wait

now=$(date +%s%N)
now=${now%???}
usecs=$(( now - start_time  ))

throughput=$((mem / 2 / usecs))
echo "$((mem / 2)) bytes remapped, $usecs usecs, $throughput MB/s"

rm $SPARSE_FILE-*