The document presents an approach for measuring potential parallelism in object-oriented programs by tracing dynamic dependencies, detecting parallelism via a dynamic dependence graph, and suggesting parallelization candidates, especially loops on the critical path. It does this in three main steps: 1) Tracing dynamic dependencies during program execution, 2) Identifying parallel and serial computation paths in the dynamic dependence graph, and 3) Ranking loops on the critical path by their potential for parallel speedup. An example Java program is given and its parallel execution schedule across 4 threads is shown.
Disha NEET Physics Guide for classes 11 and 12.pdf
Profiling Java Programs for Parallelism
1. Profiling Java Programs for
Parallelism
Authors: Clemens Hammacher, Kevin Streit,
Sebastian Hack and Andreas Zeller
Presented by:
Anisimov Dmitry (Theoretical part)
Igdalov Dimitri (Demo)
2. Challenge
How to leverage the computer power of
multicore architectures for systems that were
not built with parallelism in mind?
3. The idea of article
To try to measure the potential for parallel
execution in recent object-oriented programs.
4. Approach of authors
Three main steps:
Tracing dynamic dependencies
Detecting parallelism
Suggesting parallelization candidates
5. Tracing dynamic dependences (1)
Trace is a program P(D) obtained by running
a program P on some input D.
The basis of parallelism-detection algorithm
is the execution trace of a program run on a
specific input.
6. Tracing dynamic dependences (2)
During tracing we define dynamic dependencies:
If instruction B of program consumes values
computed by A then B is data dependent on
A and must be executed after A.
7. Detecting parallelism (1)
The dynamic dependencies form a dynamic
dependence graph.
This graph describes how the
individual instructions transitively depend
on and influence each other.
8. Detecting parallelism (2)
In the dynamic dependence graph we can
identify parallel as well as serial computation
paths.
The main serial path is critical path H.
Critical path H is longest path whose
instructions must be executed sequentially.
9. Detecting parallelism (3)
Ideal speed-up factor of parallelization is n/k
where n is the length of program P and k is
the length of critical path H.
10. Suggesting parallelization
candidates
Loops placed on critical path H are the most
interesting portion of P w.r.t. parallelization.
Loops are ranked w.r.t. the potential gain on
the execution of program P.
11. Example (1)
Public static void main(String[] args) {
int n = Integer. parseInt(args[0]);
long[] sums = new long[n]
long overallSum = 0;
for (int i = 0; i < n; ++i) {
sums[i] = sumTo(i);
}
for (int i = 0; i < n; ++i) {
overallSum += sums[i];
}
}
private static long sumTo(int n) {
return n == 0 ? 0 : n + sumTo(n – 1);
}