SlideShare a Scribd company logo
optimizing code in compilers using parallel genetic algorithm
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
An overview
• Introduction
• Background
• Methodology
• Experimental results
• Conclusion
2/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Compiler optimization
• Compiler optimization is the technique of minimizing or maximizing some
features of an executable code by tuning the output of a compiler.
• Modern compilers support many different optimization phases and these phases
should analyze the code and should produce semantically equivalent
performance enhanced code.
• The three vital parameters defining enhancement of the performance are:
Executiontime
Sizeofcode
Introduction
4/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
• The compiler optimization phase ordering not only possesses challenges to
compiler developer but also for multithreaded programmer to enhance the
performance of Multicore systems.
• Many compilers have numerous optimization techniques which are applied in
predetermined ordering.
• These ordering of optimization techniques may not always give an optimal code.
CODE
Search Space
Introduction
The phase ordering
4/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Optimization flags
• The variation in optimization phase ordering depends on the application that is
compiled, the architecture of the machine on which it runs and the compiler
implementation.
• Many compilers allow optimization flags to be set by the users.
• Turning on optimization flags makes the compiler attempt to improve the
performance and code size at the expense of compilation time.
Introduction
5/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
GNU compiler collection
• The GNU Compiler Collection (GCC) includes front ends for C, C++, Objective C,
Fortran, Java, Ada, and Go, as well as libraries for these languages
• In order to control compilation-time and compiler memory usage, and
the trade-offs between speed and space for the resulting executable, GCC
provides a range of general optimization levels, numbered from 0–3, as
well as individual options for specific types of optimization.
O3
O2
O1
Background
6/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Optimization levels
• The impact of the different optimization levels on the input code is as described
below:
-O0 or no-O
(default)
Optimization
Easy bug
elimination
Background
7/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Optimization levels
1. Less compile time.
2. smaller and faster
executable code.
A lot of simple
optimizations
eliminates
redundancy
-O1 or -O
Background
8/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Optimization levels
• Only optimizations that do not require any speed-space tradeoffs
are used, so the executable should not increase in size.
-O2
1. maximum
optimization without
increasing the
executable size
O1+ additional
optimizations
instruction
scheduling
1. More compile time.
2. More memory usage.the best choice
for deployment of a program
Background
8/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Optimization levels
-O3
1. faster executable
code
2. Maximum Loop
optimization
O1+ O2+
more expensive
optimizations
function
inlining
1. Bulky code
Background
8/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Optimization level
Background
9/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
The challenge
sequential quick sort Parallel quick sort
Which optimization level??
overhead of inter-process communication
Background
10/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Genetic algorithm
Initial population
Selection
Crossover & mutation
Intermediate population
(mating pool)
Replacement
Next population
Background
11/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
PGA for Compiler Optimization
• The work in this research uses GCC 4.8 compiler on Ubuntu 12.04 with OpenMP
3.0 library.
Methodology
12/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
The master-slave model
• In the master-slave model the
master runs the evolutionary
algorithm, controls the slaves
and distributes the work.
• The Slaves take batches of
individuals from the master
and evaluate them. Finally
send the calculated fitness
value back to master.
Methodology
13/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Encoding
1101011101
Methodology
14/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Fitness function
• In the proposed system the PGA works with a population of six Chromosomes on
eight core machine and fitness function is computed at the Master core.
Fitness=|(exe_with_flagi-exe_without_flagi)|
i∈ {1, 2, … . , 12}
Master Node
Generate
random
population
evaluates all
individuals
Slave nodes
algorithm
After 200 generations
Methodology
15/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Algorithm for Slave Nodes
Receives all the chromosomes from the master node with the fitness values.
The slave cores apply the roulette wheel, Stochastic Universal Sampling and Elitism
methods respectively for selection process in parallel
Create next generation applying two point crossover.
Applies mutations using method, two position interchange and produce two new
offspring/chromosomes.
Sends both the chromosomes back to the master-node. (The master collects chromosomes
from all slaves.)
Step 1
Step 2
Step 3
Step 4
Step 5
Methodology
16/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Selection
Methodology
17/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Crossover and mutation
Two point
crossover
Swap mutation
Methodology
18/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Benchmarks
• All the Bench mark programs are parallelized using OpenMP library to reap the
benefits of PGA.
Experimental results
19/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Performance analysis
• As one sees the Figures, the results after applying PGA (WGAO) presents a major
improvement with respect to the random optimization (WRO) and compiling
code without applying optimization (WOO).
Experimental results
20/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Performance analysis
Experimental results
21/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Performance analysis
Experimental results
21/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Performance analysis
Experimental results
21/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Performance analysis
Experimental results
21/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Conclusion
• In Compiler Optimization research, the phase ordering is an important
performance enhancement problem.
• This study indicates that by increasing the number of cores the performance of
the benchmark program increases along with the usage of PGA.
• The major concern in the experiment is the master core waiting time collect
values from slaves which is primarily due to the usage of Synchronized
communication between the Master-Slave cores in the system.
• Further it may be explicitly noted that apart from PRIMS algorithm for core-8
system all other Bench marks exhibit better average performance.
22/22
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
Thanks for
your attention.
Introduction Background Methodology Experimental results
Optimizing Code using Parallel Genetic Algorithm93/3/5
References
[1] Satish Kumar T., Sakthivel S. and Sushil Kumar S., “Optimizing Code by Selecting Compiler Flags
using Parallel Genetic Algorithm on Multicore CPUs,” International Journal of Engineering and
Technology, Vol. 32, No. 5, 2014.
[2] Prathibha B., Sarojadevi H., Harsha P., “Compiler Optimization: A Genetic Algorithm Approach,”
International Journal of Computer Applications, Vol. 112, No.10, 2015.
Ad

