# Distributed Load-Balancing Method for CCA Parallel Component Applications
## 2 Materials and Methods
### Aggregation of the Computing Nodes  
To reduce the communication overhead caused by the load-balancing mechanism, we aggregate all nodes in the execution platform into different sub-clusters according to the network conditions between the nodes. A sub-cluster is a logical concept and is equivalent to a subset of the overall heterogeneous execution platform. PCDDB employs Algorithm 1 for its clustering process. Figure 3 presents an example of node aggregation. The red node sends a broadcast to other nodes. According to the order of the reply, we can select the top m \(-\) 1 nodes and add the red node to form a set (indicated in yellow in the figure). We can take the union of the three yellow sets to obtain a sub-cluster. The union of all sub-clusters equals the original set S.  
This sub-cluster aggregation method is based on the network conditions between the nodes in the platform. The nodes contained in the same sub-cluster have better com  
Figure 2: Class tree of computing nodes. munication conditions. The load-balancing of different component instances in a parallel component application is performed within a sub-cluster to reduce overhead. The size of each sub-cluster can be no less than m. At the same time, our algorithm may result in different sub-clusters that have no intersection, but it is also possible that they contain some of the same nodes, which is quite natural. That is, for two sub-clusters, \(\text{Sc}_{1}\bigcap\text{Sc}_{2}\
eq\Phi\) is allowed. For example, if S = {n\({}_{0}\), n\({}_{1}\), n\({}_{2}\), n\({}_{3}\), n\({}_{4}\), n\({}_{5}\),... n\({}_{14}\)}, and we have obtained \(\text{Sc}1=\{n_{0},n_{1},n_{2},n_{3},n_{4}\}\) through clustering, then we select n\({}_{6}\) from S-Sc\({}_{1}\) as the starting point to continue clustering in the hope of obtaining \(\text{Sc}_{2}\). If the communication conditions between n\({}_{3}\), n\({}_{4}\), and n\({}_{6}\) are very good, then n\({}_{3}\) and n\({}_{4}\) will also be among those ranked in front to return when n\({}_{6}\) sends out a broadcast message, thus making n\({}_{3}\) and n\({}_{4}\) part of \(\text{Sc}_{2}\) as well. ```
(1) /*All nodes of the platform form a set S. The total number of nodes on the platform is N. We then estimate the possible minimum sub-cluster size m.*/  If clusters where N <= 50, set m = 130%*NJ;  Set Sr = \(\emptyset\);  choose a node n\({}_{0}\) randomly;  n\({}_{0}\) sends a broadcast message;  Any node that receives this message replies n\({}_{0}\);  n\({}_{0}\) record the first m\(-\)1 replies (from whom, as \(\text{Set}_{\text{m}-1}\));  S\({}_{1}\) = n\({}_{0}+\text{Set}_{\text{m}-1}\);  Choose n\({}_{1}\) in S\({}_{1}\) randomly, and n\({}_{1}\)\(\
eq\) n\({}_{0}\). Repeat step (2) to obtain set S\({}_{2}\). Choose n\({}_{2}\) in S\({}



For each node contained in a sub-cluster, the sub-cluster ID attribute in the local computing resource proxy (object) takes the same value. If a node belongs to multiple sub-clusters, then it has multiple sub-cluster IDs. After the aggregation process, we manually specify a node in each sub-cluster as the startup node, which is responsible for the startup of the parallel component applications deployed on the sub-cluster. The maintenance of the class library of computing nodes and sub-cluster aggregation are performed during idle time, when the platform load is low. The entire server cluster is partitioned into distinct sub-clusters by the aggregation algorithm. Each sub-cluster is required to have a size exceeding 30%*N. This threshold is an empirical value. Based on our extensive historical data from deploying applications on this cluster, for server clusters with a node count N less than 50, a sub-cluster size of 30%*N is sufficient to support the operation of typical applications. ### Load-Balancing of the CCA Parallel Applications

Sandia National Laboratory, a part of the US Department of Energy, developed tools for CCA [14]. Users can use the Babel compiler to generate component skeletons. They can then take these skeletons and fill in the implementation code.