1 What is message passing? l Data transfer plus synchronization l Requires cooperation of sender and receiver l Cooperation not always apparent in code.

Slides:



Advertisements
Similar presentations
1 Tuning for MPI Protocols l Aggressive Eager l Rendezvous with sender push l Rendezvous with receiver pull l Rendezvous blocking (push or pull)
Advertisements

Categories of I/O Devices
1 What is message passing? l Data transfer plus synchronization l Requires cooperation of sender and receiver l Cooperation not always apparent in code.
MPI Message Passing Interface
PROTOCOL VERIFICATION & PROTOCOL VALIDATION. Protocol Verification Communication Protocols should be checked for correctness, robustness and performance,
Parallel Processing1 Parallel Processing (CS 667) Lecture 9: Advanced Point to Point Communication Jeremy R. Johnson *Parts of this lecture was derived.
1 Buffers l When you send data, where does it go? One possibility is: Process 0Process 1 User data Local buffer the network User data Local buffer.
Packet Switching Network One of the common communications method is packet switching, which divides messages into packets and sends each packet individually.packet.
Cache Coherent Distributed Shared Memory. Motivations Small processor count –SMP machines –Single shared memory with multiple processors interconnected.
Enforcing Mutual Exclusion Message Passing. Peterson’s Algorithm for Processes P0 and P1 void P0() { while( true ) { flag[ 0 ] = false; /* remainder */
1 Performance Modeling l Basic Model »Needed to evaluate approaches »Must be simple l Synchronization delays l Main components »Latency and Bandwidth »Load.
Reference: / Point-to-Point Communication.
Point-to-Point Communication Self Test with solution.
CSCI 4550/8556 Computer Networks Comer, Chapter 7: Packets, Frames, And Error Detection.
Portability Issues. The MPI standard was defined in May of This standardization effort was a response to the many incompatible versions of parallel.
1 Semaphores Special variable called a semaphore is used for signaling If a process is waiting for a signal, it is suspended until that signal is sent.
1: Operating Systems Overview
Message-Passing Programming and MPI CS 524 – High-Performance Computing.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
1 Parallel Computing—Introduction to Message Passing Interface (MPI)
1 Message protocols l Message consists of “envelope” and data »Envelope contains tag, communicator, length, source information, plus impl. private data.
MPI Point-to-Point Communication CS 524 – High-Performance Computing.
TCP: Software for Reliable Communication. Spring 2002Computer Networks Applications Internet: a Collection of Disparate Networks Different goals: Speed,
A Brief Look At MPI’s Point To Point Communication Brian T. Smith Professor, Department of Computer Science Director, Albuquerque High Performance Computing.
Error Checking continued. Network Layers in Action Each layer in the OSI Model will add header information that pertains to that specific protocol. On.
CS 179: GPU Programming Lecture 20: Cross-system communication.
MULTICOMPUTER 1. MULTICOMPUTER, YANG DIPELAJARI Multiprocessors vs multicomputers Interconnection topologies Switching schemes Communication with messages.
Switching Techniques Student: Blidaru Catalina Elena.
Data Communications and Networking
TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.
1 Choosing MPI Alternatives l MPI offers may ways to accomplish the same task l Which is best? »Just like everything else, it depends on the vendor, system.
1 Chapter 16 Protocols and Protocol Layering. 2 Protocol  Agreement about communication  Specifies  Format of messages (syntax)  Meaning of messages.
Specialized Sending and Receiving David Monismith CS599 Based upon notes from Chapter 3 of the MPI 3.0 Standard
Part I MPI from scratch. Part I By: Camilo A. SilvaBIOinformatics Summer 2008 PIRE :: REU :: Cyberbridges.
1 The Internet and Networked Multimedia. 2 Layering  Internet protocols are designed to work in layers, with each layer building on the facilities provided.
Sami Al-wakeel 1 Data Transmission and Computer Networks The Switching Networks.
Parallel Computing A task is broken down into tasks, performed by separate workers or processes Processes interact by exchanging information What do we.
Jonathan Carroll-Nellenback CIRC Summer School MESSAGE PASSING INTERFACE (MPI)
MPI Communications Point to Point Collective Communication Data Packaging.
Performance Oriented MPI Jeffrey M. Squyres Andrew Lumsdaine NERSC/LBNL and U. Notre Dame.
Minimizing Communication Latency to Maximize Network Communication Throughput over InfiniBand Design and Implementation of MPICH-2 over InfiniBand with.
Chapter 8-2 : Multicomputers Multiprocessors vs multicomputers Multiprocessors vs multicomputers Interconnection topologies Interconnection topologies.
1 Overview on Send And Receive routines in MPI Kamyar Miremadi November 2004.
Packet switching network Data is divided into packets. Transfer of information as payload in data packets Packets undergo random delays & possible loss.
MPI (continue) An example for designing explicit message passing programs Advanced MPI concepts.
Client-Server Model of Interaction Chapter 20. We have looked at the details of TCP/IP Protocols Protocols Router architecture Router architecture Now.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
1 Lecture 4: Part 2: MPI Point-to-Point Communication.
MPI Point to Point Communication CDP 1. Message Passing Definitions Application buffer Holds the data for send or receive Handled by the user System buffer.
FIT5174 Parallel & Distributed Systems Dr. Ronald Pose Lecture FIT5174 Distributed & Parallel Systems Lecture 5 Message Passing and MPI.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
MPI Send/Receive Blocked/Unblocked Josh Alexander, University of Oklahoma Ivan Babic, Earlham College Andrew Fitz Gibbon, Shodor Education Foundation Inc.
Firewalls A brief introduction to firewalls. What does a Firewall do? Firewalls are essential tools in managing and controlling network traffic Firewalls.
1 Protocols and Protocol Layering. 2 Protocol Agreement about communication Specifies –Format of messages –Meaning of messages –Rules for exchange –Procedures.
Switching. Circuit switching Message switching Packet Switching – Datagrams – Virtual circuit – source routing Cell Switching – Cells, – Segmentation.
Mutual Exclusion Algorithms. Topics r Defining mutual exclusion r A centralized approach r A distributed approach r An approach assuming an organization.
1 Advanced MPI William D. Gropp Rusty Lusk and Rajeev Thakur Mathematics and Computer Science Division Argonne National Laboratory.
Data Communication Networks Lec 13 and 14. Network Core- Packet Switching.
Lecture 3 Point-to-Point Communications Dr. Muhammad Hanif Durad Department of Computer and Information Sciences Pakistan Institute Engineering and Applied.
Communication in Distributed Systems. . The single most important difference between a distributed system and a uniprocessor system is the interprocess.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
MPI Point to Point Communication
Last Class: RPCs and RMI
MPI Message Passing Interface
CS 258 Reading Assignment 4 Discussion Exploiting Two-Case Delivery for Fast Protected Messages Bill Kramer February 13, 2002 #
More on MPI Nonblocking point-to-point routines Deadlock
MPI-Message Passing Interface
More on MPI Nonblocking point-to-point routines Deadlock
Typically for using the shared memory the processes should:
Barriers implementations
Presentation transcript:

1 What is message passing? l Data transfer plus synchronization l Requires cooperation of sender and receiver l Cooperation not always apparent in code Data Process 0 Process 1 May I Send? Yes Data Time

2 Quick review of MPI Message passing l Basic terms »nonblocking - Operation does not wait for completion »synchronous - Completion of send requires initiation (but not completion) of receive »ready - Correct send requires a matching receive »asynchronous - communication and computation take place simultaneously, not an MPI concept (implementations may use asynchronous methods)

3 Message protocols l Message consists of “envelope” and data »Envelope contains tag, communicator, length, source information, plus impl. private data l Short »Message data (message for short) sent with envelope l Eager »Message sent assuming destination can store l Rendezvous »Message not sent until destination oks

4 Special Protocols for DSM l Message passing is a good way to use distributed shared memory (DSM) machines because it provides a way to express memory locality. l Put »Sender puts to destination memory (user or MPI buffer). Like Eager. l Get »Receiver gets data from sender or MPI buffer. Like Rendezvous. l Short, long, rendezvous versions of these

5 Message Protocol Details l Eager not Rsend, rendezvous not Ssend resp., but related l User versus system buffer space l Packetization l Collective operations l Datatypes, particularly non-contiguous »Handling of important special cases –Constant stride –Contiguous structures

6 Eager Protocol Process 0 Process 1 Time Data l Data delivered to process 1 »No matching receive may exist; process 1 must then buffer and copy.

7 Eager Features l Reduces synchronization delays l Simplifies programming (just MPI_Send) l Requires significant buffering l May require active involvement of CPU to drain network at receiver’s end l May introduce additional copy (buffer to final destination)

8 How Scaleable is Eager Delivery? l Buffering must be reserved for arbitrary senders l User-model mismatch (often expect buffering allocated entirely to “used” connections). l Common approach in implementations is to provide same buffering for all members of MPI_COMM_WORLD; this is optimizing for non-scaleable computations l Scaleable implementations that exploit message patterns are possible

9 Rendezvous Protocol l Envelope delivered first l Data delivered when user-buffer available »Only buffering of envelopes required Data Process 0 Process 1 May I Send? Yes Data Time

10 Rendezvous Features l Robust and safe »(except for limit on the number of envelopes…) l May remove copy (user to user direct) l More complex programming (waits/tests) l May introduce synchronization delays (waiting for receiver to ok send)

11 Short Protocol l Data is part of the envelope l Otherwise like eager protocol l May be performance optimization in interconnection system for short messages, particularly for networks that send fixed-length packets (or cache lines)

12 User and System Buffering l Where is data stored (or staged) while being sent? »User’s memory –Allocated on the fly –Preallocated »System memory –May be limited –Special memory may be faster

13 Implementing MPI_Isend l Simplest implementation is to always use rendezvous protocol: »MPI_Isend delivers a request-to-send control message to receiver »Receiving process responds with an ok-to-send –May or may not have matching MPI receive; only needs buffer space to store incoming message »Sending process transfers data l Wait for MPI_Isend request »wait for ok-to-send message from receiver »wait for data transfer to be complete on sending side

14 Alternatives for MPI_Isend l Use a short protocol for small messages »No need to exchange control messages »Need guaranteed (but small) buffer space on destination for short message envelope »Wait becomes a no-op l Use eager protocol for modest sized messages »Still need guaranteed buffer space for both message envelope and eager data on destination »Avoids exchange of control messages

15 Implementing MPI_Send Can’t use eager always because this could overwhelm the receiving process if (rank != 0) MPI_Send( 100 MB of data ) else receive 100 MB from each process l Would like to exploit the blocking nature (can wait for receive) l Would like to be fast l Select protocol based on message size (and perhaps available buffer space at destination) »Short and/or eager for small messages »Rendezvous for longer messages

16 Implementing MPI_Rsend l Just use MPI_Send; no advantage for users l Use eager always (or short if small) »even for long messages

17 Why Bsend? l Buffer space not infinite l Careful management of buffering required for correctness and performance l MPI provides user control over buffering modes l Allows implementations freedom to pick specific protocols »Users give up some control for more convenient general-purpose send (MPI_Send) l Implementations could make Bsend fast, at least when buffering is available at the destination