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

Size: px
Start display at page:

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

Transcription

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

2 Structure Message Passing Programs Basic Operations for Communication Message Passing Interface Standard First Examples Collective Communication Operations Send/Receive Variants Slide 2

3 Message-Passing Programs I Message Passing Program = Multiple processes, each with own address space Explicit parallelism via multiple processes Each input stored with one process: No replication of data if possible Same for intermediate results and final results Necessary: mapping of data to processes Mapping known to all processes Slide 3

4 Message-Passing Programs II Mapping data process such that majority of accesses is local Access to non-local data: communication between processes Communication: explicit and two-sided two-sided = sender and receiver involved Read access by process i to non-local data (stored with process j): two possible cases Slide 4

5 Message-Passing Programs III Case 1: process j knows which data, who wants them, and when Process j sends data, process i receives Case 2: some information unknown Process i sends request to process j Process j receives request Process j sends data, process i receives Write access to non-local data: Process i sends data (and meta information if needed) to process j Process j receives (and stores locally) Process j participates actively in each case! Slide 5

6 Message-Passing Programs IV Process j must plan calls to communication routines although not part of his computation Difficult for dynamic and/or unstructured communication Goal: well-structured Communication Communication as seldom as possible Slide 6

7 Message-Passing Programs V Advantages: Communication and communication cost explicit simplifies optimization Synchronisation of processes free with comm. Paradigm fits almost any collection of computers Consequence: Almost all programs on high-performance computers are message passing programs Today often coupled with OpenMP Slide 7

8 Basic Operations for Comm. I Basic operations for communication: send and receive Three relevant parameters: Pointer to data Size of data ID of communication partner Send: data to be sent and target ID Receive: buffer for data to be received ID can be wildcard = from any process Slide 8

9 Basic Operations for Comm. II Send/Receive in several variants: non-blocking (possibly) blocking synchronous Non-blocking Send: forwards pointer, size and target ID to communication system and returns Adantage: very fast Problem: unclear when data are transmitted/copied unclear when local data can be modified or deleted Solution: Send returns identifier to check Slide 9

10 Basic Operations for Comm. III Synchronous send: returns only when receiving process invokes receive funct. Advantage: local send buffer is free upon return processes synchronized, like barrier Disadvantage: possibly wait for receiving process (possibly) Blocking Send: return when data transmitted / copied to system buffer Advantage: local send buffer is free upon return Disadvantage: time depends on availability of buffers Slide 10 possibly almost as fast as non-blocking send, possibly as slow as synchr. send

11 Basic Operations for Comm. IV Non-blocking Receive: if no data yet arrived, return with status if data arrived, return with data Advantage: fast and flexible (can do something inbetween) Disadvantage: programmer responsible to check regularly Blocking Receive: wait for data received in system buffer, copy to local buffer and return Advantage: message handled as soon as possible Disadvantage: additional buffers, add. copy, add. time Slide 11

12 Basic Operations for Comm. V Beware of deadlock! Example: Process 0 Process 1 send(dataptr1,1,proc1); recv(dataptr2,1,proc1); send(dataptr3,1,proc0); recv(dataptr4,1,proc0); Example works for blocking send with buffer but not for synchronous send or blocking send without buffer Slide 12

13 Basic Operations for Comm. VI Same can happen with blocking receive! Example: Process 0 Process 1 recv(dataptr2,1,proc1); send(dataptr1,1,proc1); recv(dataptr4,1,proc0); send(dataptr3,1,proc0); Slide 13

14 Basic Operations for Comm. VII If send and receive are executed about simultaneously: better without buffer, especially for large data If send executed earlier than receive: better with buffer as send need not wait If receive executed earlier than send: Receive must wait better change algorithm Slide 14

15 MPI Standard I MPI = Message Passing Interface Standard, not a product Maintained by MPI-Forum, consortium of companies and universities Version Version Version (as part of MPI 2.0) in the course Version (as part of MPI 2.1, End of MPI 1.x) Version (MPI parallel I/O, one-sided comm., dyn. Proc.) Version (comprises MPI 1.3) Version Version (e.g. non-blocking collective operations) Version Slide 15 Version 4.0 under discussion

16 MPI Standard II Free implementations available, e.g.: LAM/MPI: MPICH: Implementation comprises demon processes on all cluster nodes start processes, implement communication library with API allows MPI program to communicate Slide 16

17 MPI Standard III MPI program = SPMD program in C with extensions Program starts with fixed number of processes Compiling and start: depends on implementation Example: mpirun np 4 <exe-name> when on console give meta-data to batch system like torque MPI 1.2: >125 functions Minimum: 6 functions Slide 17

18 MPI Standard IV Use header file: #include mpi.h int MPI_Init(int *argc,char ***argv) Parameters = pointers to main() parameters Call in program before - calling other MPI functions - evaluating argc and argv parameters returns MPI_SUCCESS or error int MPI_Finalize(void) call towards end of program, no other MPI function called later return value: like MPI_Init Slide 18 Parallele Programmierung mit MPI LG Parallelität und VLSI Prof. Dr. J. Keller

19 MPI Standard V int MPI_Comm_size(MPI_Comm comm,int *size) int MPI_Comm_rank(MPI_Comm comm,int *rank) size gives number of processes rank gives ID of calling process in range 0 size-1 First parameter: communicator, declares set of processes Normally MPI_COMM_WORLD Processes can be partitioned, subsets denoted by other communicators Communicator important for collective communication like broadcast, i.e. sending a message to all processes Slide 19 Parallele Programmierung mit MPI LG Parallelität und VLSI Prof. Dr. J. Keller

20 MPI Standard VI int MPI_Send(void *buf,int cnt,mpi_datatype dt, int dest,int tag,mpi_comm comm) int MPI_Recv(void *buf,int cnt,mpi_datatype dt, int src,int tag,mpi_comm comm,mpi_status *st) Datatypes: MPI_CHAR, MPI_INT,MPI_FLOAT,MPI_DOUBLE Tag: distinguishes different messages from one sender Range: 0 MPI_TAG_UB (at least 32767) Wildcards: MPI_ANY_SOURCE, MPI_ANY_TAG Slide 20