More Related Content

What's hot (20)

Agile Practices - eXtreme Programming
Agile Practices - eXtreme ProgrammingAgile Practices - eXtreme Programming
Agile Practices - eXtreme Programming
Aniruddha Chakrabarti
 
Extreme Programming ppt
Extreme Programming pptExtreme Programming ppt
Extreme Programming ppt
OECLIB Odisha Electronics Control Library
 
eXtreme programming (XP) - An Overview
eXtreme programming (XP) - An OvervieweXtreme programming (XP) - An Overview
eXtreme programming (XP) - An Overview
Gurtej Pal Singh
 
Extreme Programming (XP) for Dummies
Extreme Programming (XP) for DummiesExtreme Programming (XP) for Dummies
Extreme Programming (XP) for Dummies
Jon McNestrie
 
Introduction to Extreme Programming
Introduction to Extreme ProgrammingIntroduction to Extreme Programming
Introduction to Extreme Programming
Naresh Jain
 
XP Explained
XP ExplainedXP Explained
XP Explained
vineet
 
Xp(Xtreme Programming) presentation
Xp(Xtreme Programming) presentationXp(Xtreme Programming) presentation
Xp(Xtreme Programming) presentation
MuaazZubairi
 
extreme programming
extreme programmingextreme programming
extreme programming
himanshumunjal
 
Extreme programming
Extreme programmingExtreme programming
Extreme programming
Chuu Htet Naing
 
extreme Programming
extreme Programmingextreme Programming
extreme Programming
Bilal Shah
 
Audrys Kažukauskas - Introduction into Extreme Programming
Audrys Kažukauskas - Introduction into Extreme ProgrammingAudrys Kažukauskas - Introduction into Extreme Programming
Audrys Kažukauskas - Introduction into Extreme Programming
Agile Lietuva
 
ABC of Agile (Scrum & Extreme Programming)
ABC of Agile (Scrum & Extreme Programming)ABC of Agile (Scrum & Extreme Programming)
ABC of Agile (Scrum & Extreme Programming)
Amardeep Vishwakarma
 
Extreme Programming
Extreme ProgrammingExtreme Programming
Extreme Programming
Shankar Dahal
 
Extreme programming - a quick and agile overview !
Extreme programming - a quick and agile overview !Extreme programming - a quick and agile overview !
Extreme programming - a quick and agile overview !
Vinit Kumar Singh
 
Extreme programming
Extreme programmingExtreme programming
Extreme programming
aaina_katyal
 
Going extreme-with-extreme-programming
Going extreme-with-extreme-programmingGoing extreme-with-extreme-programming
Going extreme-with-extreme-programming
Michael Green
 
Extreme Programming
Extreme ProgrammingExtreme Programming
Extreme Programming
Knoldus Inc.
 
