Horizon Runtime Efficient Event Scheduling in Runtime Efficient Event Scheduling in Multi-threaded Network Simulation Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Geo g u , o Sto e s, Ja es G oss, aus e e http://www.comsys.rwth-aachen.de/ OMNeT++ Workshop, SimuTools, March 2011 Communication and Distributed Systems
Motivation Need for Complex Network Simulation Models Detailed channel and PHY characteristics Large scale P2P and Internet backbone models High processing and runtime demand g p g Proliferation of Multi-processor Systems p y Desktop: 4-8 cores, servers: 24 cores “Desktop Cluster” es top C uste Cheap, powerful commodity hardware 2 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Motivation Need for Complex Network Simulation Models Detailed channel and PHY characteristics Large scale P2P and Internet backbone models High processing and runtime demand g p g Proliferation of Multi-processor Systems p y Desktop: 4-8 cores, servers: 24 cores “Desktop Cluster” es top C uste Cheap, powerful commodity hardware Utilize Parallelization to Cut Runtimes? 3 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Motivation: Downside of Parallelization Parallelization Introduces Overhead Thread synchronization, management of shared data y g Increased management overhead per event Negative impact on events of low complexity g p p y 4 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Motivation: Downside of Parallelization Parallelization Introduces Overhead Thread synchronization, management of shared data y g Increased management overhead per event Negative impact on events of low complexity g p p y Dilemma / Tradeoff Dilemma / Tradeoff Performance Overhead 5 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Motivation: Downside of Parallelization Parallelization Introduces Overhead Thread synchronization, management of shared data y g Increased management overhead per event Negative impact on events of low complexity g p p y Dilemma / Tradeoff Dilemma / Tradeoff Performance Overhead Minimize Parallelization Overhead 6 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Horizon: Approach Horizon Focus on multi-processor systems p y Sim. Model Centralized architecture Conservative synchronization y Determine independent events Expanded Events Modeling paradigm g p g Computing Per event lookahead Cluster / CPUs Identify independent events y p 7 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Horizon: Approach Horizon Focus on multi-processor systems p y Sim. Model Centralized architecture Conservative synchronization y Determine independent events Expanded Events Modeling paradigm g p g Per event lookahead Identify independent events y p 8 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Horizon: Expanded Events Expanded Events Model processes that span period of time p p p Augment discrete events with durations Discrete events span period of simulated time p p 9 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Horizon: Expanded Events Expanded Events Model processes that span period of time p p p Augment discrete events with durations Discrete events span period of simulated time p p expanded event 10 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Horizon: Expanded Events Expanded Events Model processes that span period of time p p p Augment discrete events with durations Discrete events span period of simulated time p p expanded event t start t end 11 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Horizon: Expanded Events Expanded Events Model processes that span period of time p p p Augment discrete events with durations Discrete events span period of simulated time p p expanded event Trigger processing t start t end 12 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Horizon: Expanded Events Expanded Events Model processes that span period of time p p p Augment discrete events with durations Discrete events span period of simulated time p p expanded event Trigger processing Fetch results t start t end 13 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Horizon: Expanded Events Expanded Events Model processes that span period of time p p p Augment discrete events with durations Discrete events span period of simulated time p p expanded event Trigger processing Fetch results t start t end Parallelization Window Independent Events Events starting between t start and t end Do not depend on results generated by overlapping event Modeling paradigm 14 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Horizon: Expanded Events Expanded Events Model processes that span period of time p p p Augment discrete events with durations Discrete events span period of simulated time p p expanded event t start t end expanded event Independent Events Events starting between t start and t end Do not depend on results generated by overlapping event Modeling paradigm 15 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Challenges How to reduce parallelization overhead? How to reduce parallelization overhead?
Challenges and Solutions We Address Two Challenges Thread Synchronization Thread Synchronization Event Scheduling Event Scheduling Overhead Overhead 17 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Challenges and Solutions We Address Two Challenges Thread Synchronization Thread Synchronization Event Scheduling Event Scheduling Event Scheduling Event Scheduling Overhead Overhead Overhead 18 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Thread Synchronization Overhead: Challenge Master/Worker Architecture Master coordinates simulation progress p g Workers do actual processing future event set Synchronization involves y Workers wait for incoming jobs event scheduler Access to shared data structures Straightforward Implementation Locks condition variables Locks, condition variables Workers pull jobs from work queue If lock occupied or no job available If lock occupied or no job available Suspend thread Free-up CPU resources Free up CPU resources 19 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Thread Synchronization Overhead: Challenge Master/Worker Architecture Master coordinates simulation progress p g Workers do actual processing future event set Synchronization involves y Workers wait for incoming jobs event scheduler Access to shared data structures Straightforward Implementation work queue Locks condition variables Locks, condition variables Workers pull jobs from work queue If lock occupied or no job available If lock occupied or no job available Suspend thread Free-up CPU resources Free up CPU resources 20 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Thread Synchronization Overhead: Challenge Master/Worker Architecture Master coordinates simulation progress p g Workers do actual processing future event set Synchronization involves y Workers wait for incoming jobs event scheduler Access to shared data structures Straightforward Implementation work queue Locks condition variables Locks, condition variables worker worker worker Workers pull jobs from work queue If lock occupied or no job available If lock occupied or no job available Suspend thread Free-up CPU resources Free up CPU resources 21 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Thread Synchronization Overhead: Challenge Master/Worker Architecture Master coordinates simulation progress p g Workers do actual processing future event set Synchronization involves y Workers wait for incoming jobs event scheduler Access to shared data structures Straightforward Implementation work queue Locks condition variables Locks, condition variables worker worker worker Workers pull jobs from work queue If lock occupied or no job available If lock occupied or no job available Suspend thread Free-up CPU resources Free up CPU resources 22 Communication and Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle Distributed Systems
Recommend
More recommend