-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.sh
98 lines (75 loc) · 1.86 KB
/
script.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
#!/bin/bash
# Description : Compile and run all the variations of the algorithm witn the same inputs.
echo ""
echo "-------->The script starts<-----"
echo ""
#Compile the code.
gcc -o reference reference.c
gcc -o jam jam.c
gcc -o unroll unroll.c
gcc -o SSE SSE.c -msse4.2
gcc -pthread SSE_pthreads.c -o SSE_pthreads -msse4.2
mpicc -pthread SSE_Mpthreads.c -o SSE_Mpthreads -msse4.2 -lm
gcc -o bonus bonus.c -msse4.2
echo "------------>Reference<-------------"
#Run the code.
echo ""
echo "------------>Reference execution<-------------"
echo ""
./reference '10000000'
echo ""
echo "------------>Jam execution<-------------"
echo ""
echo ""
./jam '10000000'
echo ""
echo ""
echo "------------>Unroll execution<-------------"
echo ""
./unroll '10000000'
echo ""
echo ""
echo "------------>SSE executions.<-------------"
echo ""
./SSE '10000000'
echo ""
echo ""
echo "------------>SSE executions + Pthread<-------------"
echo "------------->2 threads<-------------"
echo ""
./SSE_pthreads '10000000' '2'
echo ""
echo "-------------> 4 threads<-------------"
echo ""
./SSE_pthreads '10000000' '4'
lamboot -v host
echo ""
echo "------------->SSE executions + Pthread + MPI<-------------"
echo "------------> 2 threads 2 procs<------------"
echo ""
mpiexec -n 2 ./SSE_Mpthreads '10000000' '2'
echo ""
echo ""
echo '------------> 2 threads 4 procs<------------'
echo ""
mpiexec -n 4 ./SSE_Mpthreads '10000000' '2'
echo ""
echo ""
echo '------------> 4 threads 2 procs<------------'
echo ""
mpiexec -n 2 ./SSE_Mpthreads '10000000' '4'
echo ""
echo ""
echo "------------>4 threads 4 procs<------------"
echo ""
mpiexec -n 4 ./SSE_Mpthreads '10000000' '4'
echo ""
echo "-------------> Bonus <-------------"
echo "-----------------------------------"
./bonus '10000000'
echo ""
echo ""
echo "-------->The script ends<-----"
echo ""
lamhalt
#Shutdown the LAM/MPI run-time environment.