Extreme programming
Extreme programmingExtreme programming
Extreme programming
Mr SMAK
 
Xtreme Programming
Xtreme ProgrammingXtreme Programming
Xtreme Programming
Prasad Kancharla
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
International Islamic University Islamabad
 
Agile Practices - eXtreme Programming
Agile Practices - eXtreme ProgrammingAgile Practices - eXtreme Programming
Agile Practices - eXtreme Programming
Aniruddha Chakrabarti
 
eXtreme programming (XP) - An Overview
eXtreme programming (XP) - An OvervieweXtreme programming (XP) - An Overview
eXtreme programming (XP) - An Overview
Gurtej Pal Singh
 
Extreme Programming (XP) for Dummies
Extreme Programming (XP) for DummiesExtreme Programming (XP) for Dummies
Extreme Programming (XP) for Dummies
Jon McNestrie
 
Introduction to Extreme Programming
Introduction to Extreme ProgrammingIntroduction to Extreme Programming
Introduction to Extreme Programming
Naresh Jain
 
XP Explained
XP ExplainedXP Explained
XP Explained
vineet
 
Xp(Xtreme Programming) presentation
Xp(Xtreme Programming) presentationXp(Xtreme Programming) presentation
Xp(Xtreme Programming) presentation
MuaazZubairi
 
extreme Programming
extreme Programmingextreme Programming
extreme Programming
Bilal Shah
 
Audrys Kažukauskas - Introduction into Extreme Programming
Audrys Kažukauskas - Introduction into Extreme ProgrammingAudrys Kažukauskas - Introduction into Extreme Programming
Audrys Kažukauskas - Introduction into Extreme Programming
Agile Lietuva
 
ABC of Agile (Scrum & Extreme Programming)
ABC of Agile (Scrum & Extreme Programming)ABC of Agile (Scrum & Extreme Programming)
ABC of Agile (Scrum & Extreme Programming)
Amardeep Vishwakarma
 
Extreme programming - a quick and agile overview !
Extreme programming - a quick and agile overview !Extreme programming - a quick and agile overview !
Extreme programming - a quick and agile overview !
Vinit Kumar Singh
 
Extreme programming
Extreme programmingExtreme programming
Extreme programming
aaina_katyal
 
Going extreme-with-extreme-programming
Going extreme-with-extreme-programmingGoing extreme-with-extreme-programming
Going extreme-with-extreme-programming
Michael Green
 
Extreme Programming
Extreme ProgrammingExtreme Programming
Extreme Programming
Knoldus Inc.
 
Extreme programming
Extreme programmingExtreme programming
Extreme programming
Mr SMAK
 

Viewers also liked (20)

Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
Fatemeh Karimi
 
Clustering using GA and Hill-climbing
Clustering using GA and Hill-climbingClustering using GA and Hill-climbing
Clustering using GA and Hill-climbing
Fatemeh Karimi
 
An OpenCL Method of Parallel Sorting Algorithms for GPU Architecture
An OpenCL Method of Parallel Sorting Algorithms for GPU ArchitectureAn OpenCL Method of Parallel Sorting Algorithms for GPU Architecture
An OpenCL Method of Parallel Sorting Algorithms for GPU Architecture
Waqas Tariq
 
24 Multithreaded Algorithms
24 Multithreaded Algorithms24 Multithreaded Algorithms
24 Multithreaded Algorithms
Andres Mendez-Vazquez
 
University Assignment Literacy Assessment
University Assignment Literacy AssessmentUniversity Assignment Literacy Assessment
University Assignment Literacy Assessment
mforrester
 
Art exibition
Art exibitionArt exibition
Art exibition
maleemoha
 
Powerpoint Presentation
Powerpoint PresentationPowerpoint Presentation
Powerpoint Presentation
Sumesh SV
 
Paginas libres
Paginas libresPaginas libres
Paginas libres
INGRID
 
Data Structures by Yaman Singhania
Data Structures by Yaman SinghaniaData Structures by Yaman Singhania
Data Structures by Yaman Singhania
Yaman Singhania
 
Menupra1
Menupra1Menupra1
Menupra1
norliza khairuddin
 
huruf prasekolah
huruf prasekolahhuruf prasekolah
huruf prasekolah
norliza khairuddin
 
