ENHANCING LOAD DISTRIBUTION STRATEGIES THROUGH SIMULATION

Load distribution is a well known critical problem in every distributed system. From operating systems to agent oriented applications it is not difficult to find cases where processing nodes are overloaded when, at the same time, other peers present low levels of activity. In agent oriented applications, where the appeal to cooperation is almost a constant event, these unbalanced situations may generate serious cases of contention, deadlock or simply large idle times. The implementation of load distribution strategies in a distributed system may help significantly to improve its overall performance and reduce effectively such undesirable situations. In order to study the effects of different load distribution policies in agent based applications a generic load distribution simulation system was design and implemented. The system allows the specification of multiorganisational distributed systems with dynamic load patterns. Its main characteristics and functionalities are presented in this paper. LOAD DISTRIBUTION STRATEGIES ANALYSIS The quantitative analysis of new load distribution strategies is a fundamental step to assess its initially proposed goals. This analysis must be done prior to the definitive implementation of these strategies, to avoid wasting human and material resources due to an incomplete analysis. Due to its great flexibility, numerical simulation is one of the most used methods to analyse load distribution mechanisms, either to specify the underlying processing system or to specify its workload. There are two main methods to perform a priori quantitative analysis of load distribution mechanisms: the analytical and thenumerical simulation method. In the former method, where analytical expressions are used to model load distribution mechanisms, there is the possibility of quantifying all fundamental system variables and the knowledge of the expressions that define the relative dependence of those variables (Rodrigues 1988). Most of the models are based on queuing networks to represent the processing system and the executing tasks. Examples of this method can be found in (Eager, Lazowska & Zahorjan 1986)(Theimer & Lantz 1989). The second method, instead of requiring a detailed knowledge of the equations that relate system variables, just requires the knowledge of the internal functioning of the various components of the distributed mechanism. Results are implicitly obtained as a consequence of the interaction between these components, computationally reproduced (Ramamritham, Stankovic & Zhao 1989)(Kremien, Kramer & Magee 1993)(Kremien & Kramer 1992)(Zhou 1988). However, there are authors that build prototypes of some load distribution mechanisms, to analyse its performance on real physical systems. An artificial, or synthetic, workload is applied to the system, and its behaviour with several different load distribution strategies analysed. These prototypes do not need all characteristics of a real load distribution mechanism, namely those related with liability. Nevertheless, most of the functionality essential to distribution must be implemented (Kunz 1991)(Lüling, Monien & Ramme 1992). Each of these methods presents advantages and disadvantages: due to the difficulty in finding expressions that adequately model the relations between the various system variables, the analytical method is only appropriated for very simple balancing policies and is not well suited for strategies with complex behaviours; the analytical method greatest advantage is that results are obtained very fast, even when iterative numerical methods are used; simulation with artificial workloads requires a great deal of time to develop the prototypes of the mechanism being analysed, because these must operate on a real system; this method implies exclusive dedication of the processing system to the process being analysed. Although this can be feasible on some parallel machines, it is very difficult on distributed multi-user systems, due to the huge number of users and operating system tasks; both the analytical method and the simulation with an artificial workload are very inflexible with respect to the analysis of different physical configurations, due, respectively, to the difficulty of obtaining expressions associated with complex configurations and the difficulty, or impossibility, of changing the physical configuration of the underlying processing system; the numerical simulation method requires the development of a simulator that supports the distribution mechanisms being analysed. However, this task is simpler than building prototypes for simulation with artificial workloads; this method is the most flexible with respect to the ability of analysing different system configurations, different load patterns and different configurations of the distributed elements; numerical simulation can take a relatively large amount of time if the number of entities involved is large. Due to the flexibility presented, the numerical simulation method seems to be the best suited to analyse, a priori, new load distribution mechanisms. The simulation model hereby presented allows: 1) the definition of the underlying system configuration being able to simulate parallel or distributed systems on multiorganisational environments; 2) the definition of different configurations of the distribution elements allowing different arrangements for the various components of the distribution mechanism, namely, the information, transfer, selection and location policies; and 3) the definition of different load patterns. Formally, this model is characterised as (Rodrigues 1988): abstract, numerical, dynamic, explicit and stochastic. THE SIMULATION PROCESS Due to the huge amount of time the simulation process can take to complete, it was divided on two different steps: 1) the actual simulation, where results are generated using a given configuration, stored in a file; and 2) the results analysis, which is performed later, using the results file generated by the simulator. With this separation the simulation process can be executed in batch mode. Another advantage is that not all statistics need to be calculated during the simulation, which would be slower and would require the predefinition of all the desired statistics. It would also require a new execution of the simulation each time a different statistic becomes necessary. All procedures necessary for the simulation process, namely, the simulator itself and the statistical analysis of the results, were developed in SICStus (Carlsson & Widen 1993) Prolog. This language presents some significative advantages, like: the ability to model complex algorithmic behaviours; significant inference capabilities; small development times, which allows a larger number of distribution mechanisms to be modelled, enabling a more effective analysis. THE CONFIGURATION FILE The configuration file is a fundamental element of the simulation process, because it expresses the simulator’s flexibility and constitutes the final user interface. The configuration for a parallel machine with 4 nodes and a mesh topology, with load distribution agents using a random strategy. The grammar that rules the configuration file language is presented in figure 1. <configuration> ::= <comment>* <header> <entity>+ <comment> ::= string <header> ::= <seed> <begin> <end> <monitoring> <control_messages> <message_header> <seed> ::= seed(integer, integer, integer). <begin> ::= simulation_begin(integer). <end> ::= simulation_end(integer). <monitoring> ::= report_interval(integer). <control_messages> ::= control_messages_size(integer). <message_header> ::= message_header_size(integer). <entity> ::= <comment>|<group>|<node>| <communication_line>|<load>|<task>|<agent> <group> ::= group(identifier, string). <node> ::= node(identifier,identifier,<identifier_list>, <node_resources>,(integer, integer)). <identifier_list> ::= [identifiers*] <node_resources> ::= [<node_resource>+] <node_resource> ::= (identifier, integer, <type>) <type> ::= active | passive <communication_line> ::= communication_line(identifier, identifier, integer). <load> ::= load(identifier,<distribution1>,<task_list>). <distribution1> ::= exactly(integer) | expneg(integer) <task_list> ::= [<task_load>+] <task_load> ::= (integer, identifier) <task> ::= task(identifier,<distribution1>, <distribution2>,<task_resources>,(<distribution2>, <distribution2>),<distribution1>). <distribution2> ::= <distribution1> | none <task_resources> ::= [<task_resource>+] <task_resource> ::= (identifier, <distribution1>, <type>) <agent> ::= <aleatory_agent> | . <aleatory_agent> ::= aleatory(identifier, identifier, integer, integer,<non_empty_identifier_list>). <non_empty_identifier_list> ::= [identifier+] Figure 1: Configuration language grammar. To facilitate the simulation process, a syntactic and semantic analysis of the configuration file is performed and the eventual errors presented to the user.