STR/04/057/SP 342 e@t+L re- s)@t Owne Reade re- s)@t Shared-State Synchronization for HLA-Based Distributed Simulation M. Y. H. Low, B. P. Gan, J. Wei 1 , X. Wang 1 , S. J. Turner 1 and W. Cai 1 1 School of Computer Engineering, Nanyang Technological University (NTU), Singapore. Abstract – The problem of shared state is well known to the parallel and distributed simulation research community. In this report, we revisit the problem of shared state in the context of a High Level Architecture based distributed simulation. A middleware approach is proposed to solve this problem within the framework of High Level Ar- chitecture Runtime Infrastructure. Four solutions to this problem are implemented in the middle- ware using receive-order messages. Experimen- tal results comparing the performance of these four solutions against a simple request-reply approach using time-stamp-order messages are also presented. Keywords: Shared-state, Zero lookahead, High level architecture, Distributed simulation 1 BACKGROUND Simulation has traditionally been used as a tool to perform “what if” analysis in complex systems such as the operations of a manufacturing pro- duction facility. In a supply chain scenario with multiple business partners each with its own manufacturing production facility, it is not suffi- cient for each business partner in the supply chain to optimize its operation using simulation. In order to optimize the performance of the whole supply chain, these simulation models need to be integrated before any meaningful analysis can be made. Physically integrating these simulation models into a single simulation environment is often not possible due to 1) the complexity of individual models; 2) business partners being geographically dispersed; and 3) confidentiality in sharing certain parts of the simulation model. Distributed simulation offers a solution to this problem by allowing existing simulation models to be reused and integrated with other simulation models in the supply chain through well-defined interfaces. Each supply chain simulation can also selectively expose only the necessary data to other partners in the supply chain simulation. An emerging standard for distributed simulation, namely the High Level Architecture (HLA) stan- dard has been proposed by the U.S. Department of Defense (DoD) [1]. The HLA defines the rules and specifications to support reusability and in- teroperability of different simulators. In HLA ter- minology, a single simulator is referred to as a federate. A federation is then a set of federates working together to achieve a given goal. Each federate defines the objects and interactions that are shared in its simulation object model (SOM) and interacts with one another over the Runtime Infrastructure (RTI) [2]. The problem of shared state is a well-known problem in both the parallel, as well as the dis- tributed simulation research community. In the context of an HLA-based distributed simulation, the issue involves the following: an “owner” fed- erate updates a local shared variable periodi- cally and multiple remote “reader” federates can access the value of the shared variable instan- taneously (at the same simulation time as the read). For the rest of this report, we assume that the HLA-based distributed simulation runs on an RTI that uses a conservative synchronization protocol for its time management service. Fig. 1. Request-Reply using TSO messages. Fig. 1 shows a straightforward implementation to support shared state in an HLA-based distrib- uted simulation using a set of time-stamp-order (TSO) request-reply interactions both time- stamped at the simulation time t. In the example, the owner federate updates a shared variable s periodically, and also sends a TSO event e to the reader federate periodically with a lookahead of L. At simulation time t, the reader federate accesses the value of the shared variable s by sending a TSO request message time-stamped at t. The owner federate, on receiving the re- quest message, will issue a TSO object update