Agent-based Model Simulation with Twister Bingjing Zhang, Lilian Weng, B649 Term Project Presentation
Problem Statement Run the agent-based modeling (ABM) [1] simulation in parallel. Reason: Sequential iterations on a single machine are too slow [1] E. Bonabeau. Agent-based modeling: Methods and techniques for simulating human systems. Proceedings of the National Academy of Sciences, 99:7280–7287, 2002.
Experiment A model simulating Twitter mechanism: – Users are connected through the social network – Each user has a screen of messages from neighbors, and a memory of topics he is interested in. – Users send messages chosen from screen or memory C - capacity of the screen and memory. Pn - probability to introduce a new topic. Pr - probability to re-post a message from the screen. α - the priority of topics in the memory compared to the screen messages, and therefore the probability of posting about the memory topics is αPr.
Architecture Design of the Application
Broadcasting on Twister Broadcasting – Chain Broadcasting – All-to-all Minimum-spanning Tree
Chain Broadcasting Protocol send get ack send Driver Daemon 0 receive handle data send Daemon 1 ack receive handle data send ack receive handle data get ack ack receive handle data get ack send get ack Daemon 2 receive handle data ack receive handle data ack get ack “Handle data” is done by spawning another thread “Send” and “Receive” are done in a manner of “buffer by buffer”
MST broadcasting Driver sends data portions to different nodes MST Leaf Node MST Root Node Twister Driver All-to-all-MST Broadcasting Protocal
MST Broadcasting Protocol [3] Ernie Chan et, al. Collective Communication: Theory, Practice, and Experience. Concurrency and Computation: Practice and Experience. 2007
Implementation: Model Classes
Implementation: TwisterMessage public void fromTwisterMessage(TwisterMessage message) throws SerializationException { message.writeInt(a); … } public void toTwisterMessage(TwisterMessage message) throws SerializationException { this.a = message.readInt(); … }
Results: Broadcasting Efficiency 80 PG nodes, 2 switches, 50 Iterations, Data Size(Each Iteration) 200KB ~ 200MB, Data Size(Total) 1GB ~ 5GB
Results: Simulation Result Validation Memory Length – number of topics in memory Topic Popularity – number of distinct user who have used a certain topic Topic Prevalence – number of posts containing a certain topic
Thank you! Question?