Abstract
A mobile agent based framework for the transparent distribution and concurrent execution of computations is presented. The framework uses design patterns like the master-slave, abstract factory or the strategy pattern. The architecture of the framework is built on top of a mobile agent system. A performance model allows to identify performance bottlenecks and unbalanced situations within the framework. The framework has been implemented and tested on top of the mobile agent system Mole.
Introduction
In the late 1990s, distributed computing was a manual, labor-intensive process. Developers typically had to write explicit code for Remote Procedure Calls (RPCs), manually manage network connections, and decide exactly which piece of data should go to which node. While "Mobile Agents"—software entities capable of moving their code and state between computers—offered a promising alternative, they remained difficult to implement for general-purpose computing.
This paper addresses the gap between complex distributed systems and ease of use. The authors propose a framework that makes distribution transparent, meaning the system handles the "where" and "how" of execution automatically, allowing programmers to focus on algorithms rather than networking logistics.
System Architecture and Design Patterns
The framework is built on top of Mole, a Java-based mobile agent system. To ensure flexibility and reusability, the architecture leverages three core software engineering patterns:
- Master-Slave: A central coordinator (Master) partitions work into independent jobs for worker agents (Slaves).
- Strategy: This pattern encapsulates the actual algorithm. Worker agents remain generic; they do not need to know the specifics of the calculation, only how to execute the "strategy" object they receive.
- Abstract Factory: This is used to instantiate strategy objects at runtime, ensuring the framework isn't hard-coded to a specific task.
As shown in the architecture diagram above, an application sends jobs to a Coordinator. The Coordinator manages a pool of Worker Agents, dispatching them to various "places" (nodes) on the network. If a worker finishes or a node becomes idle, the Coordinator manages the queue to maintain system balance.
Performance Modeling and Evaluation
Distribution is not "free"; it introduces overhead. The authors developed a mathematical model to estimate execution time, accounting for initialization ($t_{ini}$), network delay, migration time ($t_{mig}$), and result integration ($t_{int}$). This model helps developers determine if a problem is computationally "heavy" enough to justify the overhead of network distribution.
To evaluate the framework, the authors used a Mandelbrot Set Calculation benchmark (generating a 384x256 pixel image). They tested various "work package" sizes (e.g., 16x16 or 64x64 pixel blocks) and scaled the number of worker agents from 2 to 4.
Key Insights
- The Overhead Threshold: The performance data (Figure 6) reveals that for very small work packages, the time spent packaging and migrating code outweighs the speedup from parallel execution.
- Granularity and Bottlenecks: There is an optimal "sweet spot" for package size. If packages are too small, the Coordinator becomes a bottleneck, overwhelmed by management tasks. If they are too large, the benefits of concurrency and load balancing are lost.
- Code-to-Data Advantage: By sending a small agent (the code) to where the data lives, the framework significantly reduces communication costs compared to moving massive datasets to a central server.
Conclusion and Future Work
The empirical tests confirmed that the framework successfully achieves transparent parallel execution. Using 4 workers with 64x64 blocks was significantly faster (~9.5 seconds) than using 2 workers with 16x16 blocks (~33.4 seconds). Furthermore, the mathematical model accurately predicted optimal package sizes.
Future work aims to improve fault tolerance, specifically addressing potential Coordinator failures, and implementing more dynamic load balancing where the coordinator queries nodes for real-time CPU load before dispatching agents. Currently, the model assumes a stable, fully connected network, which may require adjustment for more volatile wide-area network (WAN) environments.
Summary updated