-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscriptv.sh
104 lines (79 loc) · 2.27 KB
/
scriptv.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
# Description : Compile and run all the variations of the algorithm witn the same inputs.
#### Find relative directory
echo $0
full_path=$(realpath $0)
dir_path=$(dirname $full_path)
######
echo ""
echo "-------->The script starts<-----"
echo ""
#Compile the code.
gcc -o $dir_path/reference/reference $dir_path/reference/reference.c
gcc -o $dir_path/SSE/jam $dir_path/SSE/jam.c
gcc -o $dir_path/SSE/unroll $dir_path/SSE/unroll.c
gcc -o $dir_path/SSE/SSE $dir_path/SSE/SSE.c -msse4.2
gcc -pthread $dir_path/pthreads/SSE_pthreads.c -o $dir_path/pthreads/SSE_pthreads -msse4.2
mpicc -pthread $dir_path/MPI/SSE_Mpthreads.c -o $dir_path/MPI/SSE_Mpthreads -msse4.2 -lm
gcc -o $dir_path/bonus/bonus $dir_path/bonus/bonus.c -msse4.2
#Run the code.
echo ""
echo "------------>Reference execution<-------------"
echo ""
$dir_path/reference/reference '10000000'
echo ""
echo "------------>Jam execution<-------------"
echo ""
echo ""
$dir_path/SSE/jam '10000000'
echo ""
echo ""
echo "------------>Unroll execution<-------------"
echo ""
$dir_path/SSE/unroll '10000000'
echo ""
echo ""
echo "------------>SSE executions.<-------------"
echo ""
$dir_path/SSE/SSE '10000000'
echo ""
echo ""
echo "------------>SSE executions + Pthread<-------------"
echo "------------->2 threads<-------------"
echo ""
$dir_path/pthreads/SSE_pthreads '10000000' '2'
echo ""
echo "-------------> 4 threads<-------------"
echo ""
$dir_path/pthreads/SSE_pthreads '10000000' '4'
lamboot
echo ""
echo "------------->SSE executions + Pthread + MPI<-------------"
echo "------------> 2 threads 2 procs<------------"
echo ""
mpiexec -n 2 $dir_path/MPI/SSE_Mpthreads '10000000' '2'
echo ""
echo ""
echo '------------> 2 threads 4 procs<------------'
echo ""
mpiexec -n 4 $dir_path/MPI/SSE_Mpthreads '10000000' '2'
echo ""
echo ""
echo '------------> 4 threads 2 procs<------------'
echo ""
mpiexec -n 2 $dir_path/MPI/SSE_Mpthreads '10000000' '4'
echo ""
echo ""
echo "------------>4 threads 4 procs<------------"
echo ""
mpiexec -n 4 $dir_path/MPI/SSE_Mpthreads '10000000' '4'
echo ""
echo "-------------> Bonus <-------------"
echo "-----------------------------------"
$dir_path/bonus/bonus '10000000'
echo ""
echo ""
echo "-------->The script ends<-----"
echo ""
lamhalt
#Shutdown the LAM/MPI run-time environment.