The Sleeping Beauty
The Sleeping BeautyThe Sleeping Beauty
The Sleeping Beauty
Inés Tarradellas
 
WhoIsFrancisFairley
WhoIsFrancisFairleyWhoIsFrancisFairley
WhoIsFrancisFairley
Francis Fairley
 
POWER POINT PRESENTATION
POWER POINT PRESENTATIONPOWER POINT PRESENTATION
POWER POINT PRESENTATION
Sumesh SV
 
POWR POINT PRESENTATION
POWR POINT PRESENTATIONPOWR POINT PRESENTATION
POWR POINT PRESENTATION
Sumesh SV
 
Clarke slideshare
Clarke slideshareClarke slideshare
Clarke slideshare
mleigh7
 
EFFECTS OF SOCIAL MEDIA ON YOUTH
EFFECTS OF SOCIAL MEDIA ON YOUTHEFFECTS OF SOCIAL MEDIA ON YOUTH
EFFECTS OF SOCIAL MEDIA ON YOUTH
Yaman Singhania
 
Getting Started with MongoDB
Getting Started with MongoDBGetting Started with MongoDB
Getting Started with MongoDB
Michael Redlich
 
Kerajaankalingga
KerajaankalinggaKerajaankalingga
Kerajaankalingga
Pak Yayak
 
Power point Presentation
Power point PresentationPower point Presentation
Power point Presentation
Sumesh SV
 
Clustering using GA and Hill-climbing
Clustering using GA and Hill-climbingClustering using GA and Hill-climbing
Clustering using GA and Hill-climbing
Fatemeh Karimi
 
An OpenCL Method of Parallel Sorting Algorithms for GPU Architecture
An OpenCL Method of Parallel Sorting Algorithms for GPU ArchitectureAn OpenCL Method of Parallel Sorting Algorithms for GPU Architecture
An OpenCL Method of Parallel Sorting Algorithms for GPU Architecture
Waqas Tariq
 
University Assignment Literacy Assessment
University Assignment Literacy AssessmentUniversity Assignment Literacy Assessment
University Assignment Literacy Assessment
mforrester
 
Art exibition
Art exibitionArt exibition
Art exibition
maleemoha
 
Powerpoint Presentation
Powerpoint PresentationPowerpoint Presentation
Powerpoint Presentation
Sumesh SV
 
Paginas libres
Paginas libresPaginas libres
Paginas libres
INGRID
 
Data Structures by Yaman Singhania
Data Structures by Yaman SinghaniaData Structures by Yaman Singhania
Data Structures by Yaman Singhania
Yaman Singhania
 
POWER POINT PRESENTATION
POWER POINT PRESENTATIONPOWER POINT PRESENTATION
POWER POINT PRESENTATION
Sumesh SV
 
POWR POINT PRESENTATION
POWR POINT PRESENTATIONPOWR POINT PRESENTATION
POWR POINT PRESENTATION
Sumesh SV
 
Clarke slideshare
Clarke slideshareClarke slideshare
Clarke slideshare
mleigh7
 
EFFECTS OF SOCIAL MEDIA ON YOUTH
EFFECTS OF SOCIAL MEDIA ON YOUTHEFFECTS OF SOCIAL MEDIA ON YOUTH
EFFECTS OF SOCIAL MEDIA ON YOUTH
Yaman Singhania
 
Getting Started with MongoDB
Getting Started with MongoDBGetting Started with MongoDB
Getting Started with MongoDB
Michael Redlich
 
Kerajaankalingga
KerajaankalinggaKerajaankalingga
Kerajaankalingga
Pak Yayak
 
Power point Presentation
Power point PresentationPower point Presentation
Power point Presentation
Sumesh SV
 
Ad

Similar to optimizing code in compilers using parallel genetic algorithm (20)

Code Optimization
Code OptimizationCode Optimization
Code Optimization
Akhil Kaushik
 
Gate-Level Simulation Methodology Improving Gate-Level Simulation Performance
Gate-Level Simulation Methodology Improving Gate-Level Simulation PerformanceGate-Level Simulation Methodology Improving Gate-Level Simulation Performance
Gate-Level Simulation Methodology Improving Gate-Level Simulation Performance
suddentrike2
 
