| 1 |
<h1>Results</h1> |
| 2 |
|
| 3 |
When you run the program using the following command |
| 4 |
@code |
| 5 |
mpirun -np 16 ./step-50 gmg_mf_2d.prm |
| 6 |
@endcode |
| 7 |
the screen output should look like the following: |
| 8 |
@code |
| 9 |
Cycle 0: |
| 10 |
Number of active cells: 12 (2 global levels) |
| 11 |
Partition efficiency: 0.1875 |
| 12 |
Number of degrees of freedom: 65 (by level: 21, 65) |
| 13 |
Number of CG iterations: 10 |
| 14 |
Global error estimate: 0.355373 |
| 15 |
Wrote solution_00.pvtu |
| 16 |
|
| 17 |
|
| 18 |
+---------------------------------------------+------------+------------+ |
| 19 |
| Total wallclock time elapsed since start | 0.0163s | | |
| 20 |
| | | | |
| 21 |
| Section | no. calls | wall time | % of total | |
| 22 |
+---------------------------------+-----------+------------+------------+ |
| 23 |
| Assemble right-hand side | 1 | 0.000374s | 2.3% | |
| 24 |
| Estimate | 1 | 0.000724s | 4.4% | |
| 25 |
| Output results | 1 | 0.00277s | 17% | |
| 26 |
| Setup | 1 | 0.00225s | 14% | |
| 27 |
| Setup multigrid | 1 | 0.00181s | 11% | |
| 28 |
| Solve | 1 | 0.00364s | 22% | |
| 29 |
| Solve: 1 multigrid V-cycle | 1 | 0.000354s | 2.2% | |
| 30 |
| Solve: CG | 1 | 0.00151s | 9.3% | |
| 31 |
| Solve: Preconditioner setup | 1 | 0.00125s | 7.7% | |
| 32 |
+---------------------------------+-----------+------------+------------+ |
| 33 |
|
| 34 |
Cycle 1: |
| 35 |
Number of active cells: 24 (3 global levels) |
| 36 |
Partition efficiency: 0.276786 |
| 37 |
Number of degrees of freedom: 139 (by level: 21, 65, 99) |
| 38 |
Number of CG iterations: 10 |
| 39 |
Global error estimate: 0.216726 |
| 40 |
Wrote solution_01.pvtu |
| 41 |
|
| 42 |
|
| 43 |
+---------------------------------------------+------------+------------+ |
| 44 |
| Total wallclock time elapsed since start | 0.0169s | | |
| 45 |
| | | | |
| 46 |
| Section | no. calls | wall time | % of total | |
| 47 |
+---------------------------------+-----------+------------+------------+ |
| 48 |
| Assemble right-hand side | 1 | 0.000309s | 1.8% | |
| 49 |
| Estimate | 1 | 0.00156s | 9.2% | |
| 50 |
| Output results | 1 | 0.00222s | 13% | |
| 51 |
| Refine grid | 1 | 0.00278s | 16% | |
| 52 |
| Setup | 1 | 0.00196s | 12% | |
| 53 |
| Setup multigrid | 1 | 0.0023s | 14% | |
| 54 |
| Solve | 1 | 0.00565s | 33% | |
| 55 |
| Solve: 1 multigrid V-cycle | 1 | 0.000349s | 2.1% | |
| 56 |
| Solve: CG | 1 | 0.00285s | 17% | |
| 57 |
| Solve: Preconditioner setup | 1 | 0.00195s | 12% | |
| 58 |
+---------------------------------+-----------+------------+------------+ |
| 59 |
|
| 60 |
Cycle 2: |
| 61 |
Number of active cells: 51 (4 global levels) |
| 62 |
Partition efficiency: 0.41875 |
| 63 |
Number of degrees of freedom: 245 (by level: 21, 65, 225, 25) |
| 64 |
Number of CG iterations: 11 |
| 65 |
Global error estimate: 0.112098 |
| 66 |
Wrote solution_02.pvtu |
| 67 |
|
| 68 |
|
| 69 |
+---------------------------------------------+------------+------------+ |
| 70 |
| Total wallclock time elapsed since start | 0.0183s | | |
| 71 |
| | | | |
| 72 |
| Section | no. calls | wall time | % of total | |
| 73 |
+---------------------------------+-----------+------------+------------+ |
| 74 |
| Assemble right-hand side | 1 | 0.000274s | 1.5% | |
| 75 |
| Estimate | 1 | 0.00127s | 6.9% | |
| 76 |
| Output results | 1 | 0.00227s | 12% | |
| 77 |
| Refine grid | 1 | 0.0024s | 13% | |
| 78 |
| Setup | 1 | 0.00191s | 10% | |
| 79 |
| Setup multigrid | 1 | 0.00295s | 16% | |
| 80 |
| Solve | 1 | 0.00702s | 38% | |
| 81 |
| Solve: 1 multigrid V-cycle | 1 | 0.000398s | 2.2% | |
| 82 |
| Solve: CG | 1 | 0.00376s | 21% | |
| 83 |
| Solve: Preconditioner setup | 1 | 0.00238s | 13% | |
| 84 |
+---------------------------------+-----------+------------+------------+ |
| 85 |
. |
| 86 |
. |
| 87 |
. |
| 88 |
@endcode |
| 89 |
Here, the timing of the `solve()` function is split up in 3 parts: setting |
| 90 |
up the multigrid preconditioner, execution of a single multigrid V-cycle, and |
| 91 |
the CG solver. The V-cycle that is timed is unnecessary for the overall solve |
| 92 |
and only meant to give an insight at the different costs for AMG and GMG. |
| 93 |
Also it should be noted that when using the AMG solver, "Workload imbalance" |
| 94 |
is not included in the output since the hierarchy of coarse meshes is not |
| 95 |
required. |
| 96 |
|
| 97 |
All results in this section are gathered on Intel Xeon Platinum 8280 (Cascade |
| 98 |
Lake) nodes which have 56 cores and 192GB per node and support AVX-512 instructions, |
| 99 |
allowing for vectorization over 8 doubles (vectorization used only in the matrix-free |
| 100 |
computations). The code is compiled using gcc 7.1.0 with intel-mpi 17.0.3. Trilinos |
| 101 |
12.10.1 is used for the matrix-based GMG/AMG computations. |
| 102 |
|
| 103 |
We can then gather a variety of information by calling the program |
| 104 |
with the input files that are provided in the directory in which |
| 105 |
step-50 is located. Using these, and adjusting the number of mesh |
| 106 |
refinement steps, we can produce information about how well the |
| 107 |
program scales. |
| 108 |
|
| 109 |
The following table gives weak scaling timings for this program on up to 256M DoFs |
| 110 |
and 7,168 processors. (Recall that weak scaling keeps the number of |
| 111 |
degrees of freedom per processor constant while increasing the number of |
| 112 |
processors; i.e., it considers larger and larger problems.) |
| 113 |
Here, $\mathbb{E}$ is the partition efficiency from the |
| 114 |
introduction (also equal to 1.0/workload imbalance), "Setup" is a combination |
| 115 |
of setup, setup multigrid, assemble, and assemble multigrid from the timing blocks, |
| 116 |
and "Prec" is the preconditioner setup. Ideally all times would stay constant |
| 117 |
over each problem size for the individual solvers, but since the partition |
| 118 |
efficiency decreases from 0.371 to 0.161 from largest to smallest problem size, |
| 119 |
we expect to see an approximately $0.371/0.161=2.3$ times increase in timings |
| 120 |
for GMG. This is, in fact, pretty close to what we really get: |
| 121 |
|
| 122 |
<table align="center" class="doxtable"> |
| 123 |
<tr> |
| 124 |
<th colspan="4"></th> |
| 125 |
<th></th> |
| 126 |
<th colspan="4">MF-GMG</th> |
| 127 |
<th></th> |
| 128 |
<th colspan="4">MB-GMG</th> |
| 129 |
<th></th> |
| 130 |
<th colspan="4">AMG</th> |
| 131 |
</tr> |
| 132 |
<tr> |
| 133 |
<th align="right">Procs</th> |
| 134 |
<th align="right">Cycle</th> |
| 135 |
<th align="right">DoFs</th> |
| 136 |
<th align="right">$\mathbb{E}$</th> |
| 137 |
<th></th> |
| 138 |
<th align="right">Setup</th> |
| 139 |
<th align="right">Prec</th> |
| 140 |
<th align="right">Solve</th> |
| 141 |
<th align="right">Total</th> |
| 142 |
<th></th> |
| 143 |
<th align="right">Setup</th> |
| 144 |
<th align="right">Prec</th> |
| 145 |
<th align="right">Solve</th> |
| 146 |
<th align="right">Total</th> |
| 147 |
<th></th> |
| 148 |
<th align="right">Setup</th> |
| 149 |
<th align="right">Prec</th> |
| 150 |
<th align="right">Solve</th> |
| 151 |
<th align="right">Total</th> |
| 152 |
</tr> |
| 153 |
<tr> |
| 154 |
<td align="right">112</th> |
| 155 |
<td align="right">13</th> |
| 156 |
<td align="right">4M</th> |
| 157 |
<td align="right">0.37</th> |
| 158 |
<td></td> |
| 159 |
<td align="right">0.742</th> |
| 160 |
<td align="right">0.393</th> |
| 161 |
<td align="right">0.200</th> |
| 162 |
<td align="right">1.335</th> |
| 163 |
<td></td> |
| 164 |
<td align="right">1.714</th> |
| 165 |
<td align="right">2.934</th> |
| 166 |
<td align="right">0.716</th> |
| 167 |
<td align="right">5.364</th> |
| 168 |
<td></td> |
| 169 |
<td align="right">1.544</th> |
| 170 |
<td align="right">0.456</th> |
| 171 |
<td align="right">1.150</th> |
| 172 |
<td align="right">3.150</th> |
| 173 |
</tr> |
| 174 |
<tr> |
| 175 |
<td align="right">448</th> |
| 176 |
<td align="right">15</th> |
| 177 |
<td align="right">16M</th> |
| 178 |
<td align="right">0.29</th> |
| 179 |
<td></td> |
| 180 |
<td align="right">0.884</th> |
| 181 |
<td align="right">0.535</th> |
| 182 |
<td align="right">0.253</th> |
| 183 |
<td align="right">1.672</th> |
| 184 |
<td></td> |
| 185 |
<td align="right">1.927</th> |
| 186 |
<td align="right">3.776</th> |
| 187 |
<td align="right">1.190</th> |
| 188 |
<td align="right">6.893</th> |
| 189 |
<td></td> |
| 190 |
<td align="right">1.544</th> |
| 191 |
<td align="right">0.456</th> |
| 192 |
<td align="right">1.150</th> |
| 193 |
<td align="right">3.150</th> |
| 194 |
</tr> |
| 195 |
<tr> |
| 196 |
<td align="right">1,792</th> |
| 197 |
<td align="right">17</th> |
| 198 |
<td align="right">65M</th> |
| 199 |
<td align="right">0.22</th> |
| 200 |
<td></td> |
| 201 |
<td align="right">1.122</th> |
| 202 |
<td align="right">0.686</th> |
| 203 |
<td align="right">0.309</th> |
| 204 |
<td align="right">2.117</th> |
| 205 |
<td></td> |
| 206 |
<td align="right">2.171</th> |
| 207 |
<td align="right">4.862</th> |
| 208 |
<td align="right">1.660</th> |
| 209 |
<td align="right">8.693</th> |
| 210 |
<td></td> |
| 211 |
<td align="right">1.654</th> |
| 212 |
<td align="right">0.546</th> |
| 213 |
<td align="right">1.460</th> |
| 214 |
<td align="right">3.660</th> |
| 215 |
</tr> |
| 216 |
<tr> |
| 217 |
<td align="right">7,168</th> |
| 218 |
<td align="right">19</th> |
| 219 |
<td align="right">256M</th> |
| 220 |
<td align="right">0.16</th> |
| 221 |
<td></td> |
| 222 |
<td align="right">1.214</th> |
| 223 |
<td align="right">0.893</th> |
| 224 |
<td align="right">0.521</th> |
| 225 |
<td align="right">2.628</th> |
| 226 |
<td></td> |
| 227 |
<td align="right">2.386</th> |
| 228 |
<td align="right">7.260</th> |
| 229 |
<td align="right">2.560</th> |
| 230 |
<td align="right">12.206</th> |
| 231 |
<td></td> |
| 232 |
<td align="right">1.844</th> |
| 233 |
<td align="right">1.010</th> |
| 234 |
<td align="right">1.890</th> |
| 235 |
<td align="right">4.744</th> |
| 236 |
</tr> |
| 237 |
</table> |
| 238 |
|
| 239 |
On the other hand, the algebraic multigrid in the last set of columns |
| 240 |
is relatively unaffected by the increasing imbalance of the mesh |
| 241 |
hierarchy (because it doesn't use the mesh hierarchy) and the growth |
| 242 |
in time is rather driven by other factors that are well documented in |
| 243 |
the literature (most notably that the algorithmic complexity of |
| 244 |
some parts of algebraic multigrid methods appears to be ${\cal O}(N |
| 245 |
\log N)$ instead of ${\cal O}(N)$ for geometric multigrid). |
| 246 |
|
| 247 |
The upshort of the table above is that the matrix-free geometric multigrid |
| 248 |
method appears to be the fastest approach to solving this equation if |
| 249 |
not by a huge margin. Matrix-based methods, on the other hand, are |
| 250 |
consistently the worst. |
| 251 |
|
| 252 |
The following figure provides strong scaling results for each method, i.e., |
| 253 |
we solve the same problem on more and more processors. Specifically, |
| 254 |
we consider the problems after 16 mesh refinement cycles |
| 255 |
(32M DoFs) and 19 cycles (256M DoFs), on between 56 to 28,672 processors: |
| 256 |
|
| 257 |
<img width="600px" src="https://www.dealii.org/images/steps/developer/step-50-strong-scaling.png" alt=""> |
| 258 |
|
| 259 |
While the matrix-based GMG solver and AMG scale similarly and have a |
| 260 |
similar time to solution (at least as long as there is a substantial |
| 261 |
number of unknowns per processor -- say, several 10,000), the |
| 262 |
matrix-free GMG solver scales much better and solves the finer problem |
| 263 |
in roughly the same time as the AMG solver for the coarser mesh with |
| 264 |
only an eighth of the number of processors. Conversely, it can solve the |
| 265 |
same problem on the same number of processors in about one eighth the |
| 266 |
time. |
| 267 |
|
| 268 |
|
| 269 |
<h3> Possibilities for extensions </h3> |
| 270 |
|
| 271 |
<h4> Testing convergence and higher order elements </h4> |
| 272 |
|
| 273 |
The finite element degree is currently hard-coded as 2, see the template |
| 274 |
arguments of the main class. It is easy to change. To test, it would be |
| 275 |
interesting to switch to a test problem with a reference solution. This way, |
| 276 |
you can compare error rates. |
| 277 |
|
| 278 |
<h4> Coarse solver </h4> |
| 279 |
|
| 280 |
A more interesting example would involve a more complicated coarse mesh (see |
| 281 |
step-49 for inspiration). The issue in that case is that the coarsest |
| 282 |
level of the mesh hierarchy is actually quite large, and one would |
| 283 |
have to think about ways to solve the coarse level problem |
| 284 |
efficiently. (This is not an issue for algebraic multigrid methods |
| 285 |
because they would just continue to build coarser and coarser levels |
| 286 |
of the matrix, regardless of their geometric origin.) |
| 287 |
|
| 288 |
In the program here, we simply solve the coarse level problem with a |
| 289 |
Conjugate Gradient method without any preconditioner. That is acceptable |
| 290 |
if the coarse problem is really small -- for example, if the coarse |
| 291 |
mesh had a single cell, then the coarse mesh problems has a $9\times 9$ |
| 292 |
matrix in 2d, and a $27\times 27$ matrix in 3d; for the coarse mesh we |
| 293 |
use on the $L$-shaped domain of the current program, these sizes are |
| 294 |
$21\times 21$ in 2d and $117\times 117$ in 3d. But if the coarse mesh |
| 295 |
consists of hundreds or thousands of cells, this approach will no |
| 296 |
longer work and might start to dominate the overall run-time of each V-cycle. |
| 297 |
A common approach is then to solve the coarse mesh problem using an |
| 298 |
algebraic multigrid preconditioner; this would then, however, require |
| 299 |
assembling the coarse matrix (even for the matrix-free version) as |
| 300 |
input to the AMG implementation. |