-
Notifications
You must be signed in to change notification settings - Fork 0
/
HW3.txt
119 lines (107 loc) · 3.17 KB
/
HW3.txt
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
In this repository I've implemented parallel Gauss-Seidel and Jacobi methods in
OpenMP. I give times for computing u over 25 updates with a million grid points
for a variety of thread counts ranging from 2 up 64.
I ran these computations on Stampede a few times. Both methods performed
similarly, and we see that two threads takes about twice as much time as four
threads, which takes roughly twice as much time as 8. 12 has a slightly
noticeable improvement over 8 threads. However with 16 threads the elapsed time
jumps to roughly 0.2 seconds which is much larger (about two times) than the
time for just 2 threads. 24, 32, 48 and 64 threads all show improvements
but are comparable or worse than the times for 12 and 8 threads. I was puzzled
to see this but perhaps it's because the threads run all on one node with 16
cores and perhaps these cores become overworked with multiple threads?I tried
seeing what would happen on my Courant computer with 8 cores but didn't observe
any big jump similar to this one.
The OpenMP bugs are also located in this repository with a brief description of
the bug and the fix at the top of each file.
On 1000000 grid points:
Computing u with Gauss-Seidel on 2 threads.
Gauss-Seidel:
residual = 1414.203014
iterations = 25
elapsed time = 0.089481
Computing u with Jacobi on 2 threads.
Jacobi:
residual = 999.994830
iterations = 25
elapsed time = 0.073668
Computing u with Gauss-Seidel on 4 threads.
Gauss-Seidel:
residual = 1414.203014
iterations = 25
elapsed time = 0.044638
Computing u with Jacobi on 4 threads.
Jacobi:
residual = 999.994830
iterations = 25
elapsed time = 0.037135
Computing u with Gauss-Seidel on 8 threads.
Gauss-Seidel:
residual = 1414.203014
iterations = 25
elapsed time = 0.022571
Computing u with Jacobi on 8 threads.
Jacobi:
residual = 999.994830
iterations = 25
elapsed time = 0.018993
Computing u with Gauss-Seidel on 12 threads.
Gauss-Seidel:
residual = 1414.203014
iterations = 25
elapsed time = 0.015247
Computing u with Jacobi on 12 threads.
Jacobi:
residual = 999.994830
iterations = 25
elapsed time = 0.013227
Computing u with Gauss-Seidel on 16 threads.
Gauss-Seidel:
residual = 1414.203014
iterations = 25
elapsed time = 0.180694
Computing u with Jacobi on 16 threads.
Jacobi:
residual = 999.994830
iterations = 25
elapsed time = 0.169310
Computing u with Gauss-Seidel on 24 threads.
Gauss-Seidel:
residual = 1414.203014
iterations = 25
elapsed time = 0.105234
Computing u with Jacobi on 24 threads.
Jacobi:
residual = 999.994830
iterations = 25
elapsed time = 0.102058
Computing u with Gauss-Seidel on 32 threads.
Gauss-Seidel:
residual = 1414.203014
iterations = 25
elapsed time = 0.104340
Computing u with Jacobi on 32 threads.
Jacobi:
residual = 999.994830
iterations = 25
elapsed time = 0.025151
Computing u with Gauss-Seidel on 48 threads.
Gauss-Seidel:
residual = 1414.203014
iterations = 25
elapsed time = 0.030422
Computing u with Jacobi on 48 threads.
Jacobi:
residual = 999.994830
iterations = 25
elapsed time = 0.018547
Computing u with Gauss-Seidel on 64 threads.
Gauss-Seidel:
residual = 1414.203014
iterations = 25
elapsed time = 0.020243
Computing u with Jacobi on 64 threads.
Jacobi:
residual = 999.994830
iterations = 25
elapsed time = 0.025296