Compiler Optimization-Space Exploration
Compiler Optimization-Space ExplorationCompiler Optimization-Space Exploration
Compiler Optimization-Space Exploration
tmusabbir
 
Microcontroller Based Testing of Digital IP-Core
Microcontroller Based Testing of Digital IP-CoreMicrocontroller Based Testing of Digital IP-Core
Microcontroller Based Testing of Digital IP-Core
VLSICS Design
 
Performance_Programming
Performance_ProgrammingPerformance_Programming
Performance_Programming
Aristotelis Kotsomitopoulos
 
Post compiler software optimization for reducing energy
Post compiler software optimization for reducing energyPost compiler software optimization for reducing energy
Post compiler software optimization for reducing energy
Abhishek Abhyankar
 
UVM_Full_Print_n.pptx
UVM_Full_Print_n.pptxUVM_Full_Print_n.pptx
UVM_Full_Print_n.pptx
nikitha992646
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
Praveen Penumathsa
 
JavaMicroBenchmarkpptm
JavaMicroBenchmarkpptmJavaMicroBenchmarkpptm
JavaMicroBenchmarkpptm
Srinivasan Raghavan
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG
Greg.Helton
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented Software
Praveen Penumathsa
 
Performance of Go on Multicore Systems
Performance of Go on Multicore SystemsPerformance of Go on Multicore Systems
Performance of Go on Multicore Systems
No J
 
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...A Framework for Scene Recognition Using Convolutional Neural Network as Featu...
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...
Tahmid Abtahi
 
Peephole optimization techniques
Peephole optimization techniquesPeephole optimization techniques
Peephole optimization techniques
garishma bhatia
 
Optimica Compiler Toolkit - Overview
Optimica Compiler Toolkit - OverviewOptimica Compiler Toolkit - Overview
Optimica Compiler Toolkit - Overview
Modelon
 
Parallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMPParallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMP
Anil Bohare
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
Soham Mondal
 
SPCC_Sem6_Chapter 6_Code Optimization part
SPCC_Sem6_Chapter 6_Code Optimization partSPCC_Sem6_Chapter 6_Code Optimization part
SPCC_Sem6_Chapter 6_Code Optimization part
NiramayKolalle
 
Code Optimization In Code Generator In Compiler Design Subject.pptx
Code Optimization In Code Generator In Compiler Design Subject.pptxCode Optimization In Code Generator In Compiler Design Subject.pptx
Code Optimization In Code Generator In Compiler Design Subject.pptx
22r11a05j2
 
AMGLAB A COMMUNITY PROBLEM SOLVING ENVIRONMENT FOR ALGEBRAIC MULTIGRID METHODS
AMGLAB  A COMMUNITY PROBLEM SOLVING ENVIRONMENT FOR ALGEBRAIC MULTIGRID METHODSAMGLAB  A COMMUNITY PROBLEM SOLVING ENVIRONMENT FOR ALGEBRAIC MULTIGRID METHODS
AMGLAB A COMMUNITY PROBLEM SOLVING ENVIRONMENT FOR ALGEBRAIC MULTIGRID METHODS
Yolanda Ivey
 
Gate-Level Simulation Methodology Improving Gate-Level Simulation Performance
Gate-Level Simulation Methodology Improving Gate-Level Simulation PerformanceGate-Level Simulation Methodology Improving Gate-Level Simulation Performance
Gate-Level Simulation Methodology Improving Gate-Level Simulation Performance
suddentrike2
 
Compiler Optimization-Space Exploration
Compiler Optimization-Space ExplorationCompiler Optimization-Space Exploration
Compiler Optimization-Space Exploration
tmusabbir
 
Microcontroller Based Testing of Digital IP-Core
Microcontroller Based Testing of Digital IP-CoreMicrocontroller Based Testing of Digital IP-Core
Microcontroller Based Testing of Digital IP-Core
VLSICS Design
 
Post compiler software optimization for reducing energy
Post compiler software optimization for reducing energyPost compiler software optimization for reducing energy
Post compiler software optimization for reducing energy
Abhishek Abhyankar
 
UVM_Full_Print_n.pptx
UVM_Full_Print_n.pptxUVM_Full_Print_n.pptx
UVM_Full_Print_n.pptx
nikitha992646
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
Praveen Penumathsa
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG
Greg.Helton
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented Software
Praveen Penumathsa
 
