SlideShare uma empresa Scribd logo
1 de 40
EEDC

                          34330
Execution
Environments for                   Scientific Programming
Distributed                                 Models
Computing
Master in Computer Architecture,
Networks and Systems - CANS


                                             Group members:

                                     Francesc Lordan    francesc.lordan@bsc.es
                                       Roger Rafanell   roger.rafanell@bsc.es
Outline

Scientific Programming Models

  – Part 1: Introduction

  – Part 2: Reference parallel programming models

  – Part 3: Novel parallel programming models

  – Part 4: Conclusions

  – Part 5: Questions



                                2
Introduction

 Scientific applications:
   –   Solve complex problems
   –   Usually long run applications
   –   Implemented as a sequence of steps
   –   Each step (task) can be hard to compute
   –   So …




                                      3
Introduction
             In time terms…
Scientific applications can’t be no more
     considered in sequential way!!!
                   OK?




                    4
Introduction

      We need solutions based on distribute and
               parallelize the work.




                        5
Introduction: MPI

1980s - early 1990s: Distributed memory & parallel computing started
as a bunch of incompatible software tools for writing programs.

 MPI (Message Passing Interface)
    becomes at 1994 a new reference
    standard.
   It provides:
     –   Portability
     –   Performance
     –   Functionality
     –   Availability (many implementations)


 Good for: Parallelize the processing by distributing the work among
            different machines/nodes.


                                               6
Introduction: OpenMP
In the early 90's: Vendors of shared-memory machines supplied similar,
directive-based for Fortran programming extensions:

 The user can extend a serial Fortran program with directives specifying
    which loops were to be parallelized.
   The compiler automatically parallelize such loops across the SMP
    processors.
   Implementations were all functionally similar, but were diverging (as usual).




 Good for: Parallelize the computation among all the resources of a
single machine.


                                         7
Reference PM: OpenMP
Programming model:
 Computation is done by threads.
 Fork-join model: Threads are dynamically created and destroyed.
 Programmer can specify which variables are shared among threads
  and which are private.




                                 8
Reference PM: OpenMP
 Example of sequential PI calculation




                           9
Reference PM: OpenMP
 Example of OpenMP PI calculation




                         10
Reference PM: OpenMP
Strong Points:
   –   Keeps the sequential version.
   –   Communication is implicit.
   –   Easy to program, debug and modify.
   –   Good performance and scalability.


Weaknesses:
   – Communication is implicit (less control).
   – Simple and flat memory model (does not run on clusters).
   – No support for accelerators.




                                     11
Reference PM: MPI
Programming model:
 Computation is done by several processes that execute the same program.
 Communicates by passing data (send/receive).
 Programmer decides:
    – Which role the process plays by branches.
    – Orders which communications are done.




                                     12
Reference PM: MPI
 Example of MPI PI calculation




                          13
Reference PM: MPI
Strong Points:
  –   Any parallel algorithm can be expressed in terms of the MPI paradigm.
  –   Data placement problems are rarely observed.
  –   Suitable for clusters/supercomputers (large number of processors).
  –   Excellent performance and scalable.


Weaknesses:
  – Communication is explicit.
  – Re-fitting serial code using MPI often requires refactoring.
  – Dynamic load balancing is difficult to implement.




                                     14
Reference PM: The best of both worlds
 Hybrid (MPI + OpenMP):
  – MPI is most effective for problems with “course-grained” parallelism.
  – “Fine-grain” parallelization is successfully handled by OpenMP.


 When use hybrid programming?
  – The code exhibits limited scaling with MPI.
  – The code could make use of dynamic load balancing.
  – The code exhibits fine-grained or a combination of both fine-grained and
    course-grained parallelism.


 Some algorithms, such as computational fluid
  dynamics, benefit greatly from a hybrid approach!!!


                                     15
Reference PM: Hybrid (MPI + OpenMP)
 Example of MPI + OpenMP PI calculation




                         16
Reference PM: New reference approaches
 Heterogeneous parallel-computing:
  – CUDA (From NVIDIA)
  – OpenCL (Open Compute Language)
  – Cross-platform
      • Implementations for
         – ATI GPUs
         – NVIDIA GPUs
         – x86 CPUs

  – API similar to OpenGL.
  – Based on C.




                              17
Novel PMs

 Workflows:
  –   Based on processes
  –   Requires planning and scheduling
  –   Needs flow control
  –   In-transit visibility



 Novel PMs:
  – Complex problems require simple solutions
    (non reference PMs based)




                                    18
