-
Notifications
You must be signed in to change notification settings - Fork 0
/
Notes
57 lines (34 loc) · 1.09 KB
/
Notes
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
1. Run the code with default opt and -O3, extracted the results. Pretty decent.
/* local machine */
g++ Euler_2D.C -o Euler_2D
end Time = 285.167
g++ -O3 Euler_2D.C -o Euler_2D
end Time = 15.0675
/* cluster single */
mpicc -fopenmp -std=gnu++11 -o Euler_2D Euler_2D.C
end Time = 22.93
mpicc -fopenmp -std=gnu++11 -O3 -o Euler_2D Euler_2D.C
end Time = 25.02
3. OpenMP to the rescue
First take was to parallelize outer loops with
#pragma omp parallel for:
and run for different number of cores:
2:
4:
8:
16:
32:
Also, care to check diffs.
4) #pragma omp parallel for collapse(2)
2. I copied the codebase into a new file named dissasembled in order to analyze the code flow without actual math.
For that reason, I replaced all operations and results with the value "1.0".
/* local machine */
g++ Dissasembled.C -o Dissasembled
end Time = 0.112293
g++ -O3 Dissasembled.C -o Dissasembled
end Time = 0.008381
/* cluster single */
mpicc -fopenmp -std=gnu++11 -o Dissasembled Dissasembled.C
end Time = 0
mpicc -fopenmp -std=gnu++11 -O3 -o Dissasembled Dissasembled.C
end Time = 0