major project, csd411cs1100211/files/btp_presentation.pdf · major project, csd411 deterministic...
TRANSCRIPT
Major Project, CSD411
Deterministic ExecutionIn Multithreaded Applications
Ashwin Kumar2010CS10211
12/31/20131 Deterministic Execution In Multithreaded Applications
Himanshu Gupta2010CS10220
SupervisorProf. Sorav Bansal
Project Overview
Multithreaded programming is challenging
Race conditions, deadlocks
Different runs produce different outputs
Non-determinism complicates it further
Debugging, testing
Reproducing errors in multithreaded applications
Existing solutions are inefficient, don’t work for general case
Coredet: Upto 8x slowdown
Kendo: Does not guarantee determinism with data races
Start with Dthreads which makes the most significant claims
12/31/20132 Deterministic Execution In Multithreaded Applications
DTHREADS
Key ideas
Efficient deterministic multithreaded system
Threads run as processes (and thus working on isolated memory)
Deterministic memory commit protocol
Concept of serial (at synchronization points) and parallel phases
Enhances performance by eliminating false sharing of cache lines
12/31/20133 Deterministic Execution In Multithreaded Applications
Mid-Term Status
Understanding the code flow
Testing sample programs on Dthreads
Debugging the code
12/31/20138 Deterministic Execution In Multithreaded Applications
Current Status
Code is now working
Fixed bugs e.g. commit at granularity of long long
Evaluated on benchmarks and compared performance with pthreads
Analyzed each benchmark for reasons accounting for performance variation among Dthreads and Pthreads
12/31/20139 Deterministic Execution In Multithreaded Applications
Benchmark Analysis (Part 1)
Dthreads = Pthreads
Pseudo parallel benchmarks
No synchronization primitive other than create and join
12/31/201310 Deterministic Execution In Multithreaded Applications
0.000
0.500
1.000
1.500
2.000
2.500
3.000
3.500
4.000
4.500
1 2 3
Execu
tio
n T
ime
Dataset Size (Small to Large)
String Match
pthreads
dthreads
0.000
1.000
2.000
3.000
4.000
5.000
6.000
1 2 3
Execu
tio
n T
ime
Dataset Size (Small to Large)
Matrix Multiply
pthreads
dthreads
Benchmark Analysis (Part 2)
Dthreads < Pthreads
Benefit of false sharing exposed
Parallel program where each
thread accumulates read only
input values
Running as processes means
each thread can work using
isolated memory
12/31/201311 Deterministic Execution In Multithreaded Applications
0.000
0.200
0.400
0.600
0.800
1.000
1.200
1 2 3
Execu
tio
n T
ime
Dataset Size (Small to Large)
Linear Regression
pthreads
dthreads
Benchmark Analysis (Part 3)
Dthreads > Pthreads
Multiple threads accessing
a shared data structure using
locks
Number of transactions is
very large
12/31/201312 Deterministic Execution In Multithreaded Applications
0.000
1.000
2.000
3.000
4.000
5.000
6.000
7.000
8.000
1 2 3
Execu
tio
n T
ime
Dataset Size (Small to Large)
Reverse Index
pthreads
dthreads
Possible Optimizations (Part 1)
Fine grained locking
Currently, Dthreads converts all locks into one global lock via the token mechanism
Prevents acquisition of independent locks
Can modify this to have a locked/unlocked state for every lock
Update of lock state requires token
12/31/201314 Deterministic Execution In Multithreaded Applications
Possible Optimizations (Part 2)
Handling load imbalances
Allowing user to insert explicit synch points in code
Trade off between increase in number of transactions and benefit due to load balancing
Work Ahead : Work on these optimisations and evaluate performance benefits
12/31/201315 Deterministic Execution In Multithreaded Applications
References
DTHREADS: Efficient and Deterministic Multithreading by TongpingLiu, Charlie Curtsinger, Emery D. Berger
Kendo: Efficient Deterministic Multithreading in Software by MarekOlszewski, Jason Ansel, Saman Amarasinghe
Efficient System-Enforced Deterministic Parallelism by Amittai Aviram, Shu-Chun Weng, Sen Hu, Bryan Ford
DoublePlay: Parallelizing Sequential Logging and Replay by KaushikVeeraraghavan, Dongyoon Lee, Benjamin Wester, Jessica Ouyang, Peter M. Chen, Jason Flinn, Satish Narayanasamy
Execution Replay for Multiprocessor Virtual Machines by George W. Dunlap, Dominic G. Lucchetti, Peter M. Chen, Michael A. Fetterman
ReTrace: Collecting Execution Trace with Virtual Machine Deterministic Replay by Min Xu, Vyacheslav Malyugin, Jeffrey Sheldon, GaneshVenkitachalam, Boris Weissman
12/31/201316 Deterministic Execution In Multithreaded Applications
THANK YOU
Any Question?
12/31/201317 Deterministic Execution In Multithreaded Applications