Message Passing Programming - Parallel and Distributed Computing - Lecture Slides, Slides of Parallel Computing and Programming

During the course of work of the Parallel and Distributed Computing we learn the core of the programming. The main points disucss in these lecture slides are:Message Passing Programming, Message-Passing Model, Message Passing Interface, Parallel Virtual Machine, Circuit Satisfiability, Solution Method, Functional Decomposition, Embarrassingly Parallel

Typology: Slides

2012/2013

Uploaded on 04/24/2013

banamala
banamala 🇮🇳

4.4

(19)

114 documents

1 / 47

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Message Passing
Programming with
MPI
Chapter 4
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f

Partial preview of the text

Download Message Passing Programming - Parallel and Distributed Computing - Lecture Slides and more Slides Parallel Computing and Programming in PDF only on Docsity!

Message Passing

Programming with

MPI

Chapter 4

Outline

  • Message-passing model
  • Message Passing Interface (MPI)
  • Coding MPI programs
  • Compiling MPI programs
  • Running MPI programs
  • Benchmarking MPI programs

Task/Channel vs. Message-passing

Task/Channel Message-passing

Task Process

Explicit channels Message communication

Processes

  • Number is specified at start-up time
  • Remains constant throughout execution of program
  • All execute same program (SPMD)
  • Each has unique ID number
  • Alternately performs computations and communications
  • Communications and work-sharing are all explicit!

The Message Passing Interface

  • Late 1980s: vendors had unique libraries
  • 1989: Parallel Virtual Machine (PVM) developed at Oak Ridge National Lab
  • 1992: Work on MPI standard begun
  • 1994: Version 1.0 of MPI standard
  • 1997: Version 2.0 of MPI standard
  • Today: MPI (and PVM) are dominant message passing library standards

Circuit Satisfiability

1

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Not satisfied

0

Partitioning: Functional Decomposition

 Embarrassingly parallel: No channels between tasks

Agglomeration and Mapping

  • Properties of parallel algorithm
    • Fixed number of tasks
    • No communications between tasks
    • Time needed per task is variable
  • Consult mapping strategy decision tree
    • Map tasks to processors in a cyclic fashion

Pop Quiz

  • Assume n pieces of work, p processes, and cyclic allocation
  • What is the most amount of work any process has?
  • What is the least amount of work any process has?
  • How many processes have the mostDocsity.com

Summary of Program Design

  • Program will consider all 65,536 combinations of 16 boolean inputs
  • Combinations allocated in cyclic fashion to processes
  • Each process examines each of its combinations
  • If it finds a satisfiable combination, it will print

Local Variables

*int main (int argc, char argv[]) { int i; int id; / Process rank / int p; / Number of processes / void check_circuit (int, int);

 Include argc and argv : they are needed

to initialize MPI

 One copy of every variable for each process

running this program

Initialize MPI

  • First MPI function called by each process
  • Not necessarily first executable statement
  • Allows system to do any necessary setup

MPI_Init (&argc, &argv);

Communicator

MPI_COMM_WORLD

Communicator

0

2 1

3

4

5

Processes

Ranks

Communicator Name

Determine Number of Processes

  • First argument is communicator
  • Number of processes returned through

second argument

MPI_Comm_size (MPI_COMM_WORLD, &p);