Microsoft Dryad
 The Dryad Project is investigating programming model
  for writing parallel and distributed programs to scale from
  a small cluster to a large data-center.

 Theoretical approach (not used)
   – Last and unique publication on 2007.


 User defines:
   – a set of methods
   – a task dependency graph with a specific language.




                                    19
Microsoft Dryad
GraphBuilder Xset = moduleX^N;
GraphBuilder Dset = moduleD^N;
GraphBuilder Mset = moduleM^(N*4);
GraphBuilder Sset = moduleS^(N*4);
GraphBuilder Yset = moduleY^N;
GraphBuilder Hset = moduleH^1;

GraphBuilder XInputs = (ugriz1 >= XSet) || (neighbor >= XSet);
GraphBuilder YInputs = ugriz2 >= YSet;
GraphBuilder XToY = XSet >= DSet >> MSet >= SSet;
for (i = 0; i < N*4; ++i){
     XToY = XToY || (SSet.GetVertex(i) >= YSet.GetVertex(i/4));
}

GraphBuilder YToH = YSet >= HSet;
GraphBuilder HOutputs = HSet >= output;
GraphBuilder final = XInputs || YInputs || XToY || YToH || HOutputs;




                                            20
MapReduce
 Programmer only defines 2 functions
   – Map(KInput,VInput) list(Ktemp,Vtemp)
   – Reduce(Ktemp, list(Vtemp))list(Vtemp)


 The library is in charge of all the rest




                                             21
MapReduce

 Weaknesses
  – Specific programming.
  – Not easy to find key value pairs.


 Strong points
  – Efficiency.
  – Simplicity of the model.
  – Community and tools.




                                 22
The COMP Superscalar (COMPSs)




                23
COMPSs overview - Objective
 Reduce the development complexity of
  Grid/Cluster/Cloud applications to the minimum
   – As easy as writing a sequential application.


 Target applications: composed of tasks, most of them
  repetitive
   – Granularity of the tasks of the level of simulations or programs.
   – Data: files, objects, arrays, primitive types.




                                   24
