Presentation is loading. Please wait.

Presentation is loading. Please wait.

Almansur: Extendable Implementation and Parallelization Using MASS Stuart Drummond.

Similar presentations


Presentation on theme: "Almansur: Extendable Implementation and Parallelization Using MASS Stuart Drummond."— Presentation transcript:

1 Almansur: Extendable Implementation and Parallelization Using MASS Stuart Drummond

2 Introduction

3 Almansur Overview Massively multiplayer online turn- based strategy game Built using Ruby on Rails by PDMFC Originally released in 2007 Created using agent-based modeling Slide 1Introductio n

4 MASS Created and maintained by Dr. Munehiro Fukuda and Distributed System Lab at UW Bothell What is it? Places & Agents Using multiple computing nodes via grid computing to parallelize Versions Java and C++ Which one is being used for the project? Slide 2Introductio n

5 Game parallelization & Benchmarking Specific to games in web… Most literature had to do parallelizing and scaling game server AlBahnassi, Mudur, & Goswami, 2012 Use of task parallelism External validity in benchmarking Slide 3Introductio n

6 Agent-Based Systems What are agents? Macal & North (2008) What are the features of agents? Autonomy Social relationships Reactivity Proactiveness What kind of systems could benefit from agent- based systems? Not this kind of agents Slide 4Introductio n

7 Project Overview & Implementation

8 The Problem and Requirements Overall Speed Ding, Gernart, Li & Hertz (2014) Turn Processing Functional Requirement Performance Non-functional Requirements Extendibility Slide 1Project Overview

9 Benchmarking Results (Ribeiro, Santos, & Prada 2007) Slide 2Project Overview

10 Benchmarking Results (Ribeiro, Santos, & Prada 2007) Slide 3Project Overview

11 Worst case scenario… Slide 4Project Overview

12 Project Hypothesis H 0 : There is no difference in performance between the original version of Almansur and the MASS- optimized Almansur. H 1 : The amount of time that it takes to conduct turn processing will be significantly faster in the MASS- optimized Almansur. Operational Definition Speed: Less than 5% change in difference is considered within margin of error. Slide 5Project Overview

13 Architecture Slide 6Implementations

14 Components of Almansur Slide 7Implementations

15 MASS-optimized Almansur Slide 8Implementations

16 Slide 9 World. process_turn()

17 Event Manager Class responsible for relaying events from turn processing to agents. Reads from a JSON file and parsed by GSON. Additional processing to determine if the target is a place or an agent. Slide 10Implementations

18 Event Manager Continued… Slide 11Implementations

19 JSON File Slide 12Implementations

20 Source code documentations Source Code Element TypeWhat does it mean?Docum ented? DB CONSTSThese are constant values that will provide the index to some specific variable in the Object array that represents a row in the database. N/A REFERENCE CONSTSThese are constants to do comparison in reference methods.N/A CALCULATION CONSTSThese are constants that are used to calculate some value for turn processing. N/A CONSTRUCTORSMethod to construct object.No ACCESSORSMethods to act some database value from this object.No MUTATORSMethods to change some database value from this object.No REFERENCE METHODSStatic methods used by reference to compare/retrieve values with the reference. Yes LEGACY METHODSOther methods used by the original version to calculate some values required for turn processing. The name of the method is left the same as the one in the Ruby version for easy identification. Yes Slide 13Implementations

21 Methods

22 Performance Metrics Ruby benchmarking modules Using System.currentTimeMillis() at two points. Graph + performance difference percentage table Process 1 turn PC used for testing: CPU: i7 2600k @ 4.7 GHz Memory: 8 GB RAM Storage: Samsung 830 Pro SSD GPU: 2x Nvidia GTX 780 TI Slide 1Methods

23 Scenario Selection Using the same set of scenarios used by the graduate student at PDMFC Importing provided SQL dumps Scenarios: Small scenario with 2 Lands Large scenario with 200 Lands Very large scenario with 500 Lands Huge scenario with 1000 Lands Slide 2Methods

24 Results

25 Scenario 1 Table (Milliseconds) Slide 1Results 1 NodeRubyPerformance Change 1 Thread22687874.260% 2 Threads18887878.588% 4 Threads18787878.702% Number of Lands: 2 Number of Agents: 511

26 Scenario 2 Table (Milliseconds) Slide 2Results 1 NodeRubyMax diff 1 Thread66123,89397.233% 2 Threads62423,89397.388% 4 Threads61023,89397.447% Number of Lands: 200 Number of Agents: 28005