Performance of Go on Multicore Systems
Performance of Go on Multicore SystemsPerformance of Go on Multicore Systems
Performance of Go on Multicore Systems
No J
 
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...A Framework for Scene Recognition Using Convolutional Neural Network as Featu...
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...
Tahmid Abtahi
 
Peephole optimization techniques
Peephole optimization techniquesPeephole optimization techniques
Peephole optimization techniques
garishma bhatia
 
Optimica Compiler Toolkit - Overview
Optimica Compiler Toolkit - OverviewOptimica Compiler Toolkit - Overview
Optimica Compiler Toolkit - Overview
Modelon
 
Parallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMPParallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMP
Anil Bohare
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
Soham Mondal
 
SPCC_Sem6_Chapter 6_Code Optimization part
SPCC_Sem6_Chapter 6_Code Optimization partSPCC_Sem6_Chapter 6_Code Optimization part
SPCC_Sem6_Chapter 6_Code Optimization part
NiramayKolalle
 
Code Optimization In Code Generator In Compiler Design Subject.pptx
Code Optimization In Code Generator In Compiler Design Subject.pptxCode Optimization In Code Generator In Compiler Design Subject.pptx
Code Optimization In Code Generator In Compiler Design Subject.pptx
22r11a05j2
 
AMGLAB A COMMUNITY PROBLEM SOLVING ENVIRONMENT FOR ALGEBRAIC MULTIGRID METHODS
AMGLAB  A COMMUNITY PROBLEM SOLVING ENVIRONMENT FOR ALGEBRAIC MULTIGRID METHODSAMGLAB  A COMMUNITY PROBLEM SOLVING ENVIRONMENT FOR ALGEBRAIC MULTIGRID METHODS
AMGLAB A COMMUNITY PROBLEM SOLVING ENVIRONMENT FOR ALGEBRAIC MULTIGRID METHODS
Yolanda Ivey
 
Ad

Recently uploaded (20)

Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Journal of Soft Computing in Civil Engineering
 
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Journal of Soft Computing in Civil Engineering
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
Guru Nanak Technical Institutions
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
PawachMetharattanara
 
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic AlgorithmDesign Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Journal of Soft Computing in Civil Engineering
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdfML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
ML_Unit_V_RDC_ASSOCIATION AND DIMENSIONALITY REDUCTION.pdf
rameshwarchintamani
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Construction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil EngineeringConstruction Materials (Paints) in Civil Engineering
Construction Materials (Paints) in Civil Engineering
Lavish Kashyap
 
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
PawachMetharattanara
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 

