-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatJob.pbs
330 lines (304 loc) · 13.3 KB
/
matJob.pbs
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
#!/bin/bash
#PBS -N matJob
#PBS -o ./matInfo.out
#PBS -e ./matErr.err
#PBS -q short_cpuQ
#PBS -l walltime=0:03:00
#PBS -l select=1:ncpus=64:ompthreads=64:mem=200mb
cd /home/username/dir # attention this line must be changed
module load gcc91
g++() {
g++-9.1.0 "$@"
}
g++ --version
hostname
lscpu
# build and logs directory creation
if [ -d "build" ]; then
rm -r build
rm -r logs
fi
mkdir build
mkdir logs
# compile code for n = 16
g++ -o build/execSer16 src/parallel.cpp -DSERIAL -fopenmp
g++ -o build/execImpV1_16 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV1\" -O2
g++ -o build/execImpV2_16 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV2\" -O2 -ftree-loop-if-convert -ftree-loop-distribution -floop-interchange -ftree-vectorize -fvect-cost-model=unlimited -funroll-loops -march=native -ffast-math -mprefer-vector-width=512 -fprefetch-loop-arrays
g++ -o build/execImpBlock_16 src/parallel.cpp -DIMPLICIT -DBLOCK -DFILE_NAME=\"implicitBlock\" -O2
g++ -o build/execOmp_16 src/parallel.cpp -DOMP -DFILE_NAME=\"omp\" -fopenmp
g++ -o build/execOmpBlock_16 src/parallel.cpp -DOMP -DBLOCK -DFILE_NAME=\"ompBlock\" -fopenmp
# compile code for n = 32
g++ -o build/execSer32 src/parallel.cpp -DSERIAL -DN_SIZE=32 -fopenmp
g++ -o build/execImpV1_32 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV1\" -DN_SIZE=32 -O2
g++ -o build/execImpV2_32 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV2\" -DN_SIZE=32 -O2 -ftree-loop-if-convert -ftree-loop-distribution -floop-interchange -ftree-vectorize -fvect-cost-model=unlimited -funroll-loops -march=native -ffast-math -mprefer-vector-width=512 -fprefetch-loop-arrays
g++ -o build/execImpBlock_32 src/parallel.cpp -DIMPLICIT -DBLOCK -DFILE_NAME=\"implicitBlock\" -DN_SIZE=32 -O2
g++ -o build/execOmp_32 src/parallel.cpp -DOMP -DFILE_NAME=\"omp\" -DN_SIZE=32 -fopenmp
g++ -o build/execOmpBlock_32 src/parallel.cpp -DOMP -DBLOCK -DFILE_NAME=\"ompBlock\" -DN_SIZE=32 -fopenmp
# compile code for n = 64
g++ -o build/execSer64 src/parallel.cpp -DSERIAL -DN_SIZE=64 -fopenmp
g++ -o build/execImpV1_64 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV1\" -DN_SIZE=64 -O2
g++ -o build/execImpV2_64 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV2\" -DN_SIZE=64 -O2 -ftree-loop-if-convert -ftree-loop-distribution -floop-interchange -ftree-vectorize -fvect-cost-model=unlimited -funroll-loops -march=native -ffast-math -mprefer-vector-width=512 -fprefetch-loop-arrays
g++ -o build/execImpBlock_64 src/parallel.cpp -DIMPLICIT -DBLOCK -DFILE_NAME=\"implicitBlock\" -DN_SIZE=64 -O2
g++ -o build/execOmp_64 src/parallel.cpp -DOMP -DFILE_NAME=\"omp\" -DN_SIZE=64 -fopenmp
g++ -o build/execOmpBlock_64 src/parallel.cpp -DOMP -DBLOCK -DFILE_NAME=\"ompBlock\" -DN_SIZE=64 -fopenmp
# compile code for n = 128
g++ -o build/execSer128 src/parallel.cpp -DSERIAL -DN_SIZE=128 -fopenmp
g++ -o build/execImpV1_128 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV1\" -DN_SIZE=128 -O2
g++ -o build/execImpV2_128 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV2\" -DN_SIZE=128 -O2 -ftree-loop-if-convert -ftree-loop-distribution -floop-interchange -ftree-vectorize -fvect-cost-model=unlimited -funroll-loops -march=native -ffast-math -mprefer-vector-width=512 -fprefetch-loop-arrays
g++ -o build/execImpBlock_128 src/parallel.cpp -DIMPLICIT -DBLOCK -DFILE_NAME=\"implicitBlock\" -DN_SIZE=128 -O2
g++ -o build/execOmp_128 src/parallel.cpp -DOMP -DFILE_NAME=\"omp\" -DN_SIZE=128 -fopenmp
g++ -o build/execOmpBlock_128 src/parallel.cpp -DOMP -DBLOCK -DFILE_NAME=\"ompBlock\" -DN_SIZE=128 -fopenmp
# compile code for n = 256
g++ -o build/execSer256 src/parallel.cpp -DSERIAL -DN_SIZE=256 -fopenmp
g++ -o build/execImpV1_256 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV1\" -DN_SIZE=256 -O2
g++ -o build/execImpV2_256 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV2\" -DN_SIZE=256 -O2 -ftree-loop-if-convert -ftree-loop-distribution -floop-interchange -ftree-vectorize -fvect-cost-model=unlimited -funroll-loops -march=native -ffast-math -mprefer-vector-width=512 -fprefetch-loop-arrays
g++ -o build/execImpBlock_256 src/parallel.cpp -DIMPLICIT -DBLOCK -DFILE_NAME=\"implicitBlock\" -DN_SIZE=256 -O2
g++ -o build/execOmp_256 src/parallel.cpp -DOMP -DFILE_NAME=\"omp\" -DN_SIZE=256 -fopenmp
g++ -o build/execOmpBlock_256 src/parallel.cpp -DOMP -DBLOCK -DFILE_NAME=\"ompBlock\" -DN_SIZE=256 -fopenmp
# compile code for n = 512
g++ -o build/execSer512 src/parallel.cpp -DSERIAL -DN_SIZE=512 -fopenmp
g++ -o build/execImpV1_512 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV1\" -DN_SIZE=512 -O2
g++ -o build/execImpV2_512 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV2\" -DN_SIZE=512 -O2 -ftree-loop-if-convert -ftree-loop-distribution -floop-interchange -ftree-vectorize -fvect-cost-model=unlimited -funroll-loops -march=native -ffast-math -mprefer-vector-width=512 -fprefetch-loop-arrays
g++ -o build/execImpBlock_512 src/parallel.cpp -DIMPLICIT -DBLOCK -DFILE_NAME=\"implicitBlock\" -DN_SIZE=512 -O2
g++ -o build/execOmp_512 src/parallel.cpp -DOMP -DFILE_NAME=\"omp\" -DN_SIZE=512 -fopenmp
g++ -o build/execOmpBlock_512 src/parallel.cpp -DOMP -DBLOCK -DFILE_NAME=\"ompBlock\" -DN_SIZE=512 -fopenmp
# compile code for n = 1024
g++ -o build/execSer1024 src/parallel.cpp -DSERIAL -DN_SIZE=1024 -fopenmp
g++ -o build/execImpV1_1024 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV1\" -DN_SIZE=1024 -O2
g++ -o build/execImpV2_1024 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV2\" -DN_SIZE=1024 -O2 -ftree-loop-if-convert -ftree-loop-distribution -floop-interchange -ftree-vectorize -fvect-cost-model=unlimited -funroll-loops -march=native -ffast-math -mprefer-vector-width=512 -fprefetch-loop-arrays
g++ -o build/execImpBlock_1024 src/parallel.cpp -DIMPLICIT -DBLOCK -DFILE_NAME=\"implicitBlock\" -DN_SIZE=1024 -O2
g++ -o build/execOmp_1024 src/parallel.cpp -DOMP -DFILE_NAME=\"omp\" -DN_SIZE=1024 -fopenmp
g++ -o build/execOmpBlock_1024 src/parallel.cpp -DOMP -DBLOCK -DFILE_NAME=\"ompBlock\" -DN_SIZE=1024 -fopenmp
# compile code for n = 2048
g++ -o build/execSer2048 src/parallel.cpp -DSERIAL -DN_SIZE=2048 -fopenmp
g++ -o build/execImpV1_2048 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV1\" -DN_SIZE=2048 -O2
g++ -o build/execImpV2_2048 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV2\" -DN_SIZE=2048 -O2 -ftree-loop-if-convert -ftree-loop-distribution -floop-interchange -ftree-vectorize -fvect-cost-model=unlimited -funroll-loops -march=native -ffast-math -mprefer-vector-width=512 -fprefetch-loop-arrays
g++ -o build/execImpBlock_2048 src/parallel.cpp -DIMPLICIT -DBLOCK -DFILE_NAME=\"implicitBlock\" -DN_SIZE=2048 -O2
g++ -o build/execOmp_2048 src/parallel.cpp -DOMP -DFILE_NAME=\"omp\" -DN_SIZE=2048 -fopenmp
g++ -o build/execOmpBlock_2048 src/parallel.cpp -DOMP -DBLOCK -DFILE_NAME=\"ompBlock\" -DN_SIZE=2048 -fopenmp
# compile code for n = 4096
g++ -o build/execSer4096 src/parallel.cpp -DSERIAL -DN_SIZE=4096 -fopenmp
g++ -o build/execImpV1_4096 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV1\" -DN_SIZE=4096 -O2
g++ -o build/execImpV2_4096 src/parallel.cpp -DIMPLICIT -DFILE_NAME=\"implicitV2\" -DN_SIZE=4096 -O2 -ftree-loop-if-convert -ftree-loop-distribution -floop-interchange -ftree-vectorize -fvect-cost-model=unlimited -funroll-loops -march=native -ffast-math -mprefer-vector-width=512 -fprefetch-loop-arrays
g++ -o build/execImpBlock_4096 src/parallel.cpp -DIMPLICIT -DBLOCK -DFILE_NAME=\"implicitBlock\" -DN_SIZE=4096 -O2
g++ -o build/execOmp_4096 src/parallel.cpp -DOMP -DFILE_NAME=\"omp\" -DN_SIZE=4096 -fopenmp
g++ -o build/execOmpBlock_4096 src/parallel.cpp -DOMP -DBLOCK -DFILE_NAME=\"ompBlock\" -DN_SIZE=4096 -fopenmp
for i in {1..3}
do
# run code for n = 16
export OMP_NUM_THREADS=1
./build/execSer16
./build/execImpV1_16
./build/execImpV2_16
./build/execImpBlock_16
export OMP_NUM_THREADS=2
./build/execOmp_16
./build/execOmpBlock_16
export OMP_NUM_THREADS=4
./build/execOmp_16
./build/execOmpBlock_16
export OMP_NUM_THREADS=8
./build/execOmp_16
./build/execOmpBlock_16
export OMP_NUM_THREADS=16
./build/execOmp_16
./build/execOmpBlock_16
export OMP_NUM_THREADS=32
./build/execOmp_16
./build/execOmpBlock_16
export OMP_NUM_THREADS=64
./build/execOmp_16
./build/execOmpBlock_16
# run code for n = 32
export OMP_NUM_THREADS=1
./build/execSer32
./build/execImpV1_32
./build/execImpV2_32
./build/execImpBlock_32
export OMP_NUM_THREADS=2
./build/execOmp_32
./build/execOmpBlock_32
export OMP_NUM_THREADS=4
./build/execOmp_32
./build/execOmpBlock_32
export OMP_NUM_THREADS=8
./build/execOmp_32
./build/execOmpBlock_32
export OMP_NUM_THREADS=16
./build/execOmp_32
./build/execOmpBlock_32
export OMP_NUM_THREADS=32
./build/execOmp_32
./build/execOmpBlock_32
export OMP_NUM_THREADS=64
./build/execOmp_32
./build/execOmpBlock_32
# run code for n = 64
export OMP_NUM_THREADS=1
./build/execSer64
./build/execImpV1_64
./build/execImpV2_64
./build/execImpBlock_64
export OMP_NUM_THREADS=2
./build/execOmp_64
./build/execOmpBlock_64
export OMP_NUM_THREADS=4
./build/execOmp_64
./build/execOmpBlock_64
export OMP_NUM_THREADS=8
./build/execOmp_64
./build/execOmpBlock_64
export OMP_NUM_THREADS=16
./build/execOmp_64
./build/execOmpBlock_64
export OMP_NUM_THREADS=32
./build/execOmp_64
./build/execOmpBlock_64
export OMP_NUM_THREADS=64
./build/execOmp_64
./build/execOmpBlock_64
# run code for n = 128
export OMP_NUM_THREADS=1
./build/execSer128
./build/execImpV1_128
./build/execImpV2_128
./build/execImpBlock_128
export OMP_NUM_THREADS=2
./build/execOmp_128
./build/execOmpBlock_128
export OMP_NUM_THREADS=4
./build/execOmp_128
./build/execOmpBlock_128
export OMP_NUM_THREADS=8
./build/execOmp_128
./build/execOmpBlock_128
export OMP_NUM_THREADS=16
./build/execOmp_128
./build/execOmpBlock_128
export OMP_NUM_THREADS=32
./build/execOmp_128
./build/execOmpBlock_128
export OMP_NUM_THREADS=64
./build/execOmp_128
./build/execOmpBlock_128
# run code for n = 256
export OMP_NUM_THREADS=1
./build/execSer256
./build/execImpV1_256
./build/execImpV2_256
./build/execImpBlock_256
export OMP_NUM_THREADS=2
./build/execOmp_256
./build/execOmpBlock_256
export OMP_NUM_THREADS=4
./build/execOmp_256
./build/execOmpBlock_256
export OMP_NUM_THREADS=8
./build/execOmp_256
./build/execOmpBlock_256
export OMP_NUM_THREADS=16
./build/execOmp_256
./build/execOmpBlock_256
export OMP_NUM_THREADS=32
./build/execOmp_256
./build/execOmpBlock_256
export OMP_NUM_THREADS=64
./build/execOmp_256
./build/execOmpBlock_256
# run code for n = 512
export OMP_NUM_THREADS=1
./build/execSer512
./build/execImpV1_512
./build/execImpV2_512
./build/execImpBlock_512
export OMP_NUM_THREADS=2
./build/execOmp_512
./build/execOmpBlock_512
export OMP_NUM_THREADS=4
./build/execOmp_512
./build/execOmpBlock_512
export OMP_NUM_THREADS=8
./build/execOmp_512
./build/execOmpBlock_512
export OMP_NUM_THREADS=16
./build/execOmp_512
./build/execOmpBlock_512
export OMP_NUM_THREADS=32
./build/execOmp_512
./build/execOmpBlock_512
export OMP_NUM_THREADS=64
./build/execOmp_512
./build/execOmpBlock_512
# run code for n = 1024
export OMP_NUM_THREADS=1
./build/execSer1024
./build/execImpV1_1024
./build/execImpV2_1024
./build/execImpBlock_1024
export OMP_NUM_THREADS=2
./build/execOmp_1024
./build/execOmpBlock_1024
export OMP_NUM_THREADS=4
./build/execOmp_1024
./build/execOmpBlock_1024
export OMP_NUM_THREADS=8
./build/execOmp_1024
./build/execOmpBlock_1024
export OMP_NUM_THREADS=16
./build/execOmp_1024
./build/execOmpBlock_1024
export OMP_NUM_THREADS=32
./build/execOmp_1024
./build/execOmpBlock_1024
export OMP_NUM_THREADS=64
./build/execOmp_1024
./build/execOmpBlock_1024
# run code for n = 2048
export OMP_NUM_THREADS=1
./build/execSer2048
./build/execImpV1_2048
./build/execImpV2_2048
./build/execImpBlock_2048
export OMP_NUM_THREADS=2
./build/execOmp_2048
./build/execOmpBlock_2048
export OMP_NUM_THREADS=4
./build/execOmp_2048
./build/execOmpBlock_2048
export OMP_NUM_THREADS=8
./build/execOmp_2048
./build/execOmpBlock_2048
export OMP_NUM_THREADS=16
./build/execOmp_2048
./build/execOmpBlock_2048
export OMP_NUM_THREADS=32
./build/execOmp_2048
./build/execOmpBlock_2048
export OMP_NUM_THREADS=64
./build/execOmp_2048
./build/execOmpBlock_2048
# run code for n = 4096
export OMP_NUM_THREADS=1
./build/execSer4096
./build/execImpV1_4096
./build/execImpV2_4096
./build/execImpBlock_4096
export OMP_NUM_THREADS=2
./build/execOmp_4096
./build/execOmpBlock_4096
export OMP_NUM_THREADS=4
./build/execOmp_4096
./build/execOmpBlock_4096
export OMP_NUM_THREADS=8
./build/execOmp_4096
./build/execOmpBlock_4096
export OMP_NUM_THREADS=16
./build/execOmp_4096
./build/execOmpBlock_4096
export OMP_NUM_THREADS=32
./build/execOmp_4096
./build/execOmpBlock_4096
export OMP_NUM_THREADS=64
./build/execOmp_4096
./build/execOmpBlock_4096
done