27 Scenario 3 Table (Milliseconds) Slide 3Results 1 NodeRubyMax diff 1 Thread112356,24598.000% 2 Threads102456,24598.180% 4 Threads101856,24598.190% Number of Lands: 500 Number of Agents: 65420

28 Scenario 4 Table (Milliseconds) Slide 4Results 1 NodeRubyMax diff 1 Thread1947109,54398.222% 2 Threads1646109,54398.497% 4 Threads1586109,54398.552% Number of Lands: 1000 Number of Agents: 126424

29 Performance Scatterplot Slide 5Results

30 Conclusions

31 Hypothesis Revisited The implementation using MASS allowed for a processing time that was better than the original version Was able to reject the null hypothesis Performance bottleneck? Any operation that involve having to refer back to the Lands / Political Entities create sections of code where parallelizable become impossible Innate issue with the original design Future implementation may start individualizing from the original software Slide 1Conclusions

32 Limitations No multi-process results Low sample size Repetitive importing code Some processes are missing Slide 2Conclusions

33 Future extensions Web extension Proper scenario importing and exporting Additional processing Further testing Slide 3Conclusions

34 Lessons Learned The requirements of a project changes…often Having a library that can evolve is helpful for a project Assuming anything about the source code is risky! Communication is key Porting from a dynamic-typed language to a static-typed language is difficult. Slide 4Conclusions

35 References Active record pattern. (2005, October 11). Retrieved September 1, 2014, from http://en.wikipedia.org/wiki/Active_record_pattern Adobbati, R., Marshall, A. N., Scholer, A., Tejada, S., Kaminka, G. A., Schaffer, S., & Sollitto, C. (2001, January). Gamebots: A 3d virtual world test-bed for multi-agent research. In Proceedings of the second international workshop on Infrastructure for Agents, MAS, and Scalable MAS (Vol. 5). Montreal, Canada. AlBahnassi, W., Mudur, S. P., & Goswami, D. (2012, June). A Design Pattern for Parallel Programming of Games. In High Performance Computing and Communication & 2012 IEEE 9th International Conference on Embedded Software and Systems (HPCC-ICESS), 2012 IEEE 14th International Conference on (pp. 1007- 1014). IEEE. Almansur. (2005). Free online medieval strategy turn based game. Retrieved May 1, 2014, from http://www.almansur.net/http://www.almansur.net/ Barata, A. M., Santos, P. A., & Prada, R. (2011, September). AI for Massive Multiplayer Online Strategy Games. In AIIDE. Chiu, A., Nasiri, E., & Rashid, R. (2012). Parallelization of Sudoku. Ding, C., Gernhart, B., Li, P., & Hertz, M. (2014). Safe parallel programming in an interpreted language (Vol. 991). Technical Report. Dong, J., Chen, S., & Jeng, J. J. (2005, April). Event-based blackboard architecture for multi-agent systems. In Information Technology: Coding and Computing, 2005. ITCC 2005. International Conference on (Vol. 2, pp. 379-384). IEEE. Fukuda, M. (2014, January 30). MASS: A Parallelizing Library for Multi-Agent Spatial Simulation. MASS: A Parallelizing Library for Multi-Agent Spatial Simulation. Retrieved May 1, 2014, from http://depts.washington.edu/dslab/MASS/index.htmlhttp://depts.washington.edu/dslab/MASS/index.html Jruby. (n.d.). Retrieved August 20, 2014. Macal, C. M., & North, M. J. (2008, December). Agent-based modeling and simulation: ABMS examples. In Proceedings of the 40th Conference on Winter Simulation (pp. 101-112). Winter Simulation Conference. Ribeiro, L. M. L., Santos, P., & Prada, R. (2007). Agents for Massive On-line Strategy Turn Based Games. Ruby. (n.d.). Programming Language. Retrieved May 16, 2014, from https://www.ruby-lang.org/enhttps://www.ruby-lang.org/en Ruby on Rails. (n.d.). Retrieved August 20, 2014, from http://rubyonrails.org/http://rubyonrails.org/ StarCraft II. (2010, January 1). Retrieved August 20, 2014, from http://us.battle.net/sc2/en/?-http://us.battle.net/sc2/en/?-


Download ppt "Almansur: Extendable Implementation and Parallelization Using MASS Stuart Drummond."

Similar presentations


Ads by Google