-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdo_atomic.sh
63 lines (54 loc) · 1.88 KB
/
do_atomic.sh
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
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash -e
run_n_times(){
number=$1
shift
for n in $(seq $number); do
$@
sleep 2
done
}
# rm -f test_gpu.log
# rm -f test_cpu.log
# rm ./data/atomic_contension.csv
# rm ./data/atomic_uncontension.csv
# export GMPT_THREAD_NUM=4096
# export GMPT_LOOP_COUNT=400000000
# export GMPT_MODE=0
# export GMPT_ATOMIC_TYPE=0
export RUN_TIMES=5
# for n in $(seq 10); do
# echo $GMPT_THREAD_NUM
# run_n_times $RUN_TIMES ./build/thread "--gtest_filter=Atomics.AtomicGPU" >> test_gpu.log
# run_n_times $RUN_TIMES ./build/thread "--gtest_filter=Atomics.AtomicCPU" >> test_cpu.log
# export GMPT_THREAD_NUM=`expr $GMPT_THREAD_NUM / 2`
# done
# export GMPT_THREAD_NUM=4096
# export GMPT_LOOP_COUNT=400000000
# export GMPT_MODE=0
# export GMPT_ATOMIC_TYPE=1
# for n in $(seq 10); do
# echo $GMPT_THREAD_NUM
# run_n_times $RUN_TIMES ./build/thread "--gtest_filter=Atomics.AtomicGPU" >> test_gpu.log
# run_n_times $RUN_TIMES ./build/thread "--gtest_filter=Atomics.AtomicCPU" >> test_cpu.log
# export GMPT_THREAD_NUM=`expr $GMPT_THREAD_NUM / 2`
# done
# export GMPT_THREAD_NUM=4096
# export GMPT_LOOP_COUNT=400000000
# export GMPT_MODE=1
# export GMPT_ATOMIC_TYPE=1
# for n in $(seq 10); do
# echo $GMPT_THREAD_NUM
# run_n_times $RUN_TIMES ./build/thread "--gtest_filter=Atomics.AtomicGPU" >> test_gpu.log
# run_n_times $RUN_TIMES ./build/thread "--gtest_filter=Atomics.AtomicCPU" >> test_cpu.log
# export GMPT_THREAD_NUM=`expr $GMPT_THREAD_NUM / 2`
# done
export GMPT_THREAD_NUM=256
export GMPT_LOOP_COUNT=150000000
export GMPT_MODE=1
export GMPT_ATOMIC_TYPE=0
for n in $(seq 6); do
echo $GMPT_THREAD_NUM
run_n_times $RUN_TIMES ./build/thread "--gtest_filter=Atomics.AtomicGPU" >> test_gpu.log
run_n_times $RUN_TIMES ./build/thread "--gtest_filter=Atomics.AtomicCPU" >> test_cpu.log
export GMPT_THREAD_NUM=`expr $GMPT_THREAD_NUM / 2`
done