optimizing code in compilers using parallel genetic algorithm

  • 2. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 An overview • Introduction • Background • Methodology • Experimental results • Conclusion 2/22
  • 3. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Compiler optimization • Compiler optimization is the technique of minimizing or maximizing some features of an executable code by tuning the output of a compiler. • Modern compilers support many different optimization phases and these phases should analyze the code and should produce semantically equivalent performance enhanced code. • The three vital parameters defining enhancement of the performance are: Executiontime Sizeofcode Introduction 4/22
  • 4. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 • The compiler optimization phase ordering not only possesses challenges to compiler developer but also for multithreaded programmer to enhance the performance of Multicore systems. • Many compilers have numerous optimization techniques which are applied in predetermined ordering. • These ordering of optimization techniques may not always give an optimal code. CODE Search Space Introduction The phase ordering 4/22
  • 5. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Optimization flags • The variation in optimization phase ordering depends on the application that is compiled, the architecture of the machine on which it runs and the compiler implementation. • Many compilers allow optimization flags to be set by the users. • Turning on optimization flags makes the compiler attempt to improve the performance and code size at the expense of compilation time. Introduction 5/22
  • 6. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 GNU compiler collection • The GNU Compiler Collection (GCC) includes front ends for C, C++, Objective C, Fortran, Java, Ada, and Go, as well as libraries for these languages • In order to control compilation-time and compiler memory usage, and the trade-offs between speed and space for the resulting executable, GCC provides a range of general optimization levels, numbered from 0–3, as well as individual options for specific types of optimization. O3 O2 O1 Background 6/22
  • 7. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Optimization levels • The impact of the different optimization levels on the input code is as described below: -O0 or no-O (default) Optimization Easy bug elimination Background 7/22
  • 8. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Optimization levels 1. Less compile time. 2. smaller and faster executable code. A lot of simple optimizations eliminates redundancy -O1 or -O Background 8/22
  • 9. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Optimization levels • Only optimizations that do not require any speed-space tradeoffs are used, so the executable should not increase in size. -O2 1. maximum optimization without increasing the executable size O1+ additional optimizations instruction scheduling 1. More compile time. 2. More memory usage.the best choice for deployment of a program Background 8/22
  • 10. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Optimization levels -O3 1. faster executable code 2. Maximum Loop optimization O1+ O2+ more expensive optimizations function inlining 1. Bulky code Background 8/22
  • 11. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Optimization level Background 9/22
  • 12. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 The challenge sequential quick sort Parallel quick sort Which optimization level?? overhead of inter-process communication Background 10/22
  • 13. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Genetic algorithm Initial population Selection Crossover & mutation Intermediate population (mating pool) Replacement Next population Background 11/22
  • 14. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 PGA for Compiler Optimization • The work in this research uses GCC 4.8 compiler on Ubuntu 12.04 with OpenMP 3.0 library. Methodology 12/22
  • 15. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 The master-slave model • In the master-slave model the master runs the evolutionary algorithm, controls the slaves and distributes the work. • The Slaves take batches of individuals from the master and evaluate them. Finally send the calculated fitness value back to master. Methodology 13/22
  • 16. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Encoding 1101011101 Methodology 14/22
  • 17. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Fitness function • In the proposed system the PGA works with a population of six Chromosomes on eight core machine and fitness function is computed at the Master core. Fitness=|(exe_with_flagi-exe_without_flagi)| i∈ {1, 2, … . , 12} Master Node Generate random population evaluates all individuals Slave nodes algorithm After 200 generations Methodology 15/22
  • 18. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Algorithm for Slave Nodes Receives all the chromosomes from the master node with the fitness values. The slave cores apply the roulette wheel, Stochastic Universal Sampling and Elitism methods respectively for selection process in parallel Create next generation applying two point crossover. Applies mutations using method, two position interchange and produce two new offspring/chromosomes. Sends both the chromosomes back to the master-node. (The master collects chromosomes from all slaves.) Step 1 Step 2 Step 3 Step 4 Step 5 Methodology 16/22
  • 19. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Selection Methodology 17/22
  • 20. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Crossover and mutation Two point crossover Swap mutation Methodology 18/22
  • 21. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Benchmarks • All the Bench mark programs are parallelized using OpenMP library to reap the benefits of PGA. Experimental results 19/22
  • 22. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Performance analysis • As one sees the Figures, the results after applying PGA (WGAO) presents a major improvement with respect to the random optimization (WRO) and compiling code without applying optimization (WOO). Experimental results 20/22
  • 23. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Performance analysis Experimental results 21/22
  • 24. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Performance analysis Experimental results 21/22
  • 25. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Performance analysis Experimental results 21/22
  • 26. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Performance analysis Experimental results 21/22
  • 27. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Conclusion • In Compiler Optimization research, the phase ordering is an important performance enhancement problem. • This study indicates that by increasing the number of cores the performance of the benchmark program increases along with the usage of PGA. • The major concern in the experiment is the master core waiting time collect values from slaves which is primarily due to the usage of Synchronized communication between the Master-Slave cores in the system. • Further it may be explicitly noted that apart from PRIMS algorithm for core-8 system all other Bench marks exhibit better average performance. 22/22
  • 28. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 Thanks for your attention.
  • 29. Introduction Background Methodology Experimental results Optimizing Code using Parallel Genetic Algorithm93/3/5 References [1] Satish Kumar T., Sakthivel S. and Sushil Kumar S., “Optimizing Code by Selecting Compiler Flags using Parallel Genetic Algorithm on Multicore CPUs,” International Journal of Engineering and Technology, Vol. 32, No. 5, 2014. [2] Prathibha B., Sarojadevi H., Harsha P., “Compiler Optimization: A Genetic Algorithm Approach,” International Journal of Computer Applications, Vol. 112, No.10, 2015.

Editor's Notes

  • #5: search space for attempting optimization phase sequences is
  翻译: