SlideShare a Scribd company logo
1 of 30
APIs FOR
PARALLEL PROGRAMMING




              By:
              SURINDER KAUR
              2012CS13
PARRALLEL PROGRAMMMING MODELS:


 • SHARED MEMORY MODEL:
     •Programs are executed on one or more processors
     that share some or all of the available memory.

     •OpenMP is based on this model.

 • MESSAGE PASSING MODEL:
     •Programs are executed by one or more processes
     that exchange message whenever one of them needs
     data produced by the other.

     •MPI is based on this model.
OpenMP

OPEN MULTIPROCESSING
WHAT THEY ARE FOR

• Shared
       memory API that supports multi-platform
programming in C/C++ and Fortan.

• Data is shared among the threads and is visible to all of
them.

• Private data is thread specific data.

• Values of shared data must be made available to all
threads at synchronization points.
EXECUTION MODEL
• Fork-Join model.
                            Initial thread




                     Fork

                            Team of threads


                     Join

                            Initial thread
• OpenMP model supports incremental parallelization.
• In this approach a sequential program is transformed into
parallel program one block of code at a time.



                    Master Thread
                                        Fork


                                      Join
Time

                    Master Thread
                                          Fork



                                        Join
                    Master Thread
LANGUAGE FEATURES
•   Directives
•   Library functions
•   Environment variables
•   Constructs
•   Clauses
DIRECTIVES
• Parallel construct
      #pragma omp parallel [clause,clause,…]
               structured block


• Work sharing constuct
           •   Loop construct
                 #pragma omp for [clause, clause,…]
                          for loop
           •   Section construct
                 #pragma omp sections [clause,clause,…]
                 {
                          #pragma omp section
                                  structured block
                          #pragma omp section
                                  structured block
                 }
•Single construct
            #pragma omp single [clause, clause,…]
                   structured block
       •Work sharing construct

• Combined parallel work sharing construct
  #pragma omp parallel
 {                                  #pragma omp parallel for
         #pragma omp for                   for loop
                 for loop
 }
SYNCHRONIZATION
      CONSTRUCTS
• Barrier construct
       #pragma omp barrier
 • Ordered construct
         #pragma omp ordered
 • Critical construct
         #pragma omp critical [name]
                  structured block
• Atomic construct
          #pragma omp atomic
                 statement
• Master construct
          #pragma omp master
                 structured block
• Locks
CLAUSES
•   Shared clause
         shared(list)

•   Private clause
         private(list)

•   Lastprivate clause
         lastprivate(list)

•   Firstprivate clause
         firstprivate(list)

•   Default clause
         default(none/shared)
• Num_thread clause
         num_threads(integer_expression)

•Ordered clause
         ordered

•Reduction clause
         reduction(operator:list)

• Copyin clause
         copyin(list)

• Copyprivate clause
         copyprivate(list)

•Nowait clause

•Schedule clause

• If clause
                   if (expression)
OTHER DIRECTIVE
• Flush directive
       #pragma omp flush [(list)]



•   Threadprivate direcive
       #pragma omp threadprivate (list)
ENVIRONMENT VARIABLE
•   OMP_NUM_THREADS
          setenv OMP_NUM_THREADS <int>


•   OMP_DYNAMIC
          setenv OMP_DYNAMIC TRUE


•   OMP_NESTED
          setenv OMP_NESTED TRUE


•   OMP_SCHEDULE
ADVANTAGES
• Structural parallel programming.

• Simple to use.

• Runs on various platforms

• Portability.

• Incremental parallelism.

• Unified code for both serial and parallel applications..

• Data layout and decomposition is handled automatically by
directives.

• Both coarse-grained and fine-grained parallelism are possible
DISADVANTAGES
• Since it relies on compiler to detect and exploit parallelism in
application, which may degrade its performance.

• Race condition may arise.

• Currently only runs efficiently in shared-memory
multiprocessor platforms.

• Compiler support is required.

• Scalability is limited by memory architecture.
USES
• Grid computing

• Wave, weather and ocean code:
   •   LAMBO, Limited Area Model BOlogna, is a grid-point primitive equations
       model.

   •   The Wave Model, WA.M., describes the sea state at a certain time in a
       certain position as the overlapping of many sinusoidals with different
       frequencies.

   •   Modular Ocean Model, M.O.M., solves the primitive equations under
       hydrostatic, Boussinesq and rigid lid approximations.
FUTURE WORK
• OpenMP, the de facto standard for parallel programming on
  shared memory systems, continues to extend its reach
  beyond pure HPC to include embedded systems, real time
  systems, and accelerators.

• Release Candidate 1 of the OpenMP 4.0 API specifications
  currently under development is now available for public
  discussion. This update includes thread affinity, initial support
  for Fortran 2003, SIMD constructs to vectorize both serial and
  parallelized loops , user-defined reductions, and sequentially
  consistent atomics.

• More new features, in a final Release Candidate 2, to appear
  sometime in the first Quarter of 2013, followed by the finalized
  full 4.0 API specifications soon thereafter.
MPI


MESSAGE PASSING
   INTERFACE
WHAT THEY ARE FOR
• Library based model for interprocess communication.

• Various executing processes communicate via message passing.

• The message can either be
    • DATA message
    • CONTROL message

• IPC can either be
    •SYNCHRONOUS
    •ASYNCHRONOUS
ASSOCIATED TERMS

•   Group:
      Set of processes that communicate with one
      another.
•   Context:
      It is the frequency of the communication.
•   Communicator:
       Central object for communication in MPI. Each
       communicator is associated with a group and a
       context.
COMMUNICATION MODES
• Standard:
  Communication completes as the message is sent out by the
 sender.
• Synchronous :
  Communication completes when the acknowledgement from sender is
 received by the sender.
• Buffered:
 Communication completes as the sender generates the message and
 stores in the buffer.
• Ready Send:
   Communication completes immediately, if the receiver is ready for
   the message it will get it, otherwise the message is dropped
   silently.
BLOCKING AND NONBLOCKING

   •   Blocking
         The program halts until the communication is
         completed.



   •   Non-Blocking
         The program will continue its execution without
         waiting for the communication to be completed.
MPI CALLS
•   MPI_INIT:
      MPI Init(int *argc, char ***argv)

      MPI_Init( &argc, &argv)

•   MPI_COMM_SIZE:
      MPI Comm size(MPI Comm comm, int *size)
      MPI_Comm_size(MPI_COMM_WORLD, &numprocs)

•   MPI_COMM_RANK:
      MPI Comm rank(MPI Comm comm, int *rank)

      MPI_Comm_rank( MPI_COMM_WORLD, &rank)
•   MPI _SEND:
      MPI Send(void* buf, int count, MPI Datatype datatype,
     int dest, int tag, MPI Comm comm)
     MPI_Send( buff, BUFSIZE, MPI_CHAR, 0, TAG,
     MPI_COMM_WORLD)
•   MPI_RECV:
     MPI Recv(void* buf, int count, MPI Datatype datatype,
     int source, int tag, MPI Comm comm, MPI Status
     *status)
     MPI_Recv(buff, BUFSIZE, MPI_CHAR, i, TAG,
     MPI_COMM_WORLD, &stat)
•   MPI_FINALIZE:
     • MPI Finalize()
MPI DATA TYPES
•   MPI_INT

•   MPI_FLOAT

•   MPI_BYTE

•   MPI_CHAR
ADVANTAGES
•Highly expressive

•Enable efficient parallel programming

•Excellent portability

•Comprehensive set of library routines

•Language independent

• Provide access to advanced parallel hardware
DISADVANTAGES
•Require more effort for developing code as compared to the
OpenMP.

•Communicators, which are much used in MPI programming, are
not entirely implemented. The underlying communicator system is
present, but is presently restricted to only the global
environment MPI_COMM_WORLD.

•Debugging the code is difficult.

•Communication overhead.
USES

• High performance computing

• Grid computing
FUTURE WORK
 MPI-1:
• a static runtime environment

 MPI-2.
• Parallel I/O
• Dynamic process management
• Remote memory operations
• Specifies over 500 functions
• Language bindings for ANSI C, ANSI C++, and ANSI Fortran (Fortran90)
• Object interoperability

Presently it is most widely used API for parallel programming. Hence some
aspects of MPI's future appear solid; others less so.
 The MPI Forum reconvened in 2007, to clarify some MPI-2 issues and explore
developments for a possible MPI-3.
With greater internal concurrency (multi-core), better fine-grain concurrency
control (threading, affinity), and more levels of memory hierarchy
multithreading programs can take advantage of these developments more easily
. So developing concurrency completely within MPI is an opportunity for the
standard MPI-3. Also incorporating fault tolerance within the standard is also an
important issue.

More Related Content

What's hot

Concurrent Programming OpenMP @ Distributed System Discussion
Concurrent Programming OpenMP @ Distributed System DiscussionConcurrent Programming OpenMP @ Distributed System Discussion
Concurrent Programming OpenMP @ Distributed System DiscussionCherryBerry2
 
Programming using Open Mp
Programming using Open MpProgramming using Open Mp
Programming using Open MpAnshul Sharma
 
Introduction to OpenMP (Performance)
Introduction to OpenMP (Performance)Introduction to OpenMP (Performance)
Introduction to OpenMP (Performance)Akhila Prabhakaran
 
Introduction to Chainer: A Flexible Framework for Deep Learning
Introduction to Chainer: A Flexible Framework for Deep LearningIntroduction to Chainer: A Flexible Framework for Deep Learning
Introduction to Chainer: A Flexible Framework for Deep LearningSeiya Tokui
 
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...Takuo Watanabe
 
Automatic Reference Counting @ Pragma Night
Automatic Reference Counting @ Pragma NightAutomatic Reference Counting @ Pragma Night
Automatic Reference Counting @ Pragma NightGiuseppe Arici
 
A Language Support for Exhaustive Fault-Injection in Message-Passing System M...
A Language Support for Exhaustive Fault-Injection in Message-Passing System M...A Language Support for Exhaustive Fault-Injection in Message-Passing System M...
A Language Support for Exhaustive Fault-Injection in Message-Passing System M...Takuo Watanabe
 
Modern Objective-C @ Pragma Night
Modern Objective-C @ Pragma NightModern Objective-C @ Pragma Night
Modern Objective-C @ Pragma NightGiuseppe Arici
 
.Net Multithreading and Parallelization
.Net Multithreading and Parallelization.Net Multithreading and Parallelization
.Net Multithreading and ParallelizationDmitri Nesteruk
 
Buzzwords Numba Presentation
Buzzwords Numba PresentationBuzzwords Numba Presentation
Buzzwords Numba Presentationkammeyer
 

What's hot (20)

Introduction to OpenMP
Introduction to OpenMPIntroduction to OpenMP
Introduction to OpenMP
 
openmp
openmpopenmp
openmp
 
Concurrent Programming OpenMP @ Distributed System Discussion
Concurrent Programming OpenMP @ Distributed System DiscussionConcurrent Programming OpenMP @ Distributed System Discussion
Concurrent Programming OpenMP @ Distributed System Discussion
 
Programming using Open Mp
Programming using Open MpProgramming using Open Mp
Programming using Open Mp
 
Open mp
Open mpOpen mp
Open mp
 
Open mp directives
Open mp directivesOpen mp directives
Open mp directives
 
OpenMp
OpenMpOpenMp
OpenMp
 
Openmp
OpenmpOpenmp
Openmp
 
Introduction to OpenMP
Introduction to OpenMPIntroduction to OpenMP
Introduction to OpenMP
 
Introduction to OpenMP (Performance)
Introduction to OpenMP (Performance)Introduction to OpenMP (Performance)
Introduction to OpenMP (Performance)
 
Parallel Programming
Parallel ProgrammingParallel Programming
Parallel Programming
 
Lecture8
Lecture8Lecture8
Lecture8
 
Introduction to MPI
Introduction to MPIIntroduction to MPI
Introduction to MPI
 
Introduction to Chainer: A Flexible Framework for Deep Learning
Introduction to Chainer: A Flexible Framework for Deep LearningIntroduction to Chainer: A Flexible Framework for Deep Learning
Introduction to Chainer: A Flexible Framework for Deep Learning
 
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
Towards an Integration of the Actor Model in an FRP Language for Small-Scale ...
 
Automatic Reference Counting @ Pragma Night
Automatic Reference Counting @ Pragma NightAutomatic Reference Counting @ Pragma Night
Automatic Reference Counting @ Pragma Night
 
A Language Support for Exhaustive Fault-Injection in Message-Passing System M...
A Language Support for Exhaustive Fault-Injection in Message-Passing System M...A Language Support for Exhaustive Fault-Injection in Message-Passing System M...
A Language Support for Exhaustive Fault-Injection in Message-Passing System M...
 
Modern Objective-C @ Pragma Night
Modern Objective-C @ Pragma NightModern Objective-C @ Pragma Night
Modern Objective-C @ Pragma Night
 
.Net Multithreading and Parallelization
.Net Multithreading and Parallelization.Net Multithreading and Parallelization
.Net Multithreading and Parallelization
 
Buzzwords Numba Presentation
Buzzwords Numba PresentationBuzzwords Numba Presentation
Buzzwords Numba Presentation
 

Similar to MPI n OpenMP

openmp.New.intro-unc.edu.ppt
openmp.New.intro-unc.edu.pptopenmp.New.intro-unc.edu.ppt
openmp.New.intro-unc.edu.pptMALARMANNANA1
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_monTomas Doran
 
EuroMPI 2013 presentation: McMPI
EuroMPI 2013 presentation: McMPIEuroMPI 2013 presentation: McMPI
EuroMPI 2013 presentation: McMPIDan Holmes
 
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMP
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMPAlgoritmi e Calcolo Parallelo 2012/2013 - OpenMP
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMPPier Luca Lanzi
 
OpenPOWER Application Optimization
OpenPOWER Application Optimization OpenPOWER Application Optimization
OpenPOWER Application Optimization Ganesan Narayanasamy
 
Parallel and Distributed Computing Chapter 5
Parallel and Distributed Computing Chapter 5Parallel and Distributed Computing Chapter 5
Parallel and Distributed Computing Chapter 5AbdullahMunir32
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPEberhard Wolff
 
The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP Eberhard Wolff
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8Heartin Jacob
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler ConstructionAhmed Raza
 
Writing Well-Behaved Unix Utilities
Writing Well-Behaved Unix UtilitiesWriting Well-Behaved Unix Utilities
Writing Well-Behaved Unix UtilitiesRob Miller
 
SciPy 2019: How to Accelerate an Existing Codebase with Numba
SciPy 2019: How to Accelerate an Existing Codebase with NumbaSciPy 2019: How to Accelerate an Existing Codebase with Numba
SciPy 2019: How to Accelerate an Existing Codebase with Numbastan_seibert
 
VTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computingVTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computingSachin Gowda
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionOrtus Solutions, Corp
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffJAX London
 
Scala in Model-Driven development for Apparel Cloud Platform
Scala in Model-Driven development for Apparel Cloud PlatformScala in Model-Driven development for Apparel Cloud Platform
Scala in Model-Driven development for Apparel Cloud PlatformTomoharu ASAMI
 

Similar to MPI n OpenMP (20)

openmp.New.intro-unc.edu.ppt
openmp.New.intro-unc.edu.pptopenmp.New.intro-unc.edu.ppt
openmp.New.intro-unc.edu.ppt
 
Lecture6
Lecture6Lecture6
Lecture6
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_mon
 
EuroMPI 2013 presentation: McMPI
EuroMPI 2013 presentation: McMPIEuroMPI 2013 presentation: McMPI
EuroMPI 2013 presentation: McMPI
 
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMP
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMPAlgoritmi e Calcolo Parallelo 2012/2013 - OpenMP
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMP
 
OpenPOWER Application Optimization
OpenPOWER Application Optimization OpenPOWER Application Optimization
OpenPOWER Application Optimization
 
Lecture5
Lecture5Lecture5
Lecture5
 
Parallel and Distributed Computing Chapter 5
Parallel and Distributed Computing Chapter 5Parallel and Distributed Computing Chapter 5
Parallel and Distributed Computing Chapter 5
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
 
The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP
 
Working With Concurrency In Java 8
Working With Concurrency In Java 8Working With Concurrency In Java 8
Working With Concurrency In Java 8
 
Compiler Construction
Compiler ConstructionCompiler Construction
Compiler Construction
 
Writing Well-Behaved Unix Utilities
Writing Well-Behaved Unix UtilitiesWriting Well-Behaved Unix Utilities
Writing Well-Behaved Unix Utilities
 
SciPy 2019: How to Accelerate an Existing Codebase with Numba
SciPy 2019: How to Accelerate an Existing Codebase with NumbaSciPy 2019: How to Accelerate an Existing Codebase with Numba
SciPy 2019: How to Accelerate an Existing Codebase with Numba
 
Nug2004 yhe
Nug2004 yheNug2004 yhe
Nug2004 yhe
 
VTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computingVTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computing
 
OpenMP
OpenMPOpenMP
OpenMP
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusion
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
 
Scala in Model-Driven development for Apparel Cloud Platform
Scala in Model-Driven development for Apparel Cloud PlatformScala in Model-Driven development for Apparel Cloud Platform
Scala in Model-Driven development for Apparel Cloud Platform
 

More from Surinder Kaur

More from Surinder Kaur (12)

Lucene
LuceneLucene
Lucene
 
Agile
AgileAgile
Agile
 
MapReduce
MapReduceMapReduce
MapReduce
 
Apache Hive
Apache HiveApache Hive
Apache Hive
 
JSON Parsing
JSON ParsingJSON Parsing
JSON Parsing
 
Analysis of Emergency Evacuation of Building using PEPA
Analysis of Emergency Evacuation of Building using PEPAAnalysis of Emergency Evacuation of Building using PEPA
Analysis of Emergency Evacuation of Building using PEPA
 
Skype
SkypeSkype
Skype
 
NAT
NATNAT
NAT
 
XSLT
XSLTXSLT
XSLT
 
Dom
Dom Dom
Dom
 
java API for XML DOM
java API for XML DOMjava API for XML DOM
java API for XML DOM
 
intelligent sensors and sensor networks
intelligent sensors and sensor networksintelligent sensors and sensor networks
intelligent sensors and sensor networks
 

MPI n OpenMP

  • 1. APIs FOR PARALLEL PROGRAMMING By: SURINDER KAUR 2012CS13
  • 2. PARRALLEL PROGRAMMMING MODELS: • SHARED MEMORY MODEL: •Programs are executed on one or more processors that share some or all of the available memory. •OpenMP is based on this model. • MESSAGE PASSING MODEL: •Programs are executed by one or more processes that exchange message whenever one of them needs data produced by the other. •MPI is based on this model.
  • 4. WHAT THEY ARE FOR • Shared memory API that supports multi-platform programming in C/C++ and Fortan. • Data is shared among the threads and is visible to all of them. • Private data is thread specific data. • Values of shared data must be made available to all threads at synchronization points.
  • 5. EXECUTION MODEL • Fork-Join model. Initial thread Fork Team of threads Join Initial thread
  • 6. • OpenMP model supports incremental parallelization. • In this approach a sequential program is transformed into parallel program one block of code at a time. Master Thread Fork Join Time Master Thread Fork Join Master Thread
  • 7. LANGUAGE FEATURES • Directives • Library functions • Environment variables • Constructs • Clauses
  • 8. DIRECTIVES • Parallel construct #pragma omp parallel [clause,clause,…] structured block • Work sharing constuct • Loop construct #pragma omp for [clause, clause,…] for loop • Section construct #pragma omp sections [clause,clause,…] { #pragma omp section structured block #pragma omp section structured block }
  • 9. •Single construct #pragma omp single [clause, clause,…] structured block •Work sharing construct • Combined parallel work sharing construct #pragma omp parallel { #pragma omp parallel for #pragma omp for for loop for loop }
  • 10. SYNCHRONIZATION CONSTRUCTS • Barrier construct #pragma omp barrier • Ordered construct #pragma omp ordered • Critical construct #pragma omp critical [name] structured block • Atomic construct #pragma omp atomic statement • Master construct #pragma omp master structured block • Locks
  • 11. CLAUSES • Shared clause shared(list) • Private clause private(list) • Lastprivate clause lastprivate(list) • Firstprivate clause firstprivate(list) • Default clause default(none/shared)
  • 12. • Num_thread clause num_threads(integer_expression) •Ordered clause ordered •Reduction clause reduction(operator:list) • Copyin clause copyin(list) • Copyprivate clause copyprivate(list) •Nowait clause •Schedule clause • If clause if (expression)
  • 13. OTHER DIRECTIVE • Flush directive #pragma omp flush [(list)] • Threadprivate direcive #pragma omp threadprivate (list)
  • 14. ENVIRONMENT VARIABLE • OMP_NUM_THREADS setenv OMP_NUM_THREADS <int> • OMP_DYNAMIC setenv OMP_DYNAMIC TRUE • OMP_NESTED setenv OMP_NESTED TRUE • OMP_SCHEDULE
  • 15. ADVANTAGES • Structural parallel programming. • Simple to use. • Runs on various platforms • Portability. • Incremental parallelism. • Unified code for both serial and parallel applications.. • Data layout and decomposition is handled automatically by directives. • Both coarse-grained and fine-grained parallelism are possible
  • 16. DISADVANTAGES • Since it relies on compiler to detect and exploit parallelism in application, which may degrade its performance. • Race condition may arise. • Currently only runs efficiently in shared-memory multiprocessor platforms. • Compiler support is required. • Scalability is limited by memory architecture.
  • 17. USES • Grid computing • Wave, weather and ocean code: • LAMBO, Limited Area Model BOlogna, is a grid-point primitive equations model. • The Wave Model, WA.M., describes the sea state at a certain time in a certain position as the overlapping of many sinusoidals with different frequencies. • Modular Ocean Model, M.O.M., solves the primitive equations under hydrostatic, Boussinesq and rigid lid approximations.
  • 18. FUTURE WORK • OpenMP, the de facto standard for parallel programming on shared memory systems, continues to extend its reach beyond pure HPC to include embedded systems, real time systems, and accelerators. • Release Candidate 1 of the OpenMP 4.0 API specifications currently under development is now available for public discussion. This update includes thread affinity, initial support for Fortran 2003, SIMD constructs to vectorize both serial and parallelized loops , user-defined reductions, and sequentially consistent atomics. • More new features, in a final Release Candidate 2, to appear sometime in the first Quarter of 2013, followed by the finalized full 4.0 API specifications soon thereafter.
  • 19. MPI MESSAGE PASSING INTERFACE
  • 20. WHAT THEY ARE FOR • Library based model for interprocess communication. • Various executing processes communicate via message passing. • The message can either be • DATA message • CONTROL message • IPC can either be •SYNCHRONOUS •ASYNCHRONOUS
  • 21. ASSOCIATED TERMS • Group: Set of processes that communicate with one another. • Context: It is the frequency of the communication. • Communicator: Central object for communication in MPI. Each communicator is associated with a group and a context.
  • 22. COMMUNICATION MODES • Standard: Communication completes as the message is sent out by the sender. • Synchronous : Communication completes when the acknowledgement from sender is received by the sender. • Buffered: Communication completes as the sender generates the message and stores in the buffer. • Ready Send: Communication completes immediately, if the receiver is ready for the message it will get it, otherwise the message is dropped silently.
  • 23. BLOCKING AND NONBLOCKING • Blocking The program halts until the communication is completed. • Non-Blocking The program will continue its execution without waiting for the communication to be completed.
  • 24. MPI CALLS • MPI_INIT: MPI Init(int *argc, char ***argv) MPI_Init( &argc, &argv) • MPI_COMM_SIZE: MPI Comm size(MPI Comm comm, int *size) MPI_Comm_size(MPI_COMM_WORLD, &numprocs) • MPI_COMM_RANK: MPI Comm rank(MPI Comm comm, int *rank) MPI_Comm_rank( MPI_COMM_WORLD, &rank)
  • 25. MPI _SEND: MPI Send(void* buf, int count, MPI Datatype datatype, int dest, int tag, MPI Comm comm) MPI_Send( buff, BUFSIZE, MPI_CHAR, 0, TAG, MPI_COMM_WORLD) • MPI_RECV: MPI Recv(void* buf, int count, MPI Datatype datatype, int source, int tag, MPI Comm comm, MPI Status *status) MPI_Recv(buff, BUFSIZE, MPI_CHAR, i, TAG, MPI_COMM_WORLD, &stat) • MPI_FINALIZE: • MPI Finalize()
  • 26. MPI DATA TYPES • MPI_INT • MPI_FLOAT • MPI_BYTE • MPI_CHAR
  • 27. ADVANTAGES •Highly expressive •Enable efficient parallel programming •Excellent portability •Comprehensive set of library routines •Language independent • Provide access to advanced parallel hardware
  • 28. DISADVANTAGES •Require more effort for developing code as compared to the OpenMP. •Communicators, which are much used in MPI programming, are not entirely implemented. The underlying communicator system is present, but is presently restricted to only the global environment MPI_COMM_WORLD. •Debugging the code is difficult. •Communication overhead.
  • 29. USES • High performance computing • Grid computing
  • 30. FUTURE WORK MPI-1: • a static runtime environment MPI-2. • Parallel I/O • Dynamic process management • Remote memory operations • Specifies over 500 functions • Language bindings for ANSI C, ANSI C++, and ANSI Fortran (Fortran90) • Object interoperability Presently it is most widely used API for parallel programming. Hence some aspects of MPI's future appear solid; others less so. The MPI Forum reconvened in 2007, to clarify some MPI-2 issues and explore developments for a possible MPI-3. With greater internal concurrency (multi-core), better fine-grain concurrency control (threading, affinity), and more levels of memory hierarchy multithreading programs can take advantage of these developments more easily . So developing concurrency completely within MPI is an opportunity for the standard MPI-3. Also incorporating fault tolerance within the standard is also an important issue.