Professional Documents
Culture Documents
Fethi A. Rabhi School of Information Systems The University of New South Wales Sydney, NSW 2052 (Australia) Helen Cai and Brian C. Tompsett Department of Computer Science The University of Hull Hull HU6 7RX (UK)
Abstract
It has long been argued that developing distributed software is a difcult and error-prone activity. Based on previous work on design patterns and skeletons, this paper proposes a template-based approach for the high-level design and implementation of Distributed Virtual Environments (DVEs). It describes a methodology and its associated tool which includes a user-interface, a performance analyser and an automatic code generation facility. It also discusses some preliminary results on a surgical training system.
1 Introduction
In recent years, the demand for distributed systems has been increasing due to the widespread use of real-time and information systems that can operate over general purpose networks. However, the process of developing distributed software is still immature since it involves a large number of complex design issues such as synchronisation, timing constraints, data distribution and fault-tolerance. Part of the problem comes from the fact that most systems are built in a bottom-up fashion i.e. they are often constructed using software modules that have already been developed. Each sequential activity is modelled separately using known techniques and interaction is usually left much later in the design process or only addressed during the implementation phase. Whilst this is unimportant for an information system for example, analysing and understanding the systems overall behaviour is crucial for satisfying the requirements of a large number of systems particularly distributed real-time systems. Fuelled by the popularity of object models and languages, there has been an increasing tendency to use a software layer (called middleware) to link all the software components that comprise a distributed architecture. A standard
such as CORBA [10] is a promising development because it offers the opportunity for software components to communicate and synchronise regardless of their programming language or host operating system. However, such standards cannot deal with issues such as fault-tolerance and timeliness since all interaction-specic details are left to the underlying communication system. In addition, they offer users low level programming interfaces and cannot accommodate changes easily. The aim of this paper is to study the role of patterns and skeletons in the design and implementation of distributed systems, focusing on Distributed Virtual Environments (DVEs) selected as a case study. Section 2 describes DVEs and discusses various approaches for designing and implementing them. Section 3 presents a design pattern which facilitates the extension of a VE into a DVE. Section 4 discusses a skeleton-based methodology for using this pattern and its associated tool. Some preliminary results on a surgical training system are discussed in Section 5.
Producer Shared data Initialisation() Shutdown() Register() ConcreteActor Virtual Environment Actor State Load_World() Shutdown_World() Collect_Input() Update_World() Display_View() ConcreteSpectator Spectator State Update() Display_View()
Figure 1. Structure of the Actor-Spectator-Producer pattern headphones or speakers. Developing such an environment is a challenging task particularly for the inexperienced software developer. First, there are performance requirements (e.g. the virtual world has to run the simulation efciently), real-time requirements (e.g. outputs must be generated within some time constraints), reliability requirements (e.g. the system must cope with users at different geographic locations) and dynamic changes (e.g. users joining and leaving at any time). Secondly, during the design activity, the concurrent aspects of the system must be correctly expressed, an architectural model which embodies the resources and the network(s) involved must be developed and an adequate logical-physical mapping that satises the requirements must be determined. Finally, the system must be implemented using a suitable combination of language(s), operating system(s) and communication protocol(s). entities it maintains in the virtual world to the other participants so that they can update their database. The most important drawback with this method is its large communication overheads. Another solution is to have one computer containing the database and sharing it with all other hosts. This time, the problem is that the databases host computer becomes a communication bottleneck. Alternatively, programmers prefer to create their own system architecture, adapted to their own requirements, using standards such as Distributed Interactive Simulation (DIS) [7]. Ideally, designers would like to dene a software architecture without committing themselves to a particular implementation. Automatic tools would be in charge of tailoring this architecture to the underlying distributed system. This is our preferred option. More precisely, we propose a solution along the following lines:
Offer a design pattern [8] specically aimed at DVEs. This will clearly present a high-level description of the system and explain the interaction between the different components in the system. This is described in the next section. Consider the DVE interaction pattern as a basic skeleton [4, 14] and propose a programming environment around it, in similar ways to other skeleton-based programming environments we already developed for parallel applications [11, 12, 17]. This is discussed in Section 4.
pipelines, master/slave, data parallel etc. for which implementations have been studied extensively on a variety of platforms. In the context of this work, a skeleton-based programming environment uses a specic interaction pattern as a design primitive from which parallel programs can be automatically generated given some application-specic information [14]. Such an approach provides a templatebased approach to program design and can be easily incorporated into smart programming environments. In addition, the implementation of a particular interaction pattern can be based on known techniques, experiences and libraries developed over the years in a way that is transparent to the user. Examples of skeleton-based programming systems can be found in [11, 12, 17]. The Actor-Spectator-Producer design pattern provides the basis of a skeleton-based methodology for designing and implementing DVEs. This methodology is to be supported by a tool, whose structure is illustrated in gure 3. Each component in the tool is described next.
Producer Initialisation()
Actor
Spectator 1
Spectator 2
Display_View()
Collect_Input()
Retrieve() Update()
Display_View()
USER INTERFACE
Architectural model
Application-specific parameters
SCHEDULER
CODE GENERATOR
Schedule
Target code
Figure 3. A Programming Environment Based on the Design Pattern The scheduling algorithm used is adapted from the Cluster Heuristic Algorithm which handles periodic tasks distributed across several hosts in a system [13]. We take into account additional constraints such as replication and distribution constraints. After building the corresponding process graph, the algorithm operates in four phases. In phase one, a list is created of pairs of tasks that communicate, and this list is sorted in order of decreasing pairwise communication, so that tightly-coupled tasks are considered rst during the next phase. In phase two, clusters of tasks are built; a cluster is associated with each processor. As task pairs are considered, if neither task is assigned, both are placed on the least loaded processor (i.e., in the smallest cluster). If one task is assigned, the other is assigned to the same processor unless a specied load threshold has been exceeded, and in that case it is placed on the least loaded processor. Phase three orders tasks within each cluster with respect to precedence constraints, so that each cluster represents a feasible sequence of tasks. Phase four shifts subsequences of tasks to later time periods to enforce precedence constraints among tasks that belong to different clusters. The algorithm produces a mapping between tasks and hosts, to be used during the code generation phase. Rening the scheduling algorithm and validating its predictions against real execution gures is still an on-going research project [2]. between the different components in the system. The second one is to use Java3Ds facilities for dening the shared data objects within the Producer as well as specifying the possible actions that can be selected by a Spectator to process (e.g. visualize) these objects. In Java3D terminology, these actions are called behaviours. The code generator relies on a generic Producer which is provided as part of the DVE Skeleton Libraries (see Figure 3). In its present implementation, the Producer holds all shared data objects. It is automatically notied by the Actor each time a change to the shared data is made and responds periodically to update requests from the Spectators. In future systems, we expect that there will be a choice of other types of producers such as producers that implement other notication schemes, distributed producers etc. Given an Actor component and a Java3D description of the shared data objects and their associated behaviours, the Code Generator produces the corresponding interfaces in CORBAs Interface Denition Language (IDL), generates the Spectators code using the specied Java3D behaviours and links the various components of the system through CORBA calls. For instance, the Producer will be a recognisable entity within the CORBA Naming Service so that all other components can locate it and communicate with it. The Code Generator also allocates components to hosts as specied by the schedule. An example is described in the next section.
Figure 4. A surgical training system for knee arthroscopic operations surgeons distributed across a network to monitor a simulated operation in real-time. The training system (written in C++) was provided by the Virtual Environment Research Group at the University of Hull [3]. This software, called Meniscus, simulates the deformations of a meniscus of the knee joint subject to a stretching force. It is designed for use by trainee orthopaedic surgeons for knee arthroscopy operations (see gure 4). The interface is composed of a control window and a window containing the representation of the Meniscus. With the help of a space ball (a specic device allowing 3D motion), we can apply forces on the Meniscus to deform it. Different options can be changed during the simulation. We can choose between different representations of the Meniscus. One of them shows the complete volume using a wireframe representation while another only shows the surface. We can add axis, shadow, draw a frame around the object. We can also change the point of view: moving around the meniscus, closing in to it. The distributed application has been executed on the University of Hull network. A Web server located in Belgium was used to host the CORBA Naming Server used to register the Producer, the Actor and the Spectators. The Spectators were run on old computers with a Cyrix 686MX 233 MHz processor, 64 MB of RAM and a plain graphics card, the Cirrus Logic CL-GD5446, whereas the Producer was run on a more powerful computer with an INTEL Pentium II 300 MHz processor, 128 MB of RAM and a 3D graphics card, the Diamond Fire GL 1000 Pro. A snapshot of the Spectators view in the Meniscus application is illustrated in gure 5. For a good impression of uidity of the display and realism to the human eye, the frame rate should be at least around 10 frames per second. For the Meniscus application, performance falls to around 2-3 frames per second on older PCs and 37 frames per second on more powerful PCs with a 3D graphics card. These test results show that the design model is efcient and that CORBA was a good choice of a middleware for this kind of application, giving very good results even when used in conjunction with C++ and Java.
Figure 5. View of the meniscus by a Spectator erator which makes use of the powerful abstraction mechanisms provided by both CORBA and Java3D. There are plenty of avenues for future work. The most immediate one is to complete and integrate the various components of the tool. Beside the Scheduler, other components that analyse the properties of the DVE application can be added. One useful analysis is predicting different update frame rates depending on the distance (and the priority) of Spectators for example. The Code Generator can be made to choose amongst different Producers for the nal implementation, based on various conditions. An example would be a Fault-Tolerant Producer which migrates to a different host in case of a processor failure or shutdown. Another example would be a Distributed Producer that runs over several hosts. This is particularly useful if the amount of shared data is large or there is a large number of spectators. Finally, since the design pattern does not cover all types of DVEs, it would be useful to tackle other interaction patterns such as:
allowing Multiple Actors to change the shared data concurrently: although this extension would not be useful for developing distributed applications for medical training simulations, the potential for applying this pattern to other elds, such as computer games or ight simulators, is a key factor for developing fully functional systems.
7 Aknowledgements
We wish to thank Thibault Devillers for making the original design pattern proposal and Jean-Francois Dal for implementing the surgical training system. We also wish to thank James Ward, Derek Wills and Paul Chapman from the Virtual Environment Research Group for providing help and expertise on the application side.
References
[1] F. Buschmann, R. Meunier, H. Rohnert, P. Sommerlad, and M. Stal. A System of Patterns: Pattern-Oriented Software Architecture. J. Wiley and Sons, 1996. [2] H. Cai. A skeleton-based programming environment for distributed real-time systems. PhD thesis in preparation, Department of Computer Science, The University of Hull, 2000.
giving any Spectator the ability to take over the Actors role: for example, the surgeons who are monitoring the operation could have the possibility to help the trainees in a most efcient way. They would be able to show the trainees the best way to operate in some difcult situations
[3] P. Chapman and D. Wills. Modal analysis: a physical model for virtual environments ? In Proc. Eurographics UK, pages 175182. The University of Leeds, 1998. [4] M. Cole. Algorithmic skeletons: a structured approach to the management of parallel computation. Research monographs in Parallel and Distributed Computing, Pitman, 1989. [5] B. Douglass. Real-Time UML: Developing Efcient Objects for Embedded Systems. Addison-Wesley, 1998. [6] S. Ellis. What are virtual environments ? IEEE Computer Graphics and Applications, 14(1):1722, January 1994. [7] D. Fullford. Distributed interactive simulation: Its past, present, and future. In J. M. Charnes, D. J. Morrice, D. T. Brunner, and J. Swain, editors, Proceedings of the 1996 Winter Simulation Conference, Coronado, California, USA, 1996. [8] E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of reusable Object-Oriented Software. Addison Wesley, Professional Computing Series, 1995. [9] N. Islam and M. Devarakonda. An essential design pattern for fault-tolerant distributed state sharing. Communications of the ACM, 39(10):6574, October 1995. [10] OMG. The common object request broker: Architecture and specication, revision 2.2. Report 98-07-01, The Object Management Group, http://www.omg.org/, 1998. [11] B. Osoba and F. Rabhi. A parallel multigrid skeleton using bsp. In D. Pritchard and J. Reeve, editors, Proceedings of EuroPar98: Parallel Processing, Lecture Notes in Computer Science 1470, pages 704708. Springer Verlag, 1998. [12] P. Parsons and F. Rabhi. Generating parallel programs from paradigm-based specications. Journal of Systems Architecture, 45(4):261283, 1998. [13] C. Price and M. Salama. Scheduling of precedenceconstrained tasks on multiprocessors. The Computer Journal, 33(3):219229, 1990. [14] F. Rabhi. Parallel programming methodology based on paradigms. In P. Nixon, editor, Transputer and Occam Developments, pages 239252. IOS Press, 1995. [15] F. Rabhi and T. Devillers. A software architecture for distributed virtual environments: the actor-spectator-producer pattern. In submitted to The First Asian-Pacic Pattern Languages of Programming Conference, KoalaPLoP2000, Melbourne, Australia, May 2000. [16] D. Schmidt. Using design patterns to develop reusable object-oriented communication software. Communications of the ACM, 38(10):6574, October 1995. [17] J. Schwarz and F. Rabhi. A skeleton-based implementation of iterative transformation algorithms using functional languages. In M. Kara, J. Davy, D. Goodeve, and J. Nash, editors, Abstract Machine Models for Parallel and Distributed Computing, pages 119134. IOS Press, 1996.