# Distributed Load-Balancing Method for CCA Parallel Component Applications
## 2 Materials and Methods
### Aggregation of the Computing Nodes
The CCAFFEINE framework links the component library at runtime to support the operation of the components. A component instance is represented by a C++ object. This object includes the definitions of all the data structures required by the component, which is equivalent to a copy of the component definition. Multiple instances of the same component can be deployed on different computing nodes and executed in parallel in a multi-process manner. A heterogeneous cluster platform often carries multiple component applications concurrently. #### 2.3.1 CCA-Balance Environment

The original CCA parallel component application does not consider the processing capacity of the computing nodes on an execution platform. This results in an imbalance in the component tasks on different nodes. Nodes with strong computing power and fewer component instances will complete their tasks earlier; therefore, they will be idle. Other nodes spend a long time completing tasks. This imbalance causes computing resources on the platform to be wasted, reducing the performance of applications and the throughput of the whole system. To solve this problem, we added a mechanism for computing node resource management, business component data flow analysis, and component instance load-balancing using the Babel compiler and CCAFFEINE framework. We integrated them into an efficient parallel component application management and running environment, called CCA-balance. The structure of the whole environment is shown in Figure 4.

In CCA-balance, the load balance interfaces and business interfaces are defined using the Scientific Interface Definition Language (SIDL) [15]. The Babel compiler generates local computing-resource proxies and business components by compiling these two types of interfaces. The resource-management node of a heterogeneous platform deploys these components (instances) on the computing nodes. The data flow analysis engine examines the codes of the business components and obtains information such as the component call interfaces, input parameters, and dependency between components. According to the distributed load-balancing algorithm, the component instances that must be executed are allocated within a sub-cluster. The computing nodes within this sub-cluster choose to receive tasks from the task allocation requests based on their own load situations. These nodes locally call the CCAFFEINE framework, generate the component instances, and execute them. #### 2.3.2 Load-Balance Interface

PCDDB defines a new type of component interface, namely the load-balance interface, based on the ordinary business interface of parallel components. This type of interface is primarily used by the local computing resource proxy objects of the computing nodes. These interfaces are defined in the root of the computing node class tree and all computing node classes inherit the definitions of these interfaces. These interfaces are defined in the SIDL, which is an interface definition language similar to C that defines an interface by specifying its name, input parameters, and return value. The Babel tool compiles these interfaces and generates the corresponding local computing resource proxy objects for the computing nodes. These proxies provide a distributed load-balancing mechanism. During the compilation process, we generate the implementation part of the code. The interface functions include checking the load status of the node itself, receiving and sending task allocation requests, updating the relevant local tables, and accepting component instances. These functions play a role in the interactions between different computing nodes for load-balancing. Table 1 lists the definitions of the load-balance interfaces. We use the Babel tool to compile the business interfaces and generate the corresponding business function components. The code for each business component is compiled into an.la dynamic library file by calling the Babel tool and Libtool [16]. Before an application