21 MPI Standard VII Status: gives sender + tag, relevant when using MPI_ANY_* struct MPI_Status { int MPI_SOURCE, MPI_TAG, MPI_ERROR;} Return value: MPI_SUCCESS or error e.g. MPI_ERR_TRUNCATE at recv if msg longer than buffer If message could be shorter than buffer: int MPI_Get_count(MPI_Status *st,mpi_datatype dt,int *cnt) gives number of received elements MPI_Send and MPI_Recv: possibly blocking, buffers depend on implementation, i.e. might be synchronous Slide 21

22 MPI First Examples I #include mpi.h int main(int argc,char **argv){ int size, rank,tmp; if(mpi_init(&argc,&argv)!=mpi_success) return -1; MPI_Comm_size(MPI_COMM_WORLD,&size); if(size<2) return -2; // 2 Processes needed MPI_Comm_rank(MPI_COMM_WORLD,&rank); MPI_Finalize(); return 0; } Slide 22

23 MPI First Examples II if(rank==0){ tmp = 1234; MPI_Send((void*)&tmp,1,MPI_INT,1,15,MPI_C ); MPI_Recv((void*)&tmp,1,MPI_INT,1,16,MPI_C,NULL); if(tmp!= 1235) return -3; }else{ // rank == 1 MPI_Recv((void*)&tmp,1,MPI_INT,0,15,MPI_C,NULL); tmp++; MPI_Send((void*)&tmp,1,MPI_INT,0,16,MPI_C ); } Slide 23

24 MPI First Examples IIII Multiplication of 4 x n-matrix A and n-vector b Cluster has 4 nodes, i.e. program started with 4 proc. 3 questions: Which node gets which part of A and b? (input) Which node computes which part of c=a*b? (output) Which non-local data will it need? (communication) Computation: c = (c 1,,c 4 ) T c i = a i1 *b 1 + +a in *b n, i=1,,4 Slide 24

25 MPI First Examples IV Input, Matrix A: Node i stores i-th row of A in local memory, i=1 4 Output: Node i computes element c i of result vector Each node needs complete vector b Either: replicate vector 2*n doubles per node instead of 1.25*n, no communication Alternative: Each node stores ¼ of vector locally Communication: rotate parts in ring communication Slide 25

26 MPI First Examples V Initial vector distribution: possible computation Slide 26

27 MPI First Examples VI Vector after one ring communication: next comput. Slide 27

28 MPI First Examples VII Algorithm: res=0; for(j=0,rnd=rank;j<4;j++,rnd=(rnd+1)%4){ for(i=0;i<n/4;i++) res += row[rnd*n/4+i]*vector[i]; MPI_Send(vector,n/4,MPI_DOUBLE,(rank+1)%4,rnd, MPI_COMM_WORLD); MPI_Recv(vector,n/4,MPI_DOUBLE,(rank-1)%4,rnd, MPI_COMM_WORLD,NULL); } Slide 28

29 MPI First Examples VIII Important: synchronous send would lead to deadlock Cannon s Algorithm for Matrix-Matrix-Mult. uses similar approach to rotate matrix rows & columns Slide 29

30 Collective Communication I collective Communication: more than one sender or more than one receiver Example: Reduction = all MPI processes send data to one receiver, data combined through operation Allows e.g. to add up partial sums Slide 30

31 Collective Communication II Broadcast: MPI_Bcast(buffer, count, datatype, root, comm) One sender (=root) sends same data to all processes sender: buffer points to data to be sent all others: buffer points to memory to store received data Scatter: MPI_Scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm) One sender (=root) sends data to all processes but different data for each receiver Gather: MPI_Gather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm) All processes send different data to one receiver (=root) data will be concatenated Slide 31

32 Collective Communication III Reduce: MPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm) All processes send data to one receiver (=root) Data are combined by op, e.g. sum or max All-to-All: MPI_Alltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm) Each process sends data to each process Barrier: MPI_Barrier(comm) Returns only when all processes of communicator have reached barrier Not for data exchange, but flow control, e.g. to separate rounds in iterative algorithms Slide 32

33 Collective Communication IV Prefix: int MPI_Scan(sendbuf,recvbuf,cnt,datatpe,op,comm) Process with rank i receives reduction of data from processes 0 to i Each process sender and receiver, hence no root! Example: 4 processes, data: 4, 3, 2, 1, operation: sum Result: Proc0: 4, Proc1: 7, Proc2: 9, Proc3: 10 Additionally: MPI_Allgather=gather+broadcast, no root MPI_Allreduce=reduce+broadcast, no root Slide 33

34 Collective Communikation V Why collective communication functions? NOT a new functionality! All collective operations implementable with send/recv plus some local computation Higher performance! Sophisticated algorithms e.g. for fast reduction Implementation can use platform specifics, e.g. support for synchronization Relieves programmer from re-inventing the wheel! Slide 34

35 Collective Communication VI Particular for collective communication in MPI: All processes of communicator use same routine no matter if involved as sender or receiver Disadvantage: large number of parameters Slide 35

36 MPI One More Example // compute sum over array in parallel If(rank==0){ p=(int*)malloc(size*n*sizeof(int)); init(p);} else p=(int*)malloc(n*sizeof(int)); MPI_Scatter(p,N,MPI_INT,p,N,MPI_INT,0,MPI_C ); for(lsum=0,i=0;i<n;i++) lsum += p[i]; MPI_Gather(&lsum,1,MPI_INT,p,1,MPI_INT,0,MPI_C ); if(rank==0) for(lsum=0,i=0;i<size;i++) lsum += p[i]; // Alternative: //MPI_Reduce(&lsum,p,1,MPI_INT,MPI_SUM,0,MPI_C ); Slide 36

37 Send/Recv Variants I Send and Receive in one int MPI_SendRecv(void *sbuf,int scnt,mpi_datatype sdt, int dst,int stag,void *rbuf,int rcnt,mpi_datatype rdt, int src,int rtag,mpi_comm comm,mpi_status *s) Same buffer, count, and data type for send and receive int MPI_SendRecv_replace(void *buf,int cnt, MPI_Datatype dt, int dst,int stag,int src,int rtag, MPI_Comm comm,mpi_status *s) Slide 37

