# Efficient and Scalable Initialization of Partitioned Coupled Simulations with preCICE
## 4 Performance Results
### Performance Analysis
#### 4.3.2 Weak Scaling  
To further analyze the performance of the new initialization scheme, including memory efficiency, we present weak scalability measurements in this section. Table 3 specifies the distribution of compute cores among the solvers A and B for all used meshes. We restrict the measurements for the old initialization scheme to meshes M1-M4, since we run out of memory for larger cases as explained in the last section. Figure 13 compares the initialization time of the new two-level approach and the old scheme for increasing mesh sizes and increasing total number of cores. A good reduction in initialization time is observed when replacing the old method with the new two-level scheme. Figure 13 shows, that the new scheme significantly reduces the time for the two main components of the initialization stage: the computation of the data mapping and the communication of the interface mesh. In addition, the new scheme is capable of handling very large interface meshes, since it does not use any central mesh communication instance. Even though the initialization time for the finest mesh M6 and 12,288 CPU cores is still in the range of a few minutes, we observe a steep increase for larger meshes, which is due to the increase in mesh communication time as seen in Figure 14 (right). \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Mesh** & **Mesh** & **\#Vertices** & \multicolumn{4}{c}{**Cores**} & \multicolumn{4}{c}{**\#Vertices per Core**} \\ \cline{3-8}
**ID** & **Width** & **Total** & **Total** & **B** & **A** & **B** & **A** \\ \hline M1 & 0.0025 & 25,722 & 104 & 26 & 78 & 989 & 330 \\ M2 & 0.0010 & 165,009 & 720 & 192 & 528 & 859 & 312 \\ M3 & 0.00075 & 330,139 & 1344 & 336 & 1008 & 982 & 328 \\ M4 & 0.0005 & 628,898 & 2496 & 624 & 1872 & 1007 & 336 \\ M5 & 0.0004 & 1,660,616 & 6144 & 1536 & 4608 & 1081 & 361 \\ M6 & 0.0003 & 2,962,176 & 12,288 & 3072 & 9216 & 964 & 321 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Weak scalability measurements: Meshes for the wind turbine blade at varying mesh resolution (mesh width). The mesh width indicates the average edge length used to construct the surface mesh. The total number of cores is approximately proportional to the number of mesh vertices. The available CPU cores are distributed with a 1:3 ratio between the solvers. Figure 13: Weak scalability measurements: Total initialization time comparison between the two-level and the one-level schemes. The core distribution and the mesh information are given in Table 3.  
To analyze the reason of the mentioned performance drop, we present the initialization breakdown for various mesh sizes and CPU cores in Figure 15. We observe, that the mesh communication time increases considerably for meshes M5 and M6. The bounding box communication and comparison cost only depends on the total number of cores, not on the mesh resolution as can be seen in a comparison of Figures 10 and 15. For the mapping computation, we observe an almost constant runtime, which is expected as a result of the constant mesh partition size per core. The improvement of the two most costly parts--bounding box comparison and mesh communication--is work in progress. For bounding box communication, this has already been sketched in Section 4.3.1. For mesh communication, further analysis of potential bottlenecks such as synchronization issues is required. Figure 14: Weak scalability measurements: Comparison of mapping computation (**left**) and mesh communication (**right**) time between the two-level and the one-level scheme. The core distribution and the mesh information are given in Table 3.  
Figure 15: Weak scalability measurements: Initialization time breakdown for the two-level initialization scheme. Only algorithmic parts with significant contributions to the initialization runtime are depicted: 1—Bounding box comparison and feedback (Figure 1 levels IV and V). 2—Mesh communication (Figure 2 levels II). 3—Bounding box communication (Figure 1 levels II and III). 4—Compute nearest projection mapping (Figure 2 level II).