COMPSs overview - Main idea
                                                                                                Parallel Resources
                                 (a) Task selection +

 Sequential Code                 parameters direction
                                                                                                   Resource 1
 ...
 for (i=0; i<N; i++){
                             (
                             (input,      output, inout)
     T1 (data1, data2);
     T2 (data4, data5);
     T3 (data2, data5, data6);
     T4 (data7, data8);
     T5 (data6, data8, data9);                              (d) Task completion,
 }
 ...                                                                                               Resource 2
                                                              synchronization


                           T10          T20


                                  T30
                                              T40
                                                                                                        .   ..
     (b) Task graph creation            T50
                                                T11          T21                                   Resource N
          based on data                                                    (c) Scheduling,
                                                                    T41
                                                      T31
          dependencies                                                         data transfer,
                                                             T51               task execution
                                                                     T12

                                                                           …


                                                               25
Programming model - Sample application
  Main program
  public void main(){
          Integer sum=0;
          double pi
          double step=1.0d /(double) num_steps;
          for (int i=0;i<num_steps;i++){
                    computeInterval (i, step,sum);
          }
          pi = sum * step;
  }


        Subroutine
          public static void computeInterval (int index, int step, Integer acum) {
                   int x = (index -0.5) * step;
                   acum = acum + 4.0/(1.0+x*x);
          }




                                          26
Programming Model - Task Selection
                                                Task selection interface

public interface PiItf {
                                                        Implementation
         @Method(declaringClass = “Pi")
         void computeInterval(
                @Parameter(direction = IN)
                int index,
                @Parameter(direction = IN)
                int step,
                @Parameter(direction = INOUT)                Parameter
                Integer index,                               metadata
         );

}




                                                                           13
                                         27
Programming Model – Main code

   public static void main(String[] args) {
            Integer sum=0;
            double pi
            double step=1.0d /(double) num_steps;
                                                             NO CHANGES!
            for (int i=0;i<num_steps;i++){
                      computeInterval (i, step, sum);
            }
            pi = sum * step;
   }



                  1
0
          Compute Step            Compute           …   N-1
                                                        Step   Compute
                                                                         sum SYNCH
Step       Interval                Interval                     Interval
sum                     sum                   sum          sum




                                               28
Programming Model – Real Example
HMMER
    Protein Database              Aminoacid Sequence


                                  IQKKSGKWHTLTDLRA
                                  VNAVIQPMGPLQPGLP
                                  SPAMIPKDWPLIIIDLK
                                  DCFFTIPLAEQDCEKFA
                                  FTIPAINNKEPATRF

                       Model      Score E-value N
                       --------   ------ --------- ---
                       IL6_2      -78.5    0.13 1
                       COLFI_2    -164.5   0.35 1
                       pgtp_13    -36.3    0.48 1
                       clf2       -15.6    3.6     1
                       PKD_9      -24.0    5       1
                          29
Programming Model – Real Example




Aminoacid
sequence




                     30
Programming Model – Real Example

String[] outputs = new String[numDBFrags];

//Process
for (String dbFrag : dbFrags) {
     outputs[dbNum]= HMMPfamImpl.hmmpfam(sequence, dbFrag);
}


//Merge
int neighbor = 1;
while (neighbor < numDBFrags) {
  for (int db = 0; db < numDBFrags; db += 2 * neighbor) {
     if (db + neighbor < numDBFrags) {
        HMMPfamImpl.merge(outputs[db], outputs[db + neighbor]);
     }
  }
  neighbor *= 2;
}



                                             31
Programming Model – Real Example
public interface HMMPfamItf {

    @Method(declaringClass = "worker.hmmerobj.HMMPfamImpl")
    String hmmpfam(
          @Parameter(type = Type.FILE, direction = Direction.IN)
          String seqFile,
          @Parameter(type = Type.STRING, direction = Direction.IN)
          String dbFile
    );

    @Method(declaringClass = "worker.hmmerobj.HMMPfamImpl")
    void scoreRatingSameDB(
          @Parameter(type = Type.OBJECT, direction = Direction.INOUT)
          String resultFile1,
          @Parameter(type = Type.OBJECT, direction = Direction.IN)
          String resultFile2
    );
}

                                      32
Programming Model – Real Example




                   33
Programming Model – Real Example




                   34
COMPSs

 Strong points
  –   Sequential programming approach
  –   Parallelization at task level
  –   Transparent data management and remote execution
  –   Can operate on different infrastructures:
       • Cluster/Grid
       • Cloud (Public/Private)
            – PaaS
            – IaaS
       • Web services
 Weaknesses:
  – Under continuous development
  – Does not offer binding to other languages (currently)



                                  35
Tutorial
 Sample & Development Virtual Appliance
   – http://bscgrid06.bsc.es/~lezzi/vms/COMPSs_Tutorial.ova


 Tutorial
   – http://bscgrid06.bsc.es/~lezzi/ppts/tutorial-Life.ppt




                                    36
Manjrasoft Aneka
 .NET based Platform-as-a-Service
 Allows the usage of:
   – Private Clouds.
   – Public Clouds: Amazon EC2, Azure, GoGrid.
 Offers mechanisms to control, reserve and monitoring
  the resources.
   – Also offers autoscale mechanisms.
 3 programming models
   – Task-based: tasks are put in a bag of executable tasks.
   – Thread-based: exposes the .NET thread API but they are remotely
     created.
   – MapReduce


 No data dependency analysis!!
                                   37
Microsoft Azure
 .NET based Platform-as-a-Service
 Computing services
  – Web Role: Web Service frontend.
  – Worker Role: Backend.
 Storage Services

                                       Strong Point
                                         – Scalable architecture.


                                       Weakness
                                         – Platform-tied applications.



                                 38
Conclusions

 Scientific problems are usually complex.

 Current reference PMs are usually unsuitable.

 New novel & flexible PMs came into the game.

 Existing gap between scientifics and user-friendly
  workflow-oriented programming models.

 A sea of available solutions (DSLs)


                             39
Questions




            40

Mais conteúdo relacionado

Mais procurados

Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manualamanabr
 
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...ijma
 
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...cscpconf
 
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...csandit
 
Fundamentals of Image Processing & Computer Vision with MATLAB
Fundamentals of Image Processing & Computer Vision with MATLABFundamentals of Image Processing & Computer Vision with MATLAB
Fundamentals of Image Processing & Computer Vision with MATLABAli Ghanbarzadeh
 
Summer training matlab
Summer training matlab Summer training matlab
Summer training matlab Arshit Rai
 
Parallel sorting algorithm
Parallel sorting algorithmParallel sorting algorithm
Parallel sorting algorithmRicha Kumari
 
Collective Communications in MPI
 Collective Communications in MPI Collective Communications in MPI
Collective Communications in MPIHanif Durad
 
WVKULAK13_submission_14
WVKULAK13_submission_14WVKULAK13_submission_14
WVKULAK13_submission_14Max De Koninck
 
Simulating communication systems with MATLAB: An introduction
Simulating communication systems with MATLAB: An introductionSimulating communication systems with MATLAB: An introduction
Simulating communication systems with MATLAB: An introductionAniruddha Chandra
 

Mais procurados (19)

Parallel Algorithms
Parallel AlgorithmsParallel Algorithms
Parallel Algorithms
 
MATLAB & Image Processing
MATLAB & Image ProcessingMATLAB & Image Processing
MATLAB & Image Processing
 
Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
 
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
Implementation Of Grigoryan FFT For Its Performance Case Study Over Cooley-Tu...
 
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...
PERFORMANCE EVALUATIONS OF GRIORYAN FFT AND COOLEY-TUKEY FFT ONTO XILINX VIRT...
 
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...
Performance evaluations of grioryan fft and cooley tukey fft onto xilinx virt...
 
Parallel computation
Parallel computationParallel computation
Parallel computation
 
60
6060
60
 
Fundamentals of Image Processing & Computer Vision with MATLAB
Fundamentals of Image Processing & Computer Vision with MATLABFundamentals of Image Processing & Computer Vision with MATLAB
Fundamentals of Image Processing & Computer Vision with MATLAB
 
Summer training matlab
Summer training matlab Summer training matlab
Summer training matlab
 
Parallel sorting algorithm
Parallel sorting algorithmParallel sorting algorithm
Parallel sorting algorithm
 
Dcp project
Dcp projectDcp project
Dcp project
 
Collective Communications in MPI
 Collective Communications in MPI Collective Communications in MPI
Collective Communications in MPI
 
matlab_simulink_for_control082p.pdf
matlab_simulink_for_control082p.pdfmatlab_simulink_for_control082p.pdf
matlab_simulink_for_control082p.pdf
 
WVKULAK13_submission_14
WVKULAK13_submission_14WVKULAK13_submission_14
WVKULAK13_submission_14
 
Chapter 4 pc
Chapter 4 pcChapter 4 pc
Chapter 4 pc
 
++Matlab 14 sesiones
++Matlab 14 sesiones++Matlab 14 sesiones
++Matlab 14 sesiones
 
Chap12 slides
Chap12 slidesChap12 slides
Chap12 slides
 
Simulating communication systems with MATLAB: An introduction
Simulating communication systems with MATLAB: An introductionSimulating communication systems with MATLAB: An introduction
Simulating communication systems with MATLAB: An introduction
 

Semelhante a EEDC Programming Models

OpenMP tasking model: from the standard to the classroom
OpenMP tasking model: from the standard to the classroomOpenMP tasking model: from the standard to the classroom
OpenMP tasking model: from the standard to the classroomFacultad de Informática UCM
 
Pysense: wireless sensor computing in Python?
Pysense: wireless sensor computing in Python?Pysense: wireless sensor computing in Python?
Pysense: wireless sensor computing in Python?Davide Carboni
 
Data Analytics and Simulation in Parallel with MATLAB*
Data Analytics and Simulation in Parallel with MATLAB*Data Analytics and Simulation in Parallel with MATLAB*
Data Analytics and Simulation in Parallel with MATLAB*Intel® Software
 
Parallel Programming on the ANDC cluster
Parallel Programming on the ANDC clusterParallel Programming on the ANDC cluster
Parallel Programming on the ANDC clusterSudhang Shankar
 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELJoel Falcou
 
IS-ENES COMP Superscalar tutorial
IS-ENES COMP Superscalar tutorialIS-ENES COMP Superscalar tutorial
IS-ENES COMP Superscalar tutorialRoger Rafanell Mas
 
Madeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable HardwareMadeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable HardwareESUG
 
Introduction to map reduce
Introduction to map reduceIntroduction to map reduce
Introduction to map reduceM Baddar
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsZvi Avraham
 
Parallel Computing-Part-1.pptx
Parallel Computing-Part-1.pptxParallel Computing-Part-1.pptx
Parallel Computing-Part-1.pptxkrnaween
 
On the Necessity and Inapplicability of Python
On the Necessity and Inapplicability of PythonOn the Necessity and Inapplicability of Python
On the Necessity and Inapplicability of PythonTakeshi Akutsu
 
On the necessity and inapplicability of python
On the necessity and inapplicability of pythonOn the necessity and inapplicability of python
On the necessity and inapplicability of pythonYung-Yu Chen
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm AnalysisMary Margarat
 

Semelhante a EEDC Programming Models (20)

OpenMP tasking model: from the standard to the classroom
OpenMP tasking model: from the standard to the classroomOpenMP tasking model: from the standard to the classroom
OpenMP tasking model: from the standard to the classroom
 
MapReduce basics
MapReduce basicsMapReduce basics
MapReduce basics
 
Pysense: wireless sensor computing in Python?
Pysense: wireless sensor computing in Python?Pysense: wireless sensor computing in Python?
Pysense: wireless sensor computing in Python?
 
Data Analytics and Simulation in Parallel with MATLAB*
Data Analytics and Simulation in Parallel with MATLAB*Data Analytics and Simulation in Parallel with MATLAB*
Data Analytics and Simulation in Parallel with MATLAB*
 
Parallel Programming on the ANDC cluster
Parallel Programming on the ANDC clusterParallel Programming on the ANDC cluster
Parallel Programming on the ANDC cluster
 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSEL
 
parallel-computation.pdf
parallel-computation.pdfparallel-computation.pdf
parallel-computation.pdf
 
IS-ENES COMP Superscalar tutorial
IS-ENES COMP Superscalar tutorialIS-ENES COMP Superscalar tutorial
IS-ENES COMP Superscalar tutorial
 
Madeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable HardwareMadeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable Hardware
 
Introduction to map reduce
Introduction to map reduceIntroduction to map reduce
Introduction to map reduce
 
Chap 1(one) general introduction
Chap 1(one)  general introductionChap 1(one)  general introduction
Chap 1(one) general introduction
 
Pregel
PregelPregel
Pregel
 
CS4961-L9.ppt
CS4961-L9.pptCS4961-L9.ppt
CS4961-L9.ppt
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming Models
 
Parallel Computing-Part-1.pptx
Parallel Computing-Part-1.pptxParallel Computing-Part-1.pptx
Parallel Computing-Part-1.pptx
 
main
mainmain
main
 
On the Necessity and Inapplicability of Python
On the Necessity and Inapplicability of PythonOn the Necessity and Inapplicability of Python
On the Necessity and Inapplicability of Python
 
On the necessity and inapplicability of python
On the necessity and inapplicability of pythonOn the necessity and inapplicability of python
On the necessity and inapplicability of python
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm Analysis
 
Using Parallel Computing Platform - NHDNUG
Using Parallel Computing Platform - NHDNUGUsing Parallel Computing Platform - NHDNUG
Using Parallel Computing Platform - NHDNUG
 

Mais de Roger Rafanell Mas

How to build a self-service data platform and what it can do for your business?
How to build a self-service data platform and what it can do for your business?How to build a self-service data platform and what it can do for your business?
How to build a self-service data platform and what it can do for your business?Roger Rafanell Mas
 
Activate 2019 - Search and relevance at scale for online classifieds
Activate 2019 - Search and relevance at scale for online classifiedsActivate 2019 - Search and relevance at scale for online classifieds
Activate 2019 - Search and relevance at scale for online classifiedsRoger Rafanell Mas
 
Storm distributed cache workshop
Storm distributed cache workshopStorm distributed cache workshop
Storm distributed cache workshopRoger Rafanell Mas
 
Profiling & Testing with Spark
Profiling & Testing with SparkProfiling & Testing with Spark
Profiling & Testing with SparkRoger Rafanell Mas
 
MRI Energy-Efficient Cloud Computing
MRI Energy-Efficient Cloud ComputingMRI Energy-Efficient Cloud Computing
MRI Energy-Efficient Cloud ComputingRoger Rafanell Mas
 
EEDC Intelligent Placement of Datacenters
EEDC Intelligent Placement of DatacentersEEDC Intelligent Placement of Datacenters
EEDC Intelligent Placement of DatacentersRoger Rafanell Mas
 

Mais de Roger Rafanell Mas (12)

How to build a self-service data platform and what it can do for your business?
How to build a self-service data platform and what it can do for your business?How to build a self-service data platform and what it can do for your business?
How to build a self-service data platform and what it can do for your business?
 
Activate 2019 - Search and relevance at scale for online classifieds
Activate 2019 - Search and relevance at scale for online classifiedsActivate 2019 - Search and relevance at scale for online classifieds
Activate 2019 - Search and relevance at scale for online classifieds
 
Pensamiento lateral
Pensamiento lateralPensamiento lateral
Pensamiento lateral
 
Storm distributed cache workshop
Storm distributed cache workshopStorm distributed cache workshop
Storm distributed cache workshop
 
Profiling & Testing with Spark
Profiling & Testing with SparkProfiling & Testing with Spark
Profiling & Testing with Spark
 
MRI Energy-Efficient Cloud Computing
MRI Energy-Efficient Cloud ComputingMRI Energy-Efficient Cloud Computing
MRI Energy-Efficient Cloud Computing
 
SDS Amazon RDS
SDS Amazon RDSSDS Amazon RDS
SDS Amazon RDS
 
EEDC Intelligent Placement of Datacenters
EEDC Intelligent Placement of DatacentersEEDC Intelligent Placement of Datacenters
EEDC Intelligent Placement of Datacenters
 
EEDC Everthing as a Service
EEDC Everthing as a ServiceEEDC Everthing as a Service
EEDC Everthing as a Service
 
EEDC Apache Pig Language
EEDC Apache Pig LanguageEEDC Apache Pig Language
EEDC Apache Pig Language
 
EEDC Distributed Systems
EEDC Distributed SystemsEEDC Distributed Systems
EEDC Distributed Systems
 
EEDC SOAP vs REST
EEDC SOAP vs RESTEEDC SOAP vs REST
EEDC SOAP vs REST
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

EEDC Programming Models

  • 1. EEDC 34330 Execution Environments for Scientific Programming Distributed Models Computing Master in Computer Architecture, Networks and Systems - CANS Group members: Francesc Lordan francesc.lordan@bsc.es Roger Rafanell roger.rafanell@bsc.es
  • 2. Outline Scientific Programming Models – Part 1: Introduction – Part 2: Reference parallel programming models – Part 3: Novel parallel programming models – Part 4: Conclusions – Part 5: Questions 2
  • 3. Introduction  Scientific applications: – Solve complex problems – Usually long run applications – Implemented as a sequence of steps – Each step (task) can be hard to compute – So … 3
  • 4. Introduction In time terms… Scientific applications can’t be no more considered in sequential way!!! OK? 4
  • 5. Introduction We need solutions based on distribute and parallelize the work. 5
  • 6. Introduction: MPI 1980s - early 1990s: Distributed memory & parallel computing started as a bunch of incompatible software tools for writing programs.  MPI (Message Passing Interface) becomes at 1994 a new reference standard.  It provides: – Portability – Performance – Functionality – Availability (many implementations)  Good for: Parallelize the processing by distributing the work among different machines/nodes. 6
  • 7. Introduction: OpenMP In the early 90's: Vendors of shared-memory machines supplied similar, directive-based for Fortran programming extensions:  The user can extend a serial Fortran program with directives specifying which loops were to be parallelized.  The compiler automatically parallelize such loops across the SMP processors.  Implementations were all functionally similar, but were diverging (as usual).  Good for: Parallelize the computation among all the resources of a single machine. 7
  • 8. Reference PM: OpenMP Programming model:  Computation is done by threads.  Fork-join model: Threads are dynamically created and destroyed.  Programmer can specify which variables are shared among threads and which are private. 8
  • 9. Reference PM: OpenMP  Example of sequential PI calculation 9
  • 10. Reference PM: OpenMP  Example of OpenMP PI calculation 10
  • 11. Reference PM: OpenMP Strong Points: – Keeps the sequential version. – Communication is implicit. – Easy to program, debug and modify. – Good performance and scalability. Weaknesses: – Communication is implicit (less control). – Simple and flat memory model (does not run on clusters). – No support for accelerators. 11
  • 12. Reference PM: MPI Programming model:  Computation is done by several processes that execute the same program.  Communicates by passing data (send/receive).  Programmer decides: – Which role the process plays by branches. – Orders which communications are done. 12
  • 13. Reference PM: MPI  Example of MPI PI calculation 13
  • 14. Reference PM: MPI Strong Points: – Any parallel algorithm can be expressed in terms of the MPI paradigm. – Data placement problems are rarely observed. – Suitable for clusters/supercomputers (large number of processors). – Excellent performance and scalable. Weaknesses: – Communication is explicit. – Re-fitting serial code using MPI often requires refactoring. – Dynamic load balancing is difficult to implement. 14
  • 15. Reference PM: The best of both worlds  Hybrid (MPI + OpenMP): – MPI is most effective for problems with “course-grained” parallelism. – “Fine-grain” parallelization is successfully handled by OpenMP.  When use hybrid programming? – The code exhibits limited scaling with MPI. – The code could make use of dynamic load balancing. – The code exhibits fine-grained or a combination of both fine-grained and course-grained parallelism.  Some algorithms, such as computational fluid dynamics, benefit greatly from a hybrid approach!!! 15
  • 16. Reference PM: Hybrid (MPI + OpenMP)  Example of MPI + OpenMP PI calculation 16
  • 17. Reference PM: New reference approaches  Heterogeneous parallel-computing: – CUDA (From NVIDIA) – OpenCL (Open Compute Language) – Cross-platform • Implementations for – ATI GPUs – NVIDIA GPUs – x86 CPUs – API similar to OpenGL. – Based on C. 17
  • 18. Novel PMs  Workflows: – Based on processes – Requires planning and scheduling – Needs flow control – In-transit visibility  Novel PMs: – Complex problems require simple solutions (non reference PMs based) 18
  • 19. Microsoft Dryad  The Dryad Project is investigating programming model for writing parallel and distributed programs to scale from a small cluster to a large data-center.  Theoretical approach (not used) – Last and unique publication on 2007.  User defines: – a set of methods – a task dependency graph with a specific language. 19
  • 20. Microsoft Dryad GraphBuilder Xset = moduleX^N; GraphBuilder Dset = moduleD^N; GraphBuilder Mset = moduleM^(N*4); GraphBuilder Sset = moduleS^(N*4); GraphBuilder Yset = moduleY^N; GraphBuilder Hset = moduleH^1; GraphBuilder XInputs = (ugriz1 >= XSet) || (neighbor >= XSet); GraphBuilder YInputs = ugriz2 >= YSet; GraphBuilder XToY = XSet >= DSet >> MSet >= SSet; for (i = 0; i < N*4; ++i){ XToY = XToY || (SSet.GetVertex(i) >= YSet.GetVertex(i/4)); } GraphBuilder YToH = YSet >= HSet; GraphBuilder HOutputs = HSet >= output; GraphBuilder final = XInputs || YInputs || XToY || YToH || HOutputs; 20
  • 21. MapReduce  Programmer only defines 2 functions – Map(KInput,VInput) list(Ktemp,Vtemp) – Reduce(Ktemp, list(Vtemp))list(Vtemp)  The library is in charge of all the rest 21
  • 22. MapReduce  Weaknesses – Specific programming. – Not easy to find key value pairs.  Strong points – Efficiency. – Simplicity of the model. – Community and tools. 22
  • 23. The COMP Superscalar (COMPSs) 23
  • 24. COMPSs overview - Objective  Reduce the development complexity of Grid/Cluster/Cloud applications to the minimum – As easy as writing a sequential application.  Target applications: composed of tasks, most of them repetitive – Granularity of the tasks of the level of simulations or programs. – Data: files, objects, arrays, primitive types. 24
  • 25. COMPSs overview - Main idea Parallel Resources (a) Task selection + Sequential Code parameters direction Resource 1 ... for (i=0; i<N; i++){ ( (input, output, inout) T1 (data1, data2); T2 (data4, data5); T3 (data2, data5, data6); T4 (data7, data8); T5 (data6, data8, data9); (d) Task completion, } ... Resource 2 synchronization T10 T20 T30 T40 . .. (b) Task graph creation T50 T11 T21 Resource N based on data (c) Scheduling, T41 T31 dependencies data transfer, T51 task execution T12 … 25
  • 26. Programming model - Sample application Main program public void main(){ Integer sum=0; double pi double step=1.0d /(double) num_steps; for (int i=0;i<num_steps;i++){ computeInterval (i, step,sum); } pi = sum * step; } Subroutine public static void computeInterval (int index, int step, Integer acum) { int x = (index -0.5) * step; acum = acum + 4.0/(1.0+x*x); } 26
  • 27. Programming Model - Task Selection Task selection interface public interface PiItf { Implementation @Method(declaringClass = “Pi") void computeInterval( @Parameter(direction = IN) int index, @Parameter(direction = IN) int step, @Parameter(direction = INOUT) Parameter Integer index, metadata ); } 13 27
  • 28. Programming Model – Main code public static void main(String[] args) { Integer sum=0; double pi double step=1.0d /(double) num_steps; NO CHANGES! for (int i=0;i<num_steps;i++){ computeInterval (i, step, sum); } pi = sum * step; } 1 0 Compute Step Compute … N-1 Step Compute sum SYNCH Step Interval Interval Interval sum sum sum sum 28
  • 29. Programming Model – Real Example HMMER Protein Database Aminoacid Sequence IQKKSGKWHTLTDLRA VNAVIQPMGPLQPGLP SPAMIPKDWPLIIIDLK DCFFTIPLAEQDCEKFA FTIPAINNKEPATRF Model Score E-value N -------- ------ --------- --- IL6_2 -78.5 0.13 1 COLFI_2 -164.5 0.35 1 pgtp_13 -36.3 0.48 1 clf2 -15.6 3.6 1 PKD_9 -24.0 5 1 29
  • 30. Programming Model – Real Example Aminoacid sequence 30
  • 31. Programming Model – Real Example String[] outputs = new String[numDBFrags]; //Process for (String dbFrag : dbFrags) { outputs[dbNum]= HMMPfamImpl.hmmpfam(sequence, dbFrag); } //Merge int neighbor = 1; while (neighbor < numDBFrags) { for (int db = 0; db < numDBFrags; db += 2 * neighbor) { if (db + neighbor < numDBFrags) { HMMPfamImpl.merge(outputs[db], outputs[db + neighbor]); } } neighbor *= 2; } 31
  • 32. Programming Model – Real Example public interface HMMPfamItf { @Method(declaringClass = "worker.hmmerobj.HMMPfamImpl") String hmmpfam( @Parameter(type = Type.FILE, direction = Direction.IN) String seqFile, @Parameter(type = Type.STRING, direction = Direction.IN) String dbFile ); @Method(declaringClass = "worker.hmmerobj.HMMPfamImpl") void scoreRatingSameDB( @Parameter(type = Type.OBJECT, direction = Direction.INOUT) String resultFile1, @Parameter(type = Type.OBJECT, direction = Direction.IN) String resultFile2 ); } 32
  • 33. Programming Model – Real Example 33
  • 34. Programming Model – Real Example 34
  • 35. COMPSs  Strong points – Sequential programming approach – Parallelization at task level – Transparent data management and remote execution – Can operate on different infrastructures: • Cluster/Grid • Cloud (Public/Private) – PaaS – IaaS • Web services  Weaknesses: – Under continuous development – Does not offer binding to other languages (currently) 35
  • 36. Tutorial  Sample & Development Virtual Appliance – http://bscgrid06.bsc.es/~lezzi/vms/COMPSs_Tutorial.ova  Tutorial – http://bscgrid06.bsc.es/~lezzi/ppts/tutorial-Life.ppt 36
  • 37. Manjrasoft Aneka  .NET based Platform-as-a-Service  Allows the usage of: – Private Clouds. – Public Clouds: Amazon EC2, Azure, GoGrid.  Offers mechanisms to control, reserve and monitoring the resources. – Also offers autoscale mechanisms.  3 programming models – Task-based: tasks are put in a bag of executable tasks. – Thread-based: exposes the .NET thread API but they are remotely created. – MapReduce  No data dependency analysis!! 37
  • 38. Microsoft Azure  .NET based Platform-as-a-Service  Computing services – Web Role: Web Service frontend. – Worker Role: Backend.  Storage Services  Strong Point – Scalable architecture.  Weakness – Platform-tied applications. 38
  • 39. Conclusions  Scientific problems are usually complex.  Current reference PMs are usually unsuitable.  New novel & flexible PMs came into the game.  Existing gap between scientifics and user-friendly workflow-oriented programming models.  A sea of available solutions (DSLs) 39
  • 40. Questions 40

Notas do Editor

  1. The programming model can be defined as task-based and dependency-aware. In it, the programmer is only required to select a set of methods called from a sequential Java application, for them to be run as parallel tasks on the available distributed resources. Initially, the application starts running sequentially in one node and, whenever a call to a selected method is found, an asynchronous task is created instead, letting the main program continue its execution right away. The created tasks are processed by the runtime, which discovers the dependencies between them, building a task dependency graph. A renaming technique is used to avoid some kinds of dependencies. The parallelism exhibited by the graph is exploited as much as possible, scheduling the dependency-free tasks on the available resources. The scheduling is locality-aware: nodes can cache task data for later use, and a node that already has some or all the input data for a task gets more chances to run it. The runtime also manages these data - performing data copies or transfers if necessary - and controls the completion of tasks.
  2. First, the user has to provide a Java interface which declares the methods that must be executed on the Grid, that’s to say, the different kinds of task. As I mentioned before, a task is a given call to one of these methods from the application code. In addition, the user can utilise Java annotations to provide: First, the class that implements the method. Second, the constraints for each kind of task, what are the capabilities that a resource must have to run the task. This is optional. Third, it is mandatory to state the type and direction of the parameters for each kind of task. Currenly we support the file type, the string type and all the primitive types.