38 Send/Recv Variants II Simplifies example code if(rank==0){ tmp = 1234; MPI_Send((void*)&tmp,1,MPI_INT,1,15,MPI_COMM_WORLD); MPI_Recv((void*)&tmp,1,MPI_INT,1,16,MPI_C,NULL); if(tmp!= 1235) return -3; }else{ // rank == 1 MPI_Recv((void*)&tmp,1,MPI_INT,0,15,MPI_C,NULL); tmp++; MPI_Send((void*)&tmp,1,MPI_INT,0,16,MPI_COMM_WORLD); } Slide 38

39 Send/Recv Variants III if(rank==0){ tmp = 1234; MPI_Sendrecv_replace((void*)&tmp,1,MPI_INT,1,15,1,16, MPI_COMM_WORLD,NULL); if(tmp!= 1235) return -3; }else{ // rank == 1 MPI_Recv((void*)&tmp,1,MPI_INT,0,15,MPI_C,NULL); tmp++; MPI_Send((void*)&tmp,1,MPI_INT,0,16,MPI_C ); } Works also for synchronous send Slide 39

40 Send/Recv Variants IV Parallel algorithms often work in rounds: Local computation Communication Local computation Communication Performance improved when computation and communication overlapped Example: Matrix-Vector-Product Slide 40

41 Send/Recv Variants V for(j=0,rnd=rank;j<4;j++,rnd=(rnd+1)%4){ for(i=0;i<n/4;i++) res += row[rnd*n/4+i]*vector[i]; MPI_Send(vector,n/4,MPI_DOUBLE,(rank-1)%4,rnd,MPI_C..); MPI_Recv(vector,n/4,MPI_DOUBLE,(rank+1)%4,rnd,MPI_C..); } Vector not modified in local computation send can start prior to local computation But: MPI_Send possibly blocking And if non-blocking, vector might be overwritten in Recv before Send is complete Slide 41

42 Send/Recv Variants VI Non-blocking variants MPI_Isend: additional parameter MPI_Request *rq MPI_Irecv: Request parameter instead of status MPI_Wait(MPI_Request *rq,mpi_status *st) Blocks until operation specified by request is complete returns status and resets request MPI_Test(MPI_Request *rq,int *flag,mpi_status *st) if operation specified by request complete: flag!=0 and reset request otherwise: flag == 0 Slide 42

43 Send/Recv Variants VII Adapt example code: for(j=0,rnd=rank;j<4;j++,rnd=(rnd+1)%4){ MPI_ISend(vector,n/4,MPI_D..,(rank-1)%4,rnd,MPI_C..,&req); for(i=0;i<n/4;i++) res += row[rnd*n/4+i]*vector[i]; MPI_Wait(&req,NULL); MPI_Recv(vector,n/4,MPI_DOUBLE,(rank+1)%4,rnd,MPI_C..); } Combination of non-blocking send and (possibly) blocking recv is allowed, also other combination Slide 43

44 Send/Recv Variants VIII Use of different communicators: affects send/recv, and essential for collective communication In MPI: Partition processes of one communicator in groups, each with a new communicator Previous communicators remain visible, i.e. process may belong to several communicators Note: rank may differ in different communicators order relation not maintained! Slide 44

45 Send/Recv Variants IX int MPI_Comm_split(MPI_Comm ca,int c,int k,mpi_comm *cn) Must be called by all processes of current communicator ca All processes with same value of c (color) belong to one common, new communicator Number and size of new communicators flexible Ranks within new communicator given according to value of k (key) For same values, order in current communicator maintained Slide 45

46 Send/Recv Varianten X Example with 5 processes: MPI_Comm nc; int nsize,nrank; int c,k; // size and rank in MPI_COMM_WORLD are computed if(rank<3){ c=5; k=4-rank;} else { c=4; k=1;} MPI_Comm_split(MPI_COMM_WORLD,c,k,&nc); MPI_Comm_size(nc,&nsize); MPI_Comm_rank(nc,&nrank); Slide 46

47 Send/Recv Variants XI rank color key nrank Slide 47

48 Master-Worker Example I Implement taskpool via master-worker approach Master: knows all tasks Workers: ask if idle and receive task (or hint if all tasks completed) Master does not know which worker asks next: use wildcard in recv Task result is an int >0, worker sends to master Slide 48

49 Master-Worker Example II Between MPI_Init and MPI_Finalize: Function main() comprises only distinction between master and workers if(rank==0) master(size); else worker(); Master initializes tasks Data structure tasktype comprises only an int >0 to avoid complex packing for send Master needs communicator size to count if all all workers informed that all tasks completed Master sends common information to all workers Slide 49

50 Master-Worker Example III void master(int size){ Pool Pd; int info; // allocate and initialize Pool, send common info init(&pd); MPI_Bcast((void*)&info,1,MPI_INT,0,MPI_COMM_WORLD); do{ providetask(&pd); }while(pd.tasknum > 0); size--; // master does not need notification while(size--) notifyworker(); } Slide 50

51 Master-Worker Example IV void providetask(pool *p){ int res; MPI_Status st; } MPI_Recv((void*)&res,1,MPI_INT,MPI_ANY_SOURCE,27, MPI_COMM_WORLD,&st); if(res>0) storeresult(res); MPI_Send((void*)&(p->queue[p->index]),1,MPI_INT, st.mpi_source,28,mpi_comm_world); p->index++; p->tasknum--; Slide 51

52 Master-Worker Example V void notifyworker(){ int res; int note=-1; // indicates: no more tasks MPI_Status st; } MPI_Recv((void*)&res,1,MPI_INT,MPI_ANY_SOURCE,27, MPI_COMM_WORLD,&st); if(res>0) storeresult(res); MPI_Send((void*)&note,1,MPI_INT, st.mpi_source,28,mpi_comm_world); Slide 52

53 Master-Worker Example VI void worker(void){ int res=-1; int task; int info; // for master specific information } MPI_Bcast((void*)&info,1,MPI_INT,0,MPI_COMM_WORLD); do{ MPI_Send((void*)&res,1,MPI_INT,0,27,MPI_COMM_W ); MPI_Recv((void*)&task,1,MPI_INT,0,28,MPI_C,NULL); if(task!=-1) res=performtask(task); }while(task!=-1); Slide 53

54 Master-Worker Example VII Variants: If taskpool static: worker can collect results and send all results together to master at the end Possible: request new task before executing actual task Example for overlap of computation and communication saves round-trip time Can be done with MPI_ISend Slide 54

55 Master-Example VIII If pool dynamic, i.e. if task results can produce new tasks: send k results together Optimal value of k depends on initial size of pool and number of workers: choose large (to avoid communication) but small enough that pool is not empty in-between Many workers may need several master processes Mapping can be static, dynamic, or probabilistic Slide 55

56 Master-Worker Example IX Static mapping: Worker always asks same master If master has few tasks: master may request tasks from other master Probabilistic mapping: Worker asks each master with certain probability prob = 1/n for each of n masters very dynamic prob = w close to 1 for one master, =(1-w)/(n-1) for others almost static Other distributions, like geometric, possible Slide 56

57 Master-Worker Example X Dynamic mapping: Worker always asks one master first (static) If no task available, ask other masters (prob.) Static mapping: one communicator per master (and assigned workers, because of broadcast Dynamic and probabilistic mappings: one communicator per master and all workers i.e. in all communicators or: one communicator, and each master must participate in broadcast of other masters Slide 57

Parallel programming MPI

Parallel programming MPI Parallel programming MPI Distributed memory Each unit has its own memory space If a unit needs data in some other memory space, explicit communication (often through network) is required Point-to-point

More information

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

Message Passing Interface. most of the slides taken from Hanjun Kim Message Passing Interface most of the slides taken from Hanjun Kim Message Passing Pros Scalable, Flexible Cons Someone says it s more difficult than DSM MPI (Message Passing Interface) A standard message

More information

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

CSE 613: Parallel Programming. Lecture 21 ( The Message Passing Interface ) CSE 613: Parallel Programming Lecture 21 ( The Message Passing Interface ) Jesmin Jahan Tithi Department of Computer Science SUNY Stony Brook Fall 2013 ( Slides from Rezaul A. Chowdhury ) Principles of

More information

HPC Parallel Programing Multi-node Computation with MPI - I

HPC Parallel Programing Multi-node Computation with MPI - I HPC Parallel Programing Multi-node Computation with MPI - I Parallelization and Optimization Group TATA Consultancy Services, Sahyadri Park Pune, India TCS all rights reserved April 29, 2013 Copyright

More information

Standard MPI - Message Passing Interface

Standard MPI - Message Passing Interface c Ewa Szynkiewicz, 2007 1 Standard MPI - Message Passing Interface The message-passing paradigm is one of the oldest and most widely used approaches for programming parallel machines, especially those

More information

Message Passing Interface

Message Passing Interface MPSoC Architectures MPI Alberto Bosio, Associate Professor UM Microelectronic Departement bosio@lirmm.fr Message Passing Interface API for distributed-memory programming parallel code that runs across

More information

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

CS 470 Spring Mike Lam, Professor. Distributed Programming & MPI CS 470 Spring 2017 Mike Lam, Professor Distributed Programming & MPI MPI paradigm Single program, multiple data (SPMD) One program, multiple processes (ranks) Processes communicate via messages An MPI

More information

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

CS 470 Spring Mike Lam, Professor. Distributed Programming & MPI CS 470 Spring 2018 Mike Lam, Professor Distributed Programming & MPI MPI paradigm Single program, multiple data (SPMD) One program, multiple processes (ranks) Processes communicate via messages An MPI

More information

Basic MPI Communications. Basic MPI Communications (cont d)

Basic MPI Communications. Basic MPI Communications (cont d) Basic MPI Communications MPI provides two non-blocking routines: MPI_Isend(buf,cnt,type,dst,tag,comm,reqHandle) buf: source of data to be sent cnt: number of data elements to be sent type: type of each

More information

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

Outline. Communication modes MPI Message Passing Interface Standard. Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa Tp.HCM THOAI NAM Outline Communication modes MPI Message Passing Interface Standard TERMs (1) Blocking If return from the procedure indicates the user is allowed to reuse resources specified in the call Non-blocking

More information

Parallel Computing Paradigms

Parallel Computing Paradigms Parallel Computing Paradigms Message Passing João Luís Ferreira Sobral Departamento do Informática Universidade do Minho 31 October 2017 Communication paradigms for distributed memory Message passing is

More information

Message Passing Interface

Message Passing Interface Message Passing Interface DPHPC15 TA: Salvatore Di Girolamo DSM (Distributed Shared Memory) Message Passing MPI (Message Passing Interface) A message passing specification implemented

More information

MPI. (message passing, MIMD)

MPI. (message passing, MIMD) MPI (message passing, MIMD) What is MPI? a message-passing library specification extension of C/C++ (and Fortran) message passing for distributed memory parallel programming Features of MPI Point-to-point

More information

Distributed Memory Systems: Part IV

Distributed Memory Systems: Part IV Chapter 5 Distributed Memory Systems: Part IV Max Planck Institute Magdeburg Jens Saak, Scientific Computing II 293/342 The Message Passing Interface is a standard for creation of parallel programs using

More information

Scientific Computing

Scientific Computing Lecture on Scientific Computing Dr. Kersten Schmidt Lecture 21 Technische Universität Berlin Institut für Mathematik Wintersemester 2014/2015 Syllabus Linear Regression, Fast Fourier transform Modelling

More information

Non-Blocking Communications

Non-Blocking Communications Non-Blocking Communications Deadlock 1 5 2 3 4 Communicator 0 2 Completion The mode of a communication determines when its constituent operations complete. - i.e. synchronous / asynchronous The form of

More information

Introduction to parallel computing concepts and technics

Introduction to parallel computing concepts and technics Introduction to parallel computing concepts and technics Paschalis Korosoglou (support@grid.auth.gr) User and Application Support Unit Scientific Computing Center @ AUTH Overview of Parallel computing

More information

MPI Message Passing Interface. Source:

MPI Message Passing Interface. Source: MPI Message Passing Interface Source: http://www.netlib.org/utk/papers/mpi-book/mpi-book.html Message Passing Principles Explicit communication and synchronization Programming complexity is high But widely

More information

Non-Blocking Communications

Non-Blocking Communications Non-Blocking Communications Reusing this material This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en_us

More information

Outline. Communication modes MPI Message Passing Interface Standard

Outline. Communication modes MPI Message Passing Interface Standard MPI THOAI NAM Outline Communication modes MPI Message Passing Interface Standard TERMs (1) Blocking If return from the procedure indicates the user is allowed to reuse resources specified in the call Non-blocking

More information

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

CS 179: GPU Programming. Lecture 14: Inter-process Communication CS 179: GPU Programming Lecture 14: Inter-process Communication The Problem What if we want to use GPUs across a distributed system? GPU cluster, CSIRO Distributed System A collection of computers Each

More information

Programming Using the Message Passing Paradigm

Programming Using the Message Passing Paradigm Programming Using the Message Passing Paradigm Ananth Grama, Anshul Gupta, George Karypis, and Vipin Kumar To accompany the text ``Introduction to Parallel Computing'', Addison Wesley, 2003. Topic Overview

More information

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

Topics. Lecture 7. Review. Other MPI collective functions. Collective Communication (cont d) MPI Programming (III) Topics Lecture 7 MPI Programming (III) Collective communication (cont d) Point-to-point communication Basic point-to-point communication Non-blocking point-to-point communication Four modes of blocking

More information

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

Lesson 1. MPI runs on distributed memory systems, shared memory systems, or hybrid systems. The goals of this lesson are: understanding the MPI programming model managing the MPI environment handling errors point-to-point communication 1. The MPI Environment Lesson 1 MPI (Message Passing Interface)

More information

Programming Using the Message-Passing Paradigm (Chapter 6) Alexandre David

Programming Using the Message-Passing Paradigm (Chapter 6) Alexandre David Programming Using the Message-Passing Paradigm (Chapter 6) Alexandre David 1.2.05 1 Topic Overview Principles of Message-Passing Programming MPI: the Message Passing Interface Topologies and Embedding

More information

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

Topics. Lecture 6. Point-to-point Communication. Point-to-point Communication. Broadcast. Basic Point-to-point communication. MPI Programming (III) Topics Lecture 6 MPI Programming (III) Point-to-point communication Basic point-to-point communication Non-blocking point-to-point communication Four modes of blocking communication Manager-Worker Programming

More information

Recap of Parallelism & MPI

Recap of Parallelism & MPI Recap of Parallelism & MPI Chris Brady Heather Ratcliffe The Angry Penguin, used under creative commons licence from Swantje Hess and Jannis Pohlmann. Warwick RSE 13/12/2017 Parallel programming Break

More information

Parallel Short Course. Distributed memory machines

Parallel Short Course. Distributed memory machines Parallel Short Course Message Passing Interface (MPI ) I Introduction and Point-to-point operations Spring 2007 Distributed memory machines local disks Memory Network card 1 Compute node message passing

More information

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

Programming SoHPC Course June-July 2015 Vladimir Subotic MPI - Message Passing Interface www.bsc.es Programming with Message-Passing Libraries SoHPC Course June-July 2015 Vladimir Subotic 1 Data Transfer Blocking: Function does not return, before message can be accessed again Process is blocked

More information

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

Programming with MPI on GridRS. Dr. Márcio Castro e Dr. Pedro Velho Programming with MPI on GridRS Dr. Márcio Castro e Dr. Pedro Velho Science Research Challenges Some applications require tremendous computing power - Stress the limits of computing power and storage -

More information

Programming with MPI. Pedro Velho

Programming with MPI. Pedro Velho Programming with MPI Pedro Velho Science Research Challenges Some applications require tremendous computing power - Stress the limits of computing power and storage - Who might be interested in those applications?

More information

Point-to-Point Communication. Reference:

Point-to-Point Communication. Reference: Point-to-Point Communication Reference: http://foxtrot.ncsa.uiuc.edu:8900/public/mpi/ Introduction Point-to-point communication is the fundamental communication facility provided by the MPI library. Point-to-point

More information

COSC 6374 Parallel Computation

COSC 6374 Parallel Computation COSC 6374 Parallel Computation Message Passing Interface (MPI ) II Advanced point-to-point operations Spring 2008 Overview Point-to-point taxonomy and available functions What is the status of a message?

More information

MPI Collective communication

MPI Collective communication MPI Collective communication CPS343 Parallel and High Performance Computing Spring 2018 CPS343 (Parallel and HPC) MPI Collective communication Spring 2018 1 / 43 Outline 1 MPI Collective communication

More information

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

MPI 5. CSCI 4850/5850 High-Performance Computing Spring 2018 MPI 5 CSCI 4850/5850 High-Performance Computing Spring 2018 Tae-Hyuk (Ted) Ahn Department of Computer Science Program of Bioinformatics and Computational Biology Saint Louis University Learning Objectives

More information

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

More about MPI programming. More about MPI programming p. 1 More about MPI programming More about MPI programming p. 1 Some recaps (1) One way of categorizing parallel computers is by looking at the memory configuration: In shared-memory systems, the CPUs share

More information

Working with IITJ HPC Environment

Working with IITJ HPC Environment Working with IITJ HPC Environment by Training Agenda for 23 Dec 2011 1. Understanding Directory structure of IITJ HPC 2. User vs root 3. What is bash_profile 4. How to install any source code in your user

More information

MPI point-to-point communication

MPI point-to-point communication MPI point-to-point communication Slides Sebastian von Alfthan CSC Tieteen tietotekniikan keskus Oy CSC IT Center for Science Ltd. Introduction MPI processes are independent, they communicate to coordinate

More information

Distributed Systems + Middleware Advanced Message Passing with MPI

Distributed Systems + Middleware Advanced Message Passing with MPI Distributed Systems + Middleware Advanced Message Passing with MPI Gianpaolo Cugola Dipartimento di Elettronica e Informazione Politecnico, Italy cugola@elet.polimi.it http://home.dei.polimi.it/cugola

More information

Message Passing Interface

Message Passing Interface Message Passing Interface by Kuan Lu 03.07.2012 Scientific researcher at Georg-August-Universität Göttingen and Gesellschaft für wissenschaftliche Datenverarbeitung mbh Göttingen Am Faßberg, 37077 Göttingen,

More information

Holland Computing Center Kickstart MPI Intro

Holland Computing Center Kickstart MPI Intro Holland Computing Center Kickstart 2016 MPI Intro Message Passing Interface (MPI) MPI is a specification for message passing library that is standardized by MPI Forum Multiple vendor-specific implementations:

More information

Parallel Programming. Using MPI (Message Passing Interface)

Parallel Programming. Using MPI (Message Passing Interface) Parallel Programming Using MPI (Message Passing Interface) Message Passing Model Simple implementation of the task/channel model Task Process Channel Message Suitable for a multicomputer Number of processes

More information

Introduction to MPI. HY555 Parallel Systems and Grids Fall 2003

Introduction to MPI. HY555 Parallel Systems and Grids Fall 2003 Introduction to MPI HY555 Parallel Systems and Grids Fall 2003 Outline MPI layout Sending and receiving messages Collective communication Datatypes An example Compiling and running Typical layout of an

More information

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

MPI: Parallel Programming for Extreme Machines. Si Hammond, High Performance Systems Group MPI: Parallel Programming for Extreme Machines Si Hammond, High Performance Systems Group Quick Introduction Si Hammond, (sdh@dcs.warwick.ac.uk) WPRF/PhD Research student, High Performance Systems Group,

More information

15-440: Recitation 8

15-440: Recitation 8 15-440: Recitation 8 School of Computer Science Carnegie Mellon University, Qatar Fall 2013 Date: Oct 31, 2013 I- Intended Learning Outcome (ILO): The ILO of this recitation is: Apply parallel programs

More information

Introduction to MPI. Ricardo Fonseca. https://sites.google.com/view/rafonseca2017/

Introduction to MPI. Ricardo Fonseca. https://sites.google.com/view/rafonseca2017/ Introduction to MPI Ricardo Fonseca https://sites.google.com/view/rafonseca2017/ Outline Distributed Memory Programming (MPI) Message Passing Model Initializing and terminating programs Point to point

More information

Introduction to the Message Passing Interface (MPI)

Introduction to the Message Passing Interface (MPI) Introduction to the Message Passing Interface (MPI) CPS343 Parallel and High Performance Computing Spring 2018 CPS343 (Parallel and HPC) Introduction to the Message Passing Interface (MPI) Spring 2018

More information

Data parallelism. [ any app performing the *same* operation across a data stream ]

Data parallelism. [ any app performing the *same* operation across a data stream ] Data parallelism [ any app performing the *same* operation across a data stream ] Contrast stretching: Version Cores Time (secs) Speedup while (step < NumSteps &&!converged) { step++; diffs = 0; foreach

More information

High Performance Computing Course Notes Message Passing Programming I

High Performance Computing Course Notes Message Passing Programming I High Performance Computing Course Notes 2008-2009 2009 Message Passing Programming I Message Passing Programming Message Passing is the most widely used parallel programming model Message passing works

More information

MPI MPI. Linux. Linux. Message Passing Interface. Message Passing Interface. August 14, August 14, 2007 MPICH. MPI MPI Send Recv MPI

MPI MPI. Linux. Linux. Message Passing Interface. Message Passing Interface. August 14, August 14, 2007 MPICH. MPI MPI Send Recv MPI Linux MPI Linux MPI Message Passing Interface Linux MPI Linux MPI Message Passing Interface MPI MPICH MPI Department of Science and Engineering Computing School of Mathematics School Peking University

More information

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

Lecture 7: More about MPI programming. Lecture 7: More about MPI programming p. 1 Lecture 7: More about MPI programming Lecture 7: More about MPI programming p. 1 Some recaps (1) One way of categorizing parallel computers is by looking at the memory configuration: In shared-memory systems

More information

Document Classification

Document Classification Document Classification Introduction Search engine on web Search directories, subdirectories for documents Search for documents with extensions.html,.txt, and.tex Using a dictionary of key words, create

More information

Message Passing with MPI Christian Iwainsky HiPerCH

Message Passing with MPI Christian Iwainsky HiPerCH Message Passing with MPI Christian Iwainsky HiPerCH 05.08.2013 FB. Computer Science Scientific Computing Christian Iwainsky 1 Agenda Recap MPI Part 1 Concepts Point-to-Point Basic Datatypes MPI Part 2

More information

CSE 160 Lecture 18. Message Passing

CSE 160 Lecture 18. Message Passing CSE 160 Lecture 18 Message Passing Question 4c % Serial Loop: for i = 1:n/3-1 x(2*i) = x(3*i); % Restructured for Parallelism (CORRECT) for i = 1:3:n/3-1 y(2*i) = y(3*i); for i = 2:3:n/3-1 y(2*i) = y(3*i);

More information

Parallel Programming

Parallel Programming Parallel Programming for Multicore and Cluster Systems von Thomas Rauber, Gudula Rünger 1. Auflage Parallel Programming Rauber / Rünger schnell und portofrei erhältlich bei beck-shop.de DIE FACHBUCHHANDLUNG

More information

NUMERICAL PARALLEL COMPUTING

NUMERICAL PARALLEL COMPUTING Lecture 5, March 23, 2012: The Message Passing Interface http://people.inf.ethz.ch/iyves/pnc12/ Peter Arbenz, Andreas Adelmann Computer Science Dept, ETH Zürich E-mail: arbenz@inf.ethz.ch Paul Scherrer

More information

MPI Message Passing Interface

MPI Message Passing Interface MPI Message Passing Interface Portable Parallel Programs Parallel Computing A problem is broken down into tasks, performed by separate workers or processes Processes interact by exchanging information

More information

Introduction to the Message Passing Interface (MPI)

Introduction to the Message Passing Interface (MPI) Applied Parallel Computing LLC http://parallel-computing.pro Introduction to the Message Passing Interface (MPI) Dr. Alex Ivakhnenko March 4, 2018 Dr. Alex Ivakhnenko (APC LLC) Introduction to MPI March

More information

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

COSC 6374 Parallel Computation. Message Passing Interface (MPI ) I Introduction. Distributed memory machines Network card Network card 1 COSC 6374 Parallel Computation Message Passing Interface (MPI ) I Introduction Edgar Gabriel Fall 015 Distributed memory machines Each compute node represents an independent

More information

Parallel Programming with MPI: Day 1

Parallel Programming with MPI: Day 1 Parallel Programming with MPI: Day 1 Science & Technology Support High Performance Computing Ohio Supercomputer Center 1224 Kinnear Road Columbus, OH 43212-1163 1 Table of Contents Brief History of MPI

More information

CSE 160 Lecture 15. Message Passing

CSE 160 Lecture 15. Message Passing CSE 160 Lecture 15 Message Passing Announcements 2013 Scott B. Baden / CSE 160 / Fall 2013 2 Message passing Today s lecture The Message Passing Interface - MPI A first MPI Application The Trapezoidal

More information

Introduction to MPI. Ekpe Okorafor. School of Parallel Programming & Parallel Architecture for HPC ICTP October, 2014

Introduction to MPI. Ekpe Okorafor. School of Parallel Programming & Parallel Architecture for HPC ICTP October, 2014 Introduction to MPI Ekpe Okorafor School of Parallel Programming & Parallel Architecture for HPC ICTP October, 2014 Topics Introduction MPI Model and Basic Calls MPI Communication Summary 2 Topics Introduction

More information

Lecture 9: MPI continued

Lecture 9: MPI continued Lecture 9: MPI continued David Bindel 27 Sep 2011 Logistics Matrix multiply is done! Still have to run. Small HW 2 will be up before lecture on Thursday, due next Tuesday. Project 2 will be posted next

More information

Introduction to MPI: Part II

Introduction to MPI: Part II Introduction to MPI: Part II Pawel Pomorski, University of Waterloo, SHARCNET ppomorsk@sharcnetca November 25, 2015 Summary of Part I: To write working MPI (Message Passing Interface) parallel programs

More information

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

Programming Scalable Systems with MPI. Clemens Grelck, University of Amsterdam Clemens Grelck University of Amsterdam UvA / SurfSARA High Performance Computing and Big Data Course June 2014 Parallel Programming with Compiler Directives: OpenMP Message Passing Gentle Introduction

More information

UNIVERSITY OF MORATUWA

UNIVERSITY OF MORATUWA UNIVERSITY OF MORATUWA FACULTY OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING B.Sc. Engineering 2012 Intake Semester 8 Examination CS4532 CONCURRENT PROGRAMMING Time allowed: 2 Hours March

More information

High Performance Computing

High Performance Computing High Performance Computing Course Notes 2009-2010 2010 Message Passing Programming II 1 Communications Point-to-point communications: involving exact two processes, one sender and one receiver For example,

More information

Parallel Programming

Parallel Programming Parallel Programming Point-to-point communication Prof. Paolo Bientinesi pauldj@aices.rwth-aachen.de WS 18/19 Scenario Process P i owns matrix A i, with i = 0,..., p 1. Objective { Even(i) : compute Ti

More information

COMP 322: Fundamentals of Parallel Programming

COMP 322: Fundamentals of Parallel Programming COMP 322: Fundamentals of Parallel Programming https://wiki.rice.edu/confluence/display/parprog/comp322 Lecture 37: Introduction to MPI (contd) Vivek Sarkar Department of Computer Science Rice University

More information

High performance computing. Message Passing Interface

High performance computing. Message Passing Interface High performance computing Message Passing Interface send-receive paradigm sending the message: send (target, id, data) receiving the message: receive (source, id, data) Versatility of the model High efficiency

More information

Tutorial 2: MPI. CS486 - Principles of Distributed Computing Papageorgiou Spyros

Tutorial 2: MPI. CS486 - Principles of Distributed Computing Papageorgiou Spyros Tutorial 2: MPI CS486 - Principles of Distributed Computing Papageorgiou Spyros What is MPI? An Interface Specification MPI = Message Passing Interface Provides a standard -> various implementations Offers

More information

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

Programming Scalable Systems with MPI. UvA / SURFsara High Performance Computing and Big Data. Clemens Grelck, University of Amsterdam Clemens Grelck University of Amsterdam UvA / SURFsara High Performance Computing and Big Data Message Passing as a Programming Paradigm Gentle Introduction to MPI Point-to-point Communication Message Passing

More information

mith College Computer Science CSC352 Week #7 Spring 2017 Introduction to MPI Dominique Thiébaut

mith College Computer Science CSC352 Week #7 Spring 2017 Introduction to MPI Dominique Thiébaut mith College CSC352 Week #7 Spring 2017 Introduction to MPI Dominique Thiébaut dthiebaut@smith.edu Introduction to MPI D. Thiebaut Inspiration Reference MPI by Blaise Barney, Lawrence Livermore National

More information

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

Introduction to MPI. SuperComputing Applications and Innovation Department 1 / 143 Introduction to MPI Isabella Baccarelli - i.baccarelli@cineca.it Mariella Ippolito - m.ippolito@cineca.it Cristiano Padrin - c.padrin@cineca.it Vittorio Ruggiero - v.ruggiero@cineca.it SuperComputing Applications

More information

An Introduction to Parallel Programming

An Introduction to Parallel Programming Guide 48 Version 2 An Introduction to Parallel Programming Document code: Guide 48 Title: An Introduction to Parallel Programming Version: 2 Date: 31/01/2011 Produced by: University of Durham Information

More information

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

CS 6230: High-Performance Computing and Parallelization Introduction to MPI CS 6230: High-Performance Computing and Parallelization Introduction to MPI Dr. Mike Kirby School of Computing and Scientific Computing and Imaging Institute University of Utah Salt Lake City, UT, USA

More information

MPI MESSAGE PASSING INTERFACE

MPI MESSAGE PASSING INTERFACE MPI MESSAGE PASSING INTERFACE David COLIGNON, ULiège CÉCI - Consortium des Équipements de Calcul Intensif http://www.ceci-hpc.be Outline Introduction From serial source code to parallel execution MPI functions

More information

int sum;... sum = sum + c?

int sum;... sum = sum + c? int sum;... sum = sum + c? Version Cores Time (secs) Speedup manycore Message Passing Interface mpiexec int main( ) { int ; char ; } MPI_Init( ); MPI_Comm_size(, &N); MPI_Comm_rank(, &R); gethostname(

More information

Programming with MPI Collectives

Programming with MPI Collectives Programming with MPI Collectives Jan Thorbecke Type to enter text Delft University of Technology Challenge the future Collectives Classes Communication types exercise: BroadcastBarrier Gather Scatter exercise:

More information

CSE. Parallel Algorithms on a cluster of PCs. Ian Bush. Daresbury Laboratory (With thanks to Lorna Smith and Mark Bull at EPCC)

CSE. Parallel Algorithms on a cluster of PCs. Ian Bush. Daresbury Laboratory (With thanks to Lorna Smith and Mark Bull at EPCC) Parallel Algorithms on a cluster of PCs Ian Bush Daresbury Laboratory I.J.Bush@dl.ac.uk (With thanks to Lorna Smith and Mark Bull at EPCC) Overview This lecture will cover General Message passing concepts

More information

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

MPI 2. CSCI 4850/5850 High-Performance Computing Spring 2018 MPI 2 CSCI 4850/5850 High-Performance Computing Spring 2018 Tae-Hyuk (Ted) Ahn Department of Computer Science Program of Bioinformatics and Computational Biology Saint Louis University Learning Objectives

More information

Message Passing Interface - MPI

Message Passing Interface - MPI Message Passing Interface - MPI Parallel and Distributed Computing Department of Computer Science and Engineering (DEI) Instituto Superior Técnico October 24, 2011 Many slides adapted from lectures by

More information

Collective Communication in MPI and Advanced Features

Collective Communication in MPI and Advanced Features Collective Communication in MPI and Advanced Features Pacheco s book. Chapter 3 T. Yang, CS240A. Part of slides from the text book, CS267 K. Yelick from UC Berkeley and B. Gropp, ANL Outline Collective

More information

Parallel Programming, MPI Lecture 2

Parallel Programming, MPI Lecture 2 Parallel Programming, MPI Lecture 2 Ehsan Nedaaee Oskoee 1 1 Department of Physics IASBS IPM Grid and HPC workshop IV, 2011 Outline 1 Point-to-Point Communication Non Blocking PTP Communication 2 Collective

More information

Advanced MPI. Andrew Emerson

Advanced MPI. Andrew Emerson Advanced MPI Andrew Emerson (a.emerson@cineca.it) Agenda 1. One sided Communications (MPI-2) 2. Dynamic processes (MPI-2) 3. Profiling MPI and tracing 4. MPI-I/O 5. MPI-3 11/12/2015 Advanced MPI 2 One

More information

MPI MESSAGE PASSING INTERFACE

MPI MESSAGE PASSING INTERFACE MPI MESSAGE PASSING INTERFACE David COLIGNON CÉCI - Consortium des Équipements de Calcul Intensif http://hpc.montefiore.ulg.ac.be Outline Introduction From serial source code to parallel execution MPI

More information

Practical Course Scientific Computing and Visualization

Practical Course Scientific Computing and Visualization July 5, 2006 Page 1 of 21 1. Parallelization Architecture our target architecture: MIMD distributed address space machines program1 data1 program2 data2 program program3 data data3.. program(data) program1(data1)

More information

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

What s in this talk? Quick Introduction. Programming in Parallel What s in this talk? Parallel programming methodologies - why MPI? Where can I use MPI? MPI in action Getting MPI to work at Warwick Examples MPI: Parallel Programming for Extreme Machines Si Hammond,

More information

MPI MESSAGE PASSING INTERFACE

MPI MESSAGE PASSING INTERFACE MPI MESSAGE PASSING INTERFACE David COLIGNON, ULiège CÉCI - Consortium des Équipements de Calcul Intensif http://www.ceci-hpc.be Outline Introduction From serial source code to parallel execution MPI functions

More information

Practical Scientific Computing: Performanceoptimized

Practical Scientific Computing: Performanceoptimized Practical Scientific Computing: Performanceoptimized Programming Programming with MPI November 29, 2006 Dr. Ralf-Peter Mundani Department of Computer Science Chair V Technische Universität München, Germany

More information

Collective Communications

Collective Communications Collective Communications Reusing this material This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en_us

More information

Distributed Memory Programming with MPI

Distributed Memory Programming with MPI Distributed Memory Programming with MPI Moreno Marzolla Dip. di Informatica Scienza e Ingegneria (DISI) Università di Bologna moreno.marzolla@unibo.it Algoritmi Avanzati--modulo 2 2 Credits Peter Pacheco,

More information

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

MPI 3. CSCI 4850/5850 High-Performance Computing Spring 2018 MPI 3 CSCI 4850/5850 High-Performance Computing Spring 2018 Tae-Hyuk (Ted) Ahn Department of Computer Science Program of Bioinformatics and Computational Biology Saint Louis University Learning Objectives

More information

MPI - The Message Passing Interface

MPI - The Message Passing Interface MPI - The Message Passing Interface The Message Passing Interface (MPI) was first standardized in 1994. De facto standard for distributed memory machines. All Top500 machines (http://www.top500.org) are

More information

Message Passing Interface. George Bosilca

Message Passing Interface. George Bosilca Message Passing Interface George Bosilca bosilca@icl.utk.edu Message Passing Interface Standard http://www.mpi-forum.org Current version: 3.1 All parallelism is explicit: the programmer is responsible

More information

CS 426. Building and Running a Parallel Application

CS 426. Building and Running a Parallel Application CS 426 Building and Running a Parallel Application 1 Task/Channel Model Design Efficient Parallel Programs (or Algorithms) Mainly for distributed memory systems (e.g. Clusters) Break Parallel Computations

More information

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

CS 470 Spring Mike Lam, Professor. Distributed Programming & MPI CS 470 Spring 2019 Mike Lam, Professor Distributed Programming & MPI MPI paradigm Single program, multiple data (SPMD) One program, multiple processes (ranks) Processes communicate via messages An MPI

More information

PCAP Assignment I. 1. A. Why is there a large performance gap between many-core GPUs and generalpurpose multicore CPUs. Discuss in detail.

PCAP Assignment I. 1. A. Why is there a large performance gap between many-core GPUs and generalpurpose multicore CPUs. Discuss in detail. PCAP Assignment I 1. A. Why is there a large performance gap between many-core GPUs and generalpurpose multicore CPUs. Discuss in detail. The multicore CPUs are designed to maximize the execution speed

More information

MA471. Lecture 5. Collective MPI Communication

MA471. Lecture 5. Collective MPI Communication MA471 Lecture 5 Collective MPI Communication Today: When all the processes want to send, receive or both Excellent website for MPI command syntax available at: http://www-unix.mcs.anl.gov/mpi/www/ 9/10/2003

More information

Cluster Computing MPI. Industrial Standard Message Passing

Cluster Computing MPI. Industrial Standard Message Passing MPI Industrial Standard Message Passing MPI Features Industrial Standard Highly portable Widely available SPMD programming model Synchronous execution MPI Outer scope int MPI_Init( int *argc, char ** argv)

More information