Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 9

Similar documents
Parallel Programming. Functional Decomposition (Document Classification)

Parallel Programming in C with MPI and OpenMP

Document Classification Problem

Document Classification

Programming Scalable Systems with MPI. Clemens Grelck, University of Amsterdam

Programming Scalable Systems with MPI. UvA / SURFsara High Performance Computing and Big Data. Clemens Grelck, University of Amsterdam

Outline. Communication modes MPI Message Passing Interface Standard

Outline. Communication modes MPI Message Passing Interface Standard. Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa Tp.HCM

Parallel Programming with MPI and OpenMP

COSC 6374 Parallel Computation

High performance computing. Message Passing Interface

Non-Blocking Communications

CS 470 Spring Mike Lam, Professor. Distributed Programming & MPI

Standard MPI - Message Passing Interface

Parallel Programming

CS 470 Spring Mike Lam, Professor. Distributed Programming & MPI

Non-Blocking Communications

CSE 613: Parallel Programming. Lecture 21 ( The Message Passing Interface )

CS 179: GPU Programming. Lecture 14: Inter-process Communication

Parallel Short Course. Distributed memory machines

Point-to-Point Communication. Reference:

Parallel Programming

Intermediate MPI (Message-Passing Interface) 1/11

Intermediate MPI (Message-Passing Interface) 1/11

Lecture 7: More about MPI programming. Lecture 7: More about MPI programming p. 1

CSCE 5160 Parallel Processing. CSCE 5160 Parallel Processing

Introduction to parallel computing concepts and technics

Programming with MPI. Pedro Velho

Programming with MPI on GridRS. Dr. Márcio Castro e Dr. Pedro Velho

Message Passing Interface. George Bosilca

Message Passing Interface

All-Pairs Shortest Paths - Floyd s Algorithm

Basic MPI Communications. Basic MPI Communications (cont d)

Topics. Lecture 6. Point-to-point Communication. Point-to-point Communication. Broadcast. Basic Point-to-point communication. MPI Programming (III)

Message Passing Interface. most of the slides taken from Hanjun Kim

More about MPI programming. More about MPI programming p. 1

Message Passing Interface

Department of Informatics V. HPC-Lab. Session 4: MPI, CG M. Bader, A. Breuer. Alex Breuer

More advanced MPI and mixed programming topics

Parallel Numerical Algorithms

MPI Message Passing Interface

Introduction to MPI: Part II

More MPI. Bryan Mills, PhD. Spring 2017

Parallel programming MPI

COMP 322: Fundamentals of Parallel Programming

A Message Passing Standard for MPP and Workstations

Parallel Computing Paradigms

What s in this talk? Quick Introduction. Programming in Parallel

Message-Passing and MPI Programming

CS 6230: High-Performance Computing and Parallelization Introduction to MPI

Part - II. Message Passing Interface. Dheeraj Bhardwaj

15-440: Recitation 8

What is Point-to-Point Comm.?

Lecture 16. Parallel Matrix Multiplication

HPC Parallel Programing Multi-node Computation with MPI - I

MPI: Parallel Programming for Extreme Machines. Si Hammond, High Performance Systems Group

Introduction to MPI. May 20, Daniel J. Bodony Department of Aerospace Engineering University of Illinois at Urbana-Champaign

LOAD BALANCING DISTRIBUTED OPERATING SYSTEMS, SCALABILITY, SS Hermann Härtig

Parallel Programming in C with MPI and OpenMP

Acknowledgments. Programming with MPI Basic send and receive. A Minimal MPI Program (C) Contents. Type to enter text

Programming with MPI Basic send and receive

Topics. Lecture 7. Review. Other MPI collective functions. Collective Communication (cont d) MPI Programming (III)

Exercises: April 11. Hermann Härtig, TU Dresden, Distributed OS, Load Balancing

Introduction to MPI. Ricardo Fonseca.

Parallel programming with MPI. Jianfeng Yang Internet and Information Technology Lab Wuhan university

CS 426. Building and Running a Parallel Application

The MPI Message-passing Standard Practical use and implementation (III) SPD Course 01/03/2017 Massimo Coppola

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 8

Extending the Task-Aware MPI (TAMPI) Library to Support Asynchronous MPI primitives

COSC 6374 Parallel Computation. Message Passing Interface (MPI ) I Introduction. Distributed memory machines

Distributed Memory Systems: Part IV

CS 470 Spring Mike Lam, Professor. Distributed Programming & MPI

Buffering in MPI communications

Non-blocking Communications

Introduction to MPI. SuperComputing Applications and Innovation Department 1 / 143

Collective Communication in MPI and Advanced Features

immediate send and receive query the status of a communication MCS 572 Lecture 8 Introduction to Supercomputing Jan Verschelde, 9 September 2016

Parallel hardware. Distributed Memory. Parallel software. COMP528 MPI Programming, I. Flynn s taxonomy:

PROGRAMMING WITH MESSAGE PASSING INTERFACE. J. Keller Feb 26, 2018

Further MPI Programming. Paul Burton April 2015

Programming SoHPC Course June-July 2015 Vladimir Subotic MPI - Message Passing Interface

Lecture 14. Performance Profiling Under the hood of MPI Parallel Matrix Multiplication MPI Communicators

Cluster Computing MPI. Industrial Standard Message Passing

MPI, Part 3. Scientific Computing Course, Part 3

MPI. (message passing, MIMD)

Parallel Programming

CME 194 Introduc0on to MPI

Lesson 1. MPI runs on distributed memory systems, shared memory systems, or hybrid systems.

Parallel Programming in C with MPI and OpenMP

CS4961 Parallel Programming. Lecture 19: Message Passing, cont. 11/5/10. Programming Assignment #3: Simple CUDA Due Thursday, November 18, 11:59 PM

In the simplest sense, parallel computing is the simultaneous use of multiple computing resources to solve a problem.

Discussion: MPI Basic Point to Point Communication I. Table of Contents. Cornell Theory Center

MPI 2. CSCI 4850/5850 High-Performance Computing Spring 2018

Distributed Memory Programming with MPI

MATH 676. Finite element methods in scientific computing

Introduction to Parallel and Distributed Systems - INZ0277Wcl 5 ECTS. Teacher: Jan Kwiatkowski, Office 201/15, D-2

Introduction to the Message Passing Interface (MPI)

The MPI Message-passing Standard Practical use and implementation (III) SPD Course 03/10/2010 Massimo Coppola

Programming Using the Message Passing Paradigm

MPI (Message Passing Interface)

Transcription:

Chapter 9 Document Classification Document Classification Problem Search directories, subdirectories for documents (look for.html,.txt,.tex, etc.) Using a dictionary of key words, create a profile vector for each document Store profile vectors 1

Document Classification Problem Data Dependence Graph (1) 2

Partitioning and Communication Most of the time spent reading documents and generating profile vectors Create two primitive tasks for each document Data Dependence Graph (2) 3

Agglomeration and Mapping Number of tasks not known at compile time Tasks do not communicate with each other Time needed to perform tasks varies widely Strategy: map tasks to processes at run time Manager/worker-style Algorithm Can also be viewed as domain partitioning with run-time allocation of data to tasks 4

Manager/Worker vs. SPMD SPMD (single program multiple data) Every process executes same functions Our prior programs fit this mold Manager/worker Manager process has different responsibilities than worker processes An MPI manager/worker program has an early control flow split (manager process one way, worker processes the other way) Roles of Manager and Workers 5

Manager Pseudocode Identify documents Receive dictionary size from worker 0 Allocate matrix to store document vectors repeat Receive message from worker if message contains document vector Store document vector endif if documents remain then Send worker file name else Send worker termination message endif until all workers terminated Write document vectors to file Worker Pseudocode Send first request for work to manager if worker 0 then Read dictionary from file endif Broadcast dictionary among workers Build hash table from dictionary if worker 0 then Send dictionary size to manager endif repeat Receive file name from manager if file name is NULL then terminate endif Read document, generate document vector Send document vector to manager forever 6

Task/Channel Graph MPI_Abort A quick and dirty way for one process to terminate all processes in a specified communicator Example use: If manager cannot allocate memory needed to store document profile vectors 7

Header for MPI_Abort int MPI_Abort ( MPI_Comm comm, /* Communicator */ int error_code) /* Value returned to calling environment */ Creating a Workers-only Communicator Dictionary is broadcast among workers To support workers-only only broadcast, need workers-only only communicator Can use MPI_Comm_split Manager passes MPI_UNDEFINED as the value of split_key, meaning it will not be part of any new communicator 8

Workers-only Communicator int id; MPI_Comm worker_comm;... if (!id) /* Manager */ MPI_Comm_split (MPI_COMM_WORLD, MPI_UNDEFINED, id, &worker_comm); else /* Worker */ MPI_Comm_split (MPI_COMM_WORLD, 0, id, &worker_comm); Nonblocking Send / Receive MPI_Isend, Isend MPI_Irecv Irecv initiate operation MPI_Wait blocks until operation complete Calls can be made early MPI_Isend as soon as value(s) assigned MPI_Irecv as soon as buffer available Can eliminate a message copying step Allows communication / computation overlap 9

Function MPI_Irecv int MPI_Irecv ( void *buffer, int cnt, MPI_Datatype dtype, int src, int tag, MPI_Comm comm, MPI_Request *handle ) Pointer to object that identifies communication operation Function MPI_Wait int MPI_Wait ( ) MPI_Request *handle, MPI_Status *status 10

Function MPI_Isend int MPI_Isend ( void *buffer, int cnt, MPI_Datatype dtype, int dest, int tag, MPI_Comm comm, MPI_Request *handle ) Pointer to object that identifies communication operation Receiving Path Name Worker does not know length of longest path name it will receive Alternatives Allocate huge buffer Check length of incoming message, then allocate buffer We ll take the second alternative 11

Blocks until message is available to be received Function MPI_Probe int MPI_Probe ( int int src, tag, MPI_Comm comm, ) MPI_Status *status Function MPI_Get_count int MPI_Get_count ( MPI_Status *status, MPI_Datatype dtype, ) int *cnt 12

Enhancements Middle ground between pre-allocation and one-at-a-time time allocation Pipelining of document processing Pipelining 13

Allocation Alternatives Time Load imbalance Excessive communication overhead 1 Documents Allocated per Request n/p Time Savings through Pipelining 14

Pipelined Manager Pseudocode a 0 {assigned jobs} j 0 {available jobs} w 0 {workers waiting for assignment} repeat if (j > 0) and (w > 0) then assign job to worker j j 1; w w 1; a a + 1 elseif (j > 0) then handle an incoming message from workers increment w else get another job increment j endif until (a = n) and (w = p) Function MPI_Testsome int MPI_Testsome ( int in_cnt, /* IN - Number of nonblocking receives to check */ MPI_Request *handlearray, /* IN - Handles of pending receives */ int *out_cnt, /* OUT - Number of completed communications */ int *index_array, /* OUT - Indices of completed communications */ MPI_Status *status_array) /* OUT - Status records for completed comms */ 15

Summary Manager/worker paradigm Dynamic number of tasks Variable task lengths No communications between tasks New tools for kit Create manager/worker program Create workers-only only communicator Non-blocking send/receive Testing for completed communications 16