Jonathan Carroll-Nellenback CIRC Summer School MESSAGE PASSING INTERFACE (MPI)

Slides:



Advertisements
Similar presentations
Its.unc.edu 1 Collective Communication University of North Carolina - Chapel Hill ITS - Research Computing Instructor: Mark Reed
Advertisements

MPI Basics Introduction to Parallel Programming and Cluster Computing University of Washington/Idaho State University MPI Basics Charlie Peck Earlham College.
1/44 MPI Programming Hamid Reza Tajozzakerin Sharif University of technology.
1 Parallel Computing—Higher-level concepts of MPI.
A Message Passing Standard for MPP and Workstations Communications of the ACM, July 1996 J.J. Dongarra, S.W. Otto, M. Snir, and D.W. Walker.
CS 240A: Models of parallel programming: Distributed memory and MPI.
Distributed Memory Programming with MPI. What is MPI? Message Passing Interface (MPI) is an industry standard message passing system designed to be both.
Parallel Programming in C with MPI and OpenMP
1 Message Passing Programming (MPI). 2 What is MPI? A message-passing library specification extended message-passing model not a language or compiler.
EECC756 - Shaaban #1 lec # 7 Spring Message Passing Interface (MPI) MPI, the Message Passing Interface, is a library, and a software standard.
Collective Communication.  Collective communication is defined as communication that involves a group of processes  More restrictive than point to point.
Message Passing Interface. Message Passing Interface (MPI) Message Passing Interface (MPI) is a specification designed for parallel applications. The.
MPI: Message Passing Interface ECE563 Presentation ECE563 Presentation -- Zhelong Pan -- Zhelong Pan Feb. 10, 2003 Feb. 10, 2003.
Sahalu JunaiduICS 573: High Performance Computing6.1 Programming Using the Message Passing Paradigm Principles of Message-Passing Programming The Building.
Parallel Programming with Java
Parallel Programming Using Basic MPI Presented by Timothy H. Kaiser, Ph.D. San Diego Supercomputer Center Presented by Timothy H. Kaiser, Ph.D. San Diego.
A Message Passing Standard for MPP and Workstations Communications of the ACM, July 1996 J.J. Dongarra, S.W. Otto, M. Snir, and D.W. Walker.
1 CS4402 – Parallel Computing Lecture 2 MPI – Getting Started. MPI – Point to Point Communication.
LAB 7 -Parallel Programming Models -MPI Continued.
Parallel Processing1 Parallel Processing (CS 676) Lecture 7: Message Passing using MPI * Jeremy R. Johnson *Parts of this lecture was derived from chapters.
Parallel Programming and Algorithms – MPI Collective Operations David Monismith CS599 Feb. 10, 2015 Based upon MPI: A Message-Passing Interface Standard.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Parallel Programming in C with MPI and OpenMP Michael J. Quinn.
HPCA2001HPCA Message Passing Interface (MPI) and Parallel Algorithm Design.
Part I MPI from scratch. Part I By: Camilo A. SilvaBIOinformatics Summer 2008 PIRE :: REU :: Cyberbridges.
CS 240A Models of parallel programming: Distributed memory and MPI.
Parallel Computing A task is broken down into tasks, performed by separate workers or processes Processes interact by exchanging information What do we.
Parallel Programming with MPI Prof. Sivarama Dandamudi School of Computer Science Carleton University.
Jonathan Carroll-Nellenback CIRC Summer School MESSAGE PASSING INTERFACE (MPI)
CS 838: Pervasive Parallelism Introduction to MPI Copyright 2005 Mark D. Hill University of Wisconsin-Madison Slides are derived from an online tutorial.
MPI Communications Point to Point Collective Communication Data Packaging.
Message Passing Programming Model AMANO, Hideharu Textbook pp. 140-147.
Summary of MPI commands Luis Basurto. Large scale systems Shared Memory systems – Memory is shared among processors Distributed memory systems – Each.
MPJ Express Alon Vice Ayal Ofaim. Contributors 2 Aamir Shafi Jawad Manzoor Kamran Hamid Mohsan Jameel Rizwan Hanif Amjad Aziz Bryan Carpenter Mark Baker.
1 Overview on Send And Receive routines in MPI Kamyar Miremadi November 2004.
Lecture 6: Message Passing Interface (MPI). Parallel Programming Models Message Passing Model Used on Distributed memory MIMD architectures Multiple processes.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Parallel Programming in C with MPI and OpenMP Michael J. Quinn.
Oct. 23, 2002Parallel Processing1 Parallel Processing (CS 730) Lecture 6: Message Passing using MPI * Jeremy R. Johnson *Parts of this lecture was derived.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Message-passing Model.
1 Lecture 4: Part 2: MPI Point-to-Point Communication.
Distributed Processing Systems (InterProcess Communication) (Message Passing) Distributed Processing Systems (InterProcess Communication) (Message Passing)
Introduction to Parallel Programming at MCSR Message Passing Computing –Processes coordinate and communicate results via calls to message passing library.
-1.1- MPI Lectured by: Nguyễn Đức Thái Prepared by: Thoại Nam.
Message Passing Programming Based on MPI Collective Communication I Bora AKAYDIN
1 Programming distributed memory systems Clusters Distributed computers ITCS 4/5145 Parallel Computing, UNC-Charlotte, B. Wilkinson, Jan 6, 2015.
Chapter 4 Message-Passing Programming. Learning Objectives Understanding how MPI programs execute Understanding how MPI programs execute Familiarity with.
1 MPI: Message Passing Interface Prabhaker Mateti Wright State University.
Distributed Processing with MPI International Summer School 2015 Tomsk Polytechnic University Assistant Professor Dr. Sergey Axyonov.
Computer Science Department
Introduction to MPI Programming Ganesh C.N.
Collectives Reduce Scatter Gather Many more.
Introduction to parallel computing concepts and technics
CS4402 – Parallel Computing
CS 668: Lecture 3 An Introduction to MPI
Computer Science Department
Prof. Daniel S. Katz Department of Electrical and Computer Engineering
An Introduction to Parallel Programming with MPI
ITCS 4/5145 Parallel Computing, UNC-Charlotte, B
CS 5334/4390 Spring 2017 Rogelio Long
Lecture 14: Inter-process Communication
A Message Passing Standard for MPP and Workstations
MPI: Message Passing Interface
CSCE569 Parallel Computing
Message-Passing Computing More MPI routines: Collective routines Synchronous routines Non-blocking routines ITCS 4/5145 Parallel Computing, UNC-Charlotte,
MPI MPI = Message Passing Interface
Hardware Environment VIA cluster - 8 nodes Blade Server – 5 nodes
Message-Passing Computing Message Passing Interface (MPI)
Hello, world in MPI #include <stdio.h> #include "mpi.h"
Computer Science Department
Hello, world in MPI #include <stdio.h> #include "mpi.h"
CS 584 Lecture 8 Assignment?.
Presentation transcript:

Jonathan Carroll-Nellenback CIRC Summer School MESSAGE PASSING INTERFACE (MPI)

 MPI – message passing interface  Language independent communications protocol  MPI-1, MPI-2, and MPI-3 standards  Implementations typically consist of a specific set of routines callable from C, C++, or Fortran  MPICH (implements MPI – 3)  Open MPI – 1.8 (Implements MPI – 2)  IMPI – Intel MPI  MVAPICH,  Commercial implementations  Bindings for Python, Java, etc... BACKGROUND

 First MPI Program  /public/jcarrol5/mpi/example1.f90  MPI_Init – initializes mpi  MPI_Comm_rank – gets the current task rank within the communicator (starting at 0)  MPI_Comm_size – gets the size of the communicator  MPI_Finalize – closes mpi  MPI_Reduce – Collective communication  MPI_Allreduce – Collective communication  Compiling  module load openmpi  mpif90 example1.f90 (mpicc example1.c)  srun –p debug –n 4 –o output_%t a.out OUTLINE

 Parallelize exercise1.f90 or exercise1.c EXERCISE 1

 /public/jcarrol5/mpi/example2.f90  1 to All  MPI_Bcast – Broadcasts the same data to all ranks  MPI_Scatter – Evenly Distributes data to all ranks  MPI_Scatterv – Unevenly distributes data to all ranks  All to 1  MPI_Reduce – Performs a reduction operation towards a single rank  MPI_Gather – Collects evenly distributed data on one rank  MPI_Gatherv – Collects unevenly distributed data on one rank  All to All  MPI_Allreduce – Performs a reduction and broadcasts the result  MPI_Allgather – Collects evenly distributed data onto all ranks  MPI_Allgatherv – Collects unevenly distributed data onto all ranks  MPI_Alltoall – Scatter/Gather  MPI_Alltoallv – Scatterv/Gatherv COLLECTIVE COMMUNICATION ROUTINES

 Reduction Operations – MPI_MAX, MPI_MIN, MPI_SUM, MPI_PROD, MPI_BAND, MPI_BOR, MPI_BXOR, MPI_LAND, MPI_LOR, MPI_LXOR  C Data types – MPI_CHAR, MPI_SHORT, MPI_INT, MPI_LONG, MPI_UNSIGNED_CHAR, MPI_UNSIGNED_SHORT, MPI_UNSIGNED, MPI_UNSIGNED_LONG, MPI_FLOAT, MPI_DOUBLE, MPI_LONG_DOUBLE, MPI_BYTE, MPI_PACKED  Fortran Data types – MPI_CHARACTER, MPI_INTEGER, MPI_REAL, MPI_LOGICAL, MPI_INTEGER1, MPI_INTEGER2, MPI_INTEGER4, MPI_REAL2, MPI_REAL4, MPI_REAL8, MPI_DOUBLE_PRECISION, MPI_COMPLEX, MPI_DOUBLE_COMPLEX, MPI_BYTE, MPI_PACKED IMPORTANT CONSTANTS

 Parallelize exercise2.f90 or exercise2.c EXERCISE 2

 /public/jcarrol5/mpi/example3.f90  Tags – additional identifiers on messages  MPI_Send  MPI_Recv BASIC SENDING AND RECEIVING

 Modify your program from exercise2 to not use any global communication routines. EXERCISE 3

 Blocking vs Non-blocking  Non Blocking sends and receives will immediately return control to the calling routine. However, they usually will require buffering and testing later on to see whether the send/recv has completed.  Good for overlapping communication with computation  May lead to extra buffering  Synchronous vs Asynchronous  Synchronous sends require a matching recv to be called before returning. Blocking only if recv has not been posted. Does not require any additional buffering.  Buffered vs NonBuffered  Buffered sends explicitly buffer the data to be sent so that the calling routine can release the memory.  Ready send  Assumes that the receiver has already posted the recv. SENDING MODES

 /public/jcarrol5/mpi/example4.f90  MPI_Send – May or may not block  MPI_Bsend – May buffer – returns immediately  MPI_Ssend – Synchronous Send (returns after matching recv posted)  MPi_Rsend – Ready send (matching recv must be posted)  MPI_Isend – Nonblocking send (must check for completion)  MPI_Ibsend – Nonblocking buffered send  MPI_Issend – Nonblocking synchronous send  MPI_Irsend- Nonblocking ready send  MPI_Recv – Blocking receive  MPI_IRecv – Nonblocking receive SEND ROUTINES

 Rewrite exercise 3 using ready sends(rsend), synchronous sends (ssend), and nonblocking sends (isend) and see if it is any faster. EXERCISE 5

 /public/jcarrol5/mpi/example5.f90  MPI starts with one communicator (MPI_COMM_WORLD)  Separate communicator groups can be formed using  MPI_Comm_split  Or you can extract the group belonging to mpi_comm_world and create subgroups through various routines.  Multiple communicators can use the same group. COMMUNICATORS AND GROUPS