SlideShare a Scribd company logo
Profiling Java Programs for
           Parallelism
Authors: Clemens Hammacher, Kevin Streit,
   Sebastian Hack and Andreas Zeller



Presented by:
Anisimov Dmitry (Theoretical part)
Igdalov Dimitri (Demo)
Challenge


  How to leverage the computer power of
multicore architectures for systems that were
     not built with parallelism in mind?
The idea of article


 To try to measure the potential for parallel
execution in recent object-oriented programs.
Approach of authors

Three main steps:

    Tracing dynamic dependencies

    Detecting parallelism

    Suggesting parallelization candidates
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.
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.
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.
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.
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.
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.
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);
}
Example (2)
Example (3)
Example (4)
Results for example

We have 4 threads for parallel execution:

    Thread 0: 0 2 4 5 10

    Thread 1: 1 3

    Thread 2: 7 8

    Thread 3: 6 9
Thank you


The End

More Related Content

PDF
Homomorphic encryption in_cloud
PDF
14 - 08 Feb - Dynamic Programming
PPTX
Big o notation
PPTX
A* Algorithm
PDF
Lecture 12
PPTX
Big o notation
PDF
I.BEST FIRST SEARCH IN AI
PPTX
Homomorphic encryption and Private Machine Learning Classification
Homomorphic encryption in_cloud
14 - 08 Feb - Dynamic Programming
Big o notation
A* Algorithm
Lecture 12
Big o notation
I.BEST FIRST SEARCH IN AI
Homomorphic encryption and Private Machine Learning Classification

What's hot (19)

PPTX
Complexity analysis in Algorithms
PPTX
(Icca 2014) shortest path analysis in social graphs
PPT
Graph-Based Code Completion
PPT
PPTX
ICDE-2015 Shortest Path Traversal Optimization and Analysis for Large Graph C...
PPTX
A* algorithm
PPS
Serious Games + Computer Science = Serious CS
PDF
A novel technique for speech encryption based on k-means clustering and quant...
PDF
I.ITERATIVE DEEPENING DEPTH FIRST SEARCH(ID-DFS) II.INFORMED SEARCH IN ARTIFI...
PDF
Introduction to Bayesian Analysis in Python
PDF
PDF
Low Power FPGA Based Elliptical Curve Cryptography
PDF
A57040102
PDF
A calculus of mobile Real-Time processes
PDF
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
PDF
Variational Inference in Python
PDF
A new RSA public key encryption scheme with chaotic maps
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
PPTX
Algorithm and complexity
Complexity analysis in Algorithms
(Icca 2014) shortest path analysis in social graphs
Graph-Based Code Completion
ICDE-2015 Shortest Path Traversal Optimization and Analysis for Large Graph C...
A* algorithm
Serious Games + Computer Science = Serious CS
A novel technique for speech encryption based on k-means clustering and quant...
I.ITERATIVE DEEPENING DEPTH FIRST SEARCH(ID-DFS) II.INFORMED SEARCH IN ARTIFI...
Introduction to Bayesian Analysis in Python
Low Power FPGA Based Elliptical Curve Cryptography
A57040102
A calculus of mobile Real-Time processes
I.INFORMED SEARCH IN ARTIFICIAL INTELLIGENCE II. HEURISTIC FUNCTION IN AI III...
Variational Inference in Python
A new RSA public key encryption scheme with chaotic maps
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Algorithm and complexity
Ad

Similar to Profiling Java Programs for Parallelism (20)

PDF
Chronon - A Back-In-Time-Debugger for Java
PDF
Example : parallelize a simple problem
PPTX
12. Parallel Algorithms.pptx
PPT
PPTX
Does Java Have a Future After Version 8? (Belfast JUG April 2014)
ODP
Concurrent Programming in Java
PDF
Arc 300-3 ade miller-en
PPTX
Fork and join framework
PPTX
Compiler optimizations based on call-graph flattening
PDF
SE 20016 - programming languages landscape.
PDF
Parallel Computing - Lec 5
PDF
Aq4301224227
PPTX
Parallel programming model
PPTX
parallel-asynchronous-programming-java.pptx
PPTX
Java parallel programming made simple
PDF
GPars: Parallelism the Right Way
ODP
GPars: Groovy Parallelism for Java
PDF
If You Think You Can Stay Away from Functional Programming, You Are Wrong
PDF
Why we cannot ignore Functional Programming
Chronon - A Back-In-Time-Debugger for Java
Example : parallelize a simple problem
12. Parallel Algorithms.pptx
Does Java Have a Future After Version 8? (Belfast JUG April 2014)
Concurrent Programming in Java
Arc 300-3 ade miller-en
Fork and join framework
Compiler optimizations based on call-graph flattening
SE 20016 - programming languages landscape.
Parallel Computing - Lec 5
Aq4301224227
Parallel programming model
parallel-asynchronous-programming-java.pptx
Java parallel programming made simple
GPars: Parallelism the Right Way
GPars: Groovy Parallelism for Java
If You Think You Can Stay Away from Functional Programming, You Are Wrong
Why we cannot ignore Functional Programming
Ad

Recently uploaded (20)

PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Lesson notes of climatology university.
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Cell Structure & Organelles in detailed.
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Presentation on HIE in infants and its manifestations
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
GDM (1) (1).pptx small presentation for students
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Anesthesia in Laparoscopic Surgery in India
Lesson notes of climatology university.
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Cell Structure & Organelles in detailed.
Abdominal Access Techniques with Prof. Dr. R K Mishra
STATICS OF THE RIGID BODIES Hibbelers.pdf
Presentation on HIE in infants and its manifestations
Final Presentation General Medicine 03-08-2024.pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
human mycosis Human fungal infections are called human mycosis..pptx
2.FourierTransform-ShortQuestionswithAnswers.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Final Presentation General Medicine 03-08-2024.pptx
VCE English Exam - Section C Student Revision Booklet
GDM (1) (1).pptx small presentation for students
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student

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); }
  • 15. Results for example We have 4 threads for parallel execution:  Thread 0: 0 2 4 5 10  Thread 1: 1 3  Thread 2: 7 8  Thread 3: 6 9