Document

Parallel Reachability Analysis of Hybrid
Systems in XSpeed
Rajarshi Ray (NIT Meghalaya, India)
Joint Work with
Amit Gurung, Arup Deka (NIT Meghalaya, India),
Ezio Bartocci (TU Wien, Austria), Sergiy Bogomolov (ANU Australia),
Radu Grosu (TU Wien, Austria)
Dagstuhl Seminar 16491
Symbolic-Numeric Methods for Reliable and Trustworthy
Problem Solving in CPS
Outline
• Reachability Analysis Algorithm for Hybrid Automata
• Parallelizing Hybrid Automata Traversal
• G.J. Holzmann’s Parallel BFS in the SPIN model checker
• Load Balancing Parallel BFS of HA
• Results
Reachability Analysis Algorithm
T>=38
Wlist = Init; R = ф
YES
Wlist is ф
No
T<=12
S = Wlist.pop
PostC
R = R ᴜ PostC(S)
R’ = PostD(R)
Add R’ to Wlist
No
R contains R’
Cooling ON
T >= 10
T’=-2
Cooling OFF
T>= 0 & T <= 40
T’=1
YES
PostD
HA Breadth First Search
BAD
BAD
GOOD
INIT
INIT
Wlist
BFS Depth
1
2
3
4
GOOD
Parallel Breadth First Search
BFS Depth
1
2
4
3
Wlist
THREADS
PostC, PostD
Schedule Threads to Cores
CORE
CORE
…
CORE
CORE
Processor
Parallel Breadth First Search
BFS Depth
1
2
4
3
Wlist
Wlist is a Shared
Data Structure
RACE CONDITION!!
THREADS
PostC, PostD
Schedule Threads to Cores
CORE
CORE
…
CORE
CORE
Processor
Lock Free Parallel Breadth First Search
(Proposed by G.J. Holzmann)
1
2
3
Wlist[0][N][N]
4
1
2
3
Wlist[1][N][N]
• Keep two copies of Wlist, One for Reading and One for Writing
• Swap Read and Write Copies after each BFS Iteration
• Load balance by random distribution of symbolic states
4
Lock Free Parallel Breadth First Search
(Proposed by G.J. Holzmann)
1
Wlist[0][N][N]
2
3
Wlist[1][N][N]
• Keep two copies of Wlist, One for Reading and One for Writing
• Swap Read and Write Copies after each BFS Iteration
• Load balance by random distribution of symbolic states
4
Lock Free Parallel Breadth First Search
(Proposed by G.J. Holzmann)
1
2
3
Wlist[0][N][N]
4
1
2
3
Wlist[1][N][N]
• Keep two copies of Wlist, One for Reading and One for Writing
• Swap Read and Write Copies after each BFS Iteration
• Load balance by random distribution of symbolic states
4
Lock Free Parallel Breadth First Search
(Proposed by G.J. Holzmann)
1
2
3
Wlist[0][N][N]
4
1
2
3
Wlist[1][N][N]
• Keep two copies of Wlist, One for Reading and One for Writing
• Swap Read and Write Copies after each BFS Iteration
• Load balance by random distribution of symbolic states
4
Results on Adapted Holzmann’s Algorithm
(4 core Processor)
CPU Utilization
Is not great!
Load Balancing Problem
BFS Level 2
BFS Level 3
Support Function Representation
Support function provides a functional representation of a compact convex
set.
It provides an approximation of a convex set by finitely many samplings:
13
PostC operation using Support Functions
[Le Guernic, Girard]
Dynamics:
14
PostC operation using Support Functions
[Le Guernic, Girard]
• Computes polygonal approximations of
in the template directions
• Polygonal approximation computation is computed by sampling support functions,
which we consider as the atomic tasks.
15
Task Parallel Algorithm
BFS Depth
K-1
K
Wlist
K+1
…
Evaluate the Total Atomic Tasks
Atomic Tasks Distribution
Schedule Threads to Cores
CORE
CORE
…
CORE
CORE
Processor
Performance Results (12 Core Intel Xeon CPU)
OpenMP threads implementation
Performance Results (12 Core Intel Xeon CPU)
Results (CPU Utilization)
Results (CPU Utilization)
Tool Structure
Conclusion
• Parallel reachability algorithms can
improve performance of tools for
hybrid systems by exploiting the
multi-core architectures
• The proposed parallel algorithms are
implemented in the tool XSpeed.
• XSpeed is Available online.
Thank you!