O.I. Streltsova, D.V. Podgainy, M.V. Bashashin, M.I.Zuev
|
|
- Suzanna Hunter
- 5 years ago
- Views:
Transcription
1 High Performance Computing Technologies Lecture, Practical training 9 Parallel Computing with MPI: parallel algorithm for linear algebra O.I. Streltsova, D.V. Podgainy, M.V. Bashashin, M.I.Zuev Heterogeneous Computations Team, HybriLIT Laboratory of Information Technologies Joint Institute for Nuclear Research Dubna University 12 April 2018 Heterogeneous Computation Team, HybriLIT
2 Serial computing Traditionally, software has been written for serial computation: To be run on a single computer having a single Central Processing Unit (CPU); A problem is broken into a discrete series of instructions. Instructions are executed one after another. Only one instruction may execute at any moment in time.
3 Parallel computing Parallel computing is the simultaneous use of multiple compute resources to solve a computational problem: To be run using multiple CPUs. A problem is broken into discrete parts that can be solved concurrently. Each part is further broken down to a series of instructions. Instructions from each part execute simultaneously on different CPUs.
4 Types of parallel machines Distributed memory each processor has its own memory address space. Examples: clusters, Blue Gene/L Shared memory single address space for all processors. Examples: IBM-series, multi-core PC Uniform Memory Access CPU0 CPU1 CPU2 CPU0 Mem0 Mem1 CPU1 CPU2 Memory Mem2 Non-Uniform Memory Access MPI is a library standard for programming distributed memory system CPU CPU Memory CPU CPU Memory CPU CPU Memory CPU CPU Memory
5 MPI. Main conception MPI: Message Passing Interface Data transfer operation MPI is based on data transfer operations. Among MPI functions there are: point-to-point operations between two processes, collective communication actions for simultaneous interaction of several processes. 1. Grama, Gupta, Karypis, Kumar. Introduction to Parallel Computing, Second Edition Snir, Otto, Huss-Lederman, Walker, Dongarra. MPI: The Complete Reference, Volume 1, The MPI Core, Second edition. 1998
6 MPI: Concepts Processes Group of processes Communicator MPI COMM WORLD name of the default MPI communicator: MPI_Comm_size (MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI-Communicator: MPI_COMM_WORLD Process 0 Process 2 Process 1 Process size-1 Each process in a communicator is identified by its rank
7 The 6 most important MPI commands MPI_Init() initiate a MPI computation MPI_Comm_size() how many processes participate in a given MPI communicator? MPI_Comm_rank() which one am I? MPI_Send() send a message MPI_Recv() receive a message (A number between 0 and size-1) MPI_Finalize() terminate the MPI computation and clean up
8 MPI. Basic Datatypes At message passing operation execution, it is necessary to designate the type of passed data on order to denote the passed or received data. MPI contains a big set of base data types that coincide with datatypes in C/C++ and Fortran programming languages. MPI MPI_CHAR MPI_DOUBLE MPI_FLOAT MPI_INT C/C++ signed char double float int All using MPI datatypes you can see in file mpi.h (mpif.h) MPI includes possibilities for creation of new derived data types for more detailed and short description of sent messages.
9 Basic Needs in parallel programming In order to do parallel programming, we need basic functionality: Start Processes Send Messages Receive Messages Synchronize processes
10 Language notation Fortran include "mpif.h" call MPI_FUNCTION(parameter,..., ierr) Compilation $ mpif77 prog_name.f o prog_exec C/C++ #include <mpi.h> MPI_Function(parameter,...); Compilation $ mpicc/mpic++ prog_name.c o prog_exec
11 Example MPI-prorgam mpi_hello.c #include <stdio.h> #include <mpi.h> int main(int argc, char **argv){ int size, rank; MPI_Init(&argc,&argv); Initiate an MPI computation MPI_Comm_size (MPI_COMM_WORLD, &size); How many process? MPI_Comm_rank(MPI_COMM_WORLD, &rank); The rank value is between 0 and size-1 printf("hello world! I am process number: %d form %s\n", rank, size); MPI_Finalize(); Terminate the MPI computation and clean up return 0;
12 Compilation, execution on HybriLIT Add module $ module add openmpi/1.8.1 Compilation $ mpicc -std=c99 mpi_hello.c -o exec_mpi script_mpi #!/bin/sh #SBATCH -p tut #SBATCH -n 8 #SBATCH -t 60 mpiexec./exec_mpi Run in batch mode $ sbatch script_mpi
13 Output, parallel execution Output Numprocs is 6; Hello from 0 Numprocs is 6; Hello from 1 Numprocs is 6; Hello from 5 Numprocs is 6; Hello from 3 Numprocs is 6; Hello from 4 Numprocs is 6; Hello from 2
14 MPI point-to-point communications int MPI_Send(void *buf, // initial address of send buffer int count, // number of elements in send buffer MPI_Datatype datatype, // datatype of each send elements int dest, // rank of destination int tag, // message tag MPI_Comm comm); // communicator
15 MPI point-to-point communications int MPI_Recv(void *buf, // initial address of receive buffer int count, // number of elements in send buffer MPI_Datatype datatype, // datatype of each send elements int source, // rank of source int tag, // message tag MPI_Comm comm, // communicator MPI_Status *status); // status object
16 MPI point-to-point communications. Example mpi_send-recv.c #include <mpi.h> #include <stdio.h> #include <string.h> int main(int argc, char **argv){ int size, rank, tag,rc, i; char mess[30]; MPI_Status status; rc= MPI_Init(&argc,&argv); if (rc!= MPI_SUCCESS) { printf("error starting MPI program. Terminate.\n"); MPI_Abort(MPI_COMM_WORLD, rc);
17 MPI point-to-point communications. Example MPI_Comm_size (MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); tag= 8; if (rank==0){ strcpy(mess, "Hello from process 0!"); for (i=1; i <size; i++) MPI_Send(mess, 21, MPI_CHAR, i, tag, MPI_COMM_WORLD); else{ MPI_Recv(mess, 21, MPI_CHAR, 0, tag, MPI_COMM_WORLD, &status); printf("process number: %d message= %s \n", rank, mess); MPI_Finalize(); return 0;
18 Jacobi method in solution of SLAE A x f, A R M M System of linear algebraic equations M a a, i 1, M ii j 1, j i ij Condition of diagonally domination of matrix M k fi aij x j k 1 j 1, j i xi i M k aii M n 1 n n 1 n i i i 1, 1, ; 0 2 x x x x Computation the next approximation k number of iteration Criterion of ending iteration process S.A. Lupin, M.A. Posypkin. Parallel programming. M.: ID FORUM, INFRA-M, p.
19 Used functions void init (double* a, double* f, double* x){ for(int i= 0; i<m; i++){ f[i]= 3.0*M - 1.0; for(int j= 0; j < M; j++){ if(i == j) a[i*m+i]= 2.0*M; else a[i*m+j]= 1.0; for(int i= 0; i<m; i++) x[i]= 0.0; x[0]= 1.0; Initialization of matrix A x f, A R M M
20 Used functions Computational of criterion of ending iteration process double evaldiff (double* u, double* v, int m){ double d= 0.0; for(int i= 0; i<m; i++){ double b; b= v[i]-u[i]; d+= b*b; return sqrt(d); M n 1 n n 1 n i i i 1 2 x x x x
21 Used functions double matvec (double* a, double* f, double* xold, double* x, int m, int n){ for(int i= 1; i<m; i++){ double sum= 0.0; for(int j= 0; j<n; j++){ if(i!=j) sum+= a[i*m+j]*xold[j]; x[i]= (f[i]-sum)/a[i*m+i]; Computation function of the next approximation M k fi aij x j k 1 j 1, j i xi i M k aii, 1, ; 0
22 Serial code jacobi_01_serial.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <math.h> #define MAX_ITERS 200 // The maximum number of iterations #define M // The dimension of the matrix #define EPS 1e-5 // The accuracy of calculations
23 Serial code int main(int argc, char* argv[]){ // I count of iterations int I= 0; // xold previous approximation x(k) // x next approximation x(k+1) // xexact exact solution // diff norm of the difference // t program runtime double *xold, *x, *xexact, *a, *f, diff, t;
24 Serial code // Allocate memory for the matrix and vectors xold= (double*)malloc(m*sizeof(double)); x= (double*)malloc(m*sizeof(double)); xexact= (double*)malloc(m*sizeof(double)); a= (double*)malloc(m*m*sizeof(double)); f= (double*)malloc(m*sizeof(double)); init(a, f, x);
25 Serial code for(int i= 0; i<m; i++) xexact[i]= 1.0; printf(" Size of the matrix= %d, Accuracy= %5.3e\n", M, EPS); t= time(null); // Main loop do{ matvec(a, f, xold, x, M, M); diff= evaldiff(xold, x, M); I++; printf("diff= %8.5f\n", diff);
26 Serial code // Copy the next approximation to the array of the previous memcpy(xold, x, M*sizeof(double)); while((diff >= EPS) && (I <= MAX_ITERS)); // Check for reaching a maximum number of iterations if(i>=max_iters){ printf("reached a maximum number of iterations\n");
27 Serial code double err1= 0.0; double err2= 0.0; for(int i= 0; i<m; i++){ double tmp= fabs(x[i]-xexact[i]); err2+= (x[i]-xexact[i])*(x[i]-xexact[i]); if(tmp > err1) err1= tmp; double err2sqrt= sqrt(err2); // Calculating program runtime t= time(null)-t;
28 Serial code printf("error= %12.9f\n", err1); printf("norma= %12.9f\n", err2sqrt); // Output the number of iterations and program runtime printf("%d iterations consumed %lf sec\n", I, t); // Free memory free(xold); free(x); free(xexact); free(a); free(f); return 0;
29 MPI collective communication int MPI_Bcast( void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm );
30 MPI collective communication int MPI_Scatter( const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm );
31 MPI collective communication int MPI_Gather( const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm );
32 Update used function Computation function of the next approximation double matvec (double* a, double* f, double* xold, double* x, int rk, int sp, int m, int n){ for(int i= 1; i<m; i++){ double sum= 0.0; for(int j= 0; j<n; j++){ if(j!= i+rk*sp) sum+= a[i*m+j]*xold[j]; x[i]= (f[i]-sum)/a[i*m+i+rk*sp];
33 MPI code. Version 1 jacobi_02_mpi.c #include... #include <mpi.h> // Include header for support MPI library #define... int main(int argc, char* argv[]){ // size total number of processes // rank rank of the process // chunk the number of rows processed by each process int I= 0, size, rank, chunk; // aloc array to store the local part of the vector a // floc array to store the local part of the vector f // xloc array to store the local part of the vector x double *a, *aloc, *f, *floc, *xold, *x, *xloc, diff, t;
34 MPI code. Version 1 // Initialization of MPI MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); if(rank==0){ // Work only root process printf(" Simple MPI realization\n"); printf(" Number of processes= %d\n Size of the matrix= %d, Accuracy= %5.3e\n", size, M, EPS); chunk= M/size; a= (double*)malloc(m*m*sizeof(double));
35 MPI code. Version 1 // Broadcasting value of chunk to all processes MPI_Bcast(&chunk, 1, MPI_INT, 0, MPI_COMM_WORLD); // Allocation memory for arrays and vectors aloc= (double*)malloc(chunk*m*sizeof(double)); f= (double*)malloc(m*sizeof(double)); floc= (double*)malloc(chunk*sizeof(double)); xold= (double*)malloc(m*sizeof(double)); x= (double*)malloc(m*sizeof(double)); xloc= (double*)malloc(chunk*sizeof(double));
36 MPI code. Version 1 if(rank==0){ init(a, f, xold); t= MPI_Wtime(); // Send array A and the vector f to processes MPI_Scatter(a, M*chunk, MPI_DOUBLE, aloc, M*chunk, MPI_DOUBLE, 0, MPI_COMM_WORLD); MPI_Scatter(f, chunk, MPI_DOUBLE, floc, chunk, MPI_DOUBLE, 0, MPI_COMM_WORLD);
37 Parallel code
38 MPI code. Version 1 // Main loop do{ // Broadcasting value of the previous approximation to all processes MPI_Bcast(xold, M, MPI_DOUBLE, 0, MPI_COMM_WORLD); matvec(aloc, floc, xold, xloc, rank, chunk, chunk, M); // Gather of vector x at root process MPI_Gather(xloc, chunk, MPI_DOUBLE, x, chunk, MPI_DOUBLE, 0, MPI_COMM_WORLD);
39 MPI code. Version 1 if(rank==0){ diff= evaldiff(x, xold, M); printf("diff= %10.7f\n", diff); memcpy(xold, x, M*sizeof(double)); MPI_Bcast(&diff, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD); I++; while((diff >= EPS) && (I <= MAX_ITERS));
40 Parallel code
41 MPI code. Version 1 // Output the number of iterations and program runtime if(rank==0){ t= MPI_Wtime()-t; printf("%d iterations consumed %lf sec\n", I, t); // Free memory if(rank==0) free(a); free(aloc); free(f); free(floc); free(xold); free(x); free(xloc); // Finalize of all MPI processes MPI_Finalize(); return 0;
42 MPI code. Version 1. Optimization void init(double* f, double* x){ // f right hand side vector // x vector of initial approximation to the solution for(int i= 0; i<m; i++){ f[i]= 3.0*M - 1.0; for(int i= 0; i<m; i++) x[i]= 0.0; x[0]= 1.0;
43 MPI code. Version 1. Optimization jacobi_02_mpi_alloc.c // Init of matrix aloc on each process for(int i= 0; i<chunk; i++){ for(int j= 0; j<m; j++){ if(j == i+rank*chunk) aloc[i*m+j]= 2.0*M; else aloc[i*m+j]= 1.0;
44 MPI collective communication int MPI_Scatterv( const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm );
45 MPI collective communication int MPI_Gatherv( const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm );
46 MPI code. Version 2 jacobi_03_scatterv_gatherv.c #include... #define... int main(int argc, char* argv[]){ // chunks an array, each element of which contains the number of elements in the respective data block // disps an array containing the offset value measured in the sent items int I= 0, size, rank, chunk, *chunks, *disps; double *a, *aloc, *f, *floc, *xold, *x, *xloc, *xexact, *xtemp, diff, t;
47 MPI code. Version 2 // Initialization of MPI MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); if(rank==0){ printf(" MPI realization with Scatterv() and Gatherv()\n"); printf(" Number of processes= %d\n Size of the matrix= %d, Accuracy= %5.3e\n", size, M, EPS); chunk= M/size; a= (double*)malloc(m*m*sizeof(double)); // Broadcasting value of "chunk" to all processes MPI_Bcast(&chunk, 1, MPI_INT, 0, MPI_COMM_WORLD);
48 MPI code. Version 2 // Allocation memory for arrays and vectors chunks= (int*)malloc(size*sizeof(int)); disps= (int*)malloc(size*sizeof(int)); f= (double*)malloc(m*sizeof(double)); x= (double*)malloc(m*sizeof(double)); xold= (double*)malloc(m*sizeof(double)); if(rank==0){ init(a, f, xold); t= MPI_Wtime();
49 MPI code. Version 2 for(int i= 0; i<size; i++){ disps[i]= i*chunk*m; if(i==(size-1)) else chunks[i]= (M-(size-1)*chunk)*M; chunks[i]= chunk*m; aloc= (double*)malloc(chunks[rank]*sizeof(double)); MPI_Scatterv(a, chunks, disps, MPI_DOUBLE, aloc, chunks[rank], MPI_DOUBLE, 0, MPI_COMM_WORLD);
50 MPI code. Version 2 for(int i= 0; i<size; i++){ disps[i]= i*chunk; if(i==(size-1)) else chunks[i]= M-(size-1)*chunk; chunks[i]= chunk; floc= (double*)malloc(chunks[rank]*sizeof(double)); MPI_Scatterv(f, chunks, disps, MPI_DOUBLE, floc, chunks[rank], MPI_DOUBLE, 0, MPI_COMM_WORLD);
51 MPI code. Version 2 xloc= (double*)malloc(chunks[rank]*sizeof(double)); // Main loop do{ MPI_Bcast(xold, M, MPI_DOUBLE, 0, MPI_COMM_WORLD); matvec(aloc, floc, xold, xloc, rank, chunk, chunks[rank], M); MPI_Gatherv(xloc, chunks[rank], MPI_DOUBLE, x, chunks, disps, MPI_DOUBLE, 0, MPI_COMM_WORLD); if(rank==0){ diff= evaldiff(x, xold, M); printf("diff= %10.7f\n", diff); memcpy(xold, x, M*sizeof(double));
52 MPI code. Version 2 MPI_Bcast(&diff, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD); I++; while((diff >= EPS) && (I <= MAX_ITERS)); // Output the number of iterations and program runtime if(rank==0){ t= MPI_Wtime()-t; printf("%d iterations consumed %lf sec\n", I, t); // Free memory if(rank==0) free(a); free(chunks); free(disps); free(f); free(x); free(xold); free(aloc); free(floc); free(xloc); // Finalize of all MPI processes MPI_Finalize(); return 0;
53 MPI collective communication int MPI_Allgatherv( const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, MPI_Comm comm)
54 do{ MPI code. Version 3 The main loop will look like the following. The remaining part of the code will not change. jacobi_04_allgatherv.c matvec(aloc, floc, xold, xloc, rank, chunk, chunks[rank], M); MPI_Allgatherv(xloc, chunks[rank], MPI_DOUBLE, x, chunks, disps, MPI_DOUBLE, MPI_COMM_WORLD); diff= evaldiff(x, xold, M); memcpy(xold, x, M*sizeof(double)); I++; while((diff >= EPS) && (I <= MAX_ITERS));
55 Practical Tasks - Carry out computations at different number of MPI-processes and plot graphs on speedup and efficiency. - Perform broadcast transfer from each processor by means of peer-to-peer messaging
56
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 informationMPI 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 informationCS 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 informationHPC 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 informationMessage 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 informationCS 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 informationOutline. 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 informationIntroduction 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 informationIntroduction 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 informationIntroduction 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 informationIntroduction 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 informationOutline. 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 informationCS 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 informationRecap 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 informationDistributed 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 informationLesson 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 informationDistributed Memory Programming with Message-Passing
Distributed Memory Programming with Message-Passing Pacheco s book Chapter 3 T. Yang, CS240A Part of slides from the text book and B. Gropp Outline An overview of MPI programming Six MPI functions and
More informationMessage 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 informationIntroduction 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 informationMessage 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 informationCSE 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 informationIn the simplest sense, parallel computing is the simultaneous use of multiple computing resources to solve a problem.
1. Introduction to Parallel Processing In the simplest sense, parallel computing is the simultaneous use of multiple computing resources to solve a problem. a) Types of machines and computation. A conventional
More informationParallel 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 informationPractical 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 informationIntroduction to Parallel and Distributed Systems - INZ0277Wcl 5 ECTS. Teacher: Jan Kwiatkowski, Office 201/15, D-2
Introduction to Parallel and Distributed Systems - INZ0277Wcl 5 ECTS Teacher: Jan Kwiatkowski, Office 201/15, D-2 COMMUNICATION For questions, email to jan.kwiatkowski@pwr.edu.pl with 'Subject=your name.
More informationCS 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 informationThe Message Passing Model
Introduction to MPI The Message Passing Model Applications that do not share a global address space need a Message Passing Framework. An application passes messages among processes in order to perform
More informationDistributed 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 informationMPI: 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 informationMPI 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 informationCS4961 Parallel Programming. Lecture 18: Introduction to Message Passing 11/3/10. Final Project Purpose: Mary Hall November 2, 2010.
Parallel Programming Lecture 18: Introduction to Message Passing Mary Hall November 2, 2010 Final Project Purpose: - A chance to dig in deeper into a parallel programming model and explore concepts. -
More informationIntroduction to MPI. Jerome Vienne Texas Advanced Computing Center January 10 th,
Introduction to MPI Jerome Vienne Texas Advanced Computing Center January 10 th, 2013 Email: viennej@tacc.utexas.edu 1 Course Objectives & Assumptions Objectives Teach basics of MPI-Programming Share information
More informationHolland 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 informationPCAP 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 informationMPI 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 informationParallel Computing and the MPI environment
Parallel Computing and the MPI environment Claudio Chiaruttini Dipartimento di Matematica e Informatica Centro Interdipartimentale per le Scienze Computazionali (CISC) Università di Trieste http://www.dmi.units.it/~chiarutt/didattica/parallela
More informationIntroduction to MPI. Ritu Arora Texas Advanced Computing Center June 17,
Introduction to MPI Ritu Arora Texas Advanced Computing Center June 17, 2014 Email: rauta@tacc.utexas.edu 1 Course Objectives & Assumptions Objectives Teach basics of MPI-Programming Share information
More informationMessage 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 informationAn Introduction to MPI
An Introduction to MPI Parallel Programming with the Message Passing Interface William Gropp Ewing Lusk Argonne National Laboratory 1 Outline Background The message-passing model Origins of MPI and current
More informationParallel 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 informationIntroduction to MPI. SHARCNET MPI Lecture Series: Part I of II. Paul Preney, OCT, M.Sc., B.Ed., B.Sc.
Introduction to MPI SHARCNET MPI Lecture Series: Part I of II Paul Preney, OCT, M.Sc., B.Ed., B.Sc. preney@sharcnet.ca School of Computer Science University of Windsor Windsor, Ontario, Canada Copyright
More informationMore 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 informationProgramming 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 informationMA471. 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 informationFirst day. Basics of parallel programming. RIKEN CCS HPC Summer School Hiroya Matsuba, RIKEN CCS
First day Basics of parallel programming RIKEN CCS HPC Summer School Hiroya Matsuba, RIKEN CCS Today s schedule: Basics of parallel programming 7/22 AM: Lecture Goals Understand the design of typical parallel
More informationMPI and OpenMP (Lecture 25, cs262a) Ion Stoica, UC Berkeley November 19, 2016
MPI and OpenMP (Lecture 25, cs262a) Ion Stoica, UC Berkeley November 19, 2016 Message passing vs. Shared memory Client Client Client Client send(msg) recv(msg) send(msg) recv(msg) MSG MSG MSG IPC Shared
More informationMPI 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 informationParallel 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 Introduction and Review The Von Neumann Computer Kinds of Parallel
More informationmith 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 informationDistributed 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 informationParallel 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 informationMPI - 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 informationLecture 7: Distributed memory
Lecture 7: Distributed memory David Bindel 15 Feb 2010 Logistics HW 1 due Wednesday: See wiki for notes on: Bottom-up strategy and debugging Matrix allocation issues Using SSE and alignment comments Timing
More informationmpi-02.c 1/1. 15/10/26 mpi-01.c 1/1. 15/10/26
mpi-01.c 1/1 main ( argc, char * argv[]) rank, size; prf ("I am process %d of %d\n", rank, size); mpi-02.c 1/1 #include main ( argc, char * argv[]) rank, size, src, dest, nc; tag = 50; // tag
More informationBasic 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 informationStandard 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 informationProgramming 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 informationParallel 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 informationLecture 6: Message Passing Interface
Lecture 6: Message Passing Interface Introduction The basics of MPI Some simple problems More advanced functions of MPI A few more examples CA463D Lecture Notes (Martin Crane 2013) 50 When is Parallel
More informationPractical Introduction to Message-Passing Interface (MPI)
1 Practical Introduction to Message-Passing Interface (MPI) October 1st, 2015 By: Pier-Luc St-Onge Partners and Sponsors 2 Setup for the workshop 1. Get a user ID and password paper (provided in class):
More informationCSE 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 informationParallel Computing. Distributed memory model MPI. Leopold Grinberg T. J. Watson IBM Research Center, USA. Instructor: Leopold Grinberg
Parallel Computing Distributed memory model MPI Leopold Grinberg T. J. Watson IBM Research Center, USA Why do we need to compute in parallel large problem size - memory constraints computation on a single
More informationNUMERICAL 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 informationTopics. 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 informationint 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 informationData 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 informationCS4961 Parallel Programming. Lecture 16: Introduction to Message Passing 11/3/11. Administrative. Mary Hall November 3, 2011.
CS4961 Parallel Programming Lecture 16: Introduction to Message Passing Administrative Next programming assignment due on Monday, Nov. 7 at midnight Need to define teams and have initial conversation with
More informationHigh 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 informationIntroduction 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 informationCS 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 informationOutline. Introduction to HPC computing. OpenMP MPI. Introduction. Understanding communications. Collective communications. Communicators.
Lecture 8 MPI Outline Introduction to HPC computing OpenMP MPI Introduction Understanding communications Collective communications Communicators Topologies Grouping Data for Communication Input / output
More informationCollective Communications II
Collective Communications II Ned Nedialkov McMaster University Canada SE/CS 4F03 January 2014 Outline Scatter Example: parallel A b Distributing a matrix Gather Serial A b Parallel A b Allocating memory
More informationMPI 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 informationMPI 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 informationDistributed Memory Programming with MPI
Distributed Memory Programming with MPI Part 1 Bryan Mills, PhD Spring 2017 A distributed memory system A shared memory system Identifying MPI processes n Common pracace to idenafy processes by nonnegaave
More informationCOSC 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 informationThe Message Passing Interface (MPI) TMA4280 Introduction to Supercomputing
The Message Passing Interface (MPI) TMA4280 Introduction to Supercomputing NTNU, IMF January 16. 2017 1 Parallelism Decompose the execution into several tasks according to the work to be done: Function/Task
More informationMPI Tutorial. Shao-Ching Huang. High Performance Computing Group UCLA Institute for Digital Research and Education
MPI Tutorial Shao-Ching Huang High Performance Computing Group UCLA Institute for Digital Research and Education Center for Vision, Cognition, Learning and Art, UCLA July 15 22, 2013 A few words before
More informationMessage 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 informationAdvanced 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 informationParallel 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 informationWhat is Hadoop? Hadoop is an ecosystem of tools for processing Big Data. Hadoop is an open source project.
Back to Hadoop 1 What is Hadoop? Hadoop is an ecosystem of tools for processing Big Data. Hadoop is an open source project. 2 A family of tools MapReduce HDFS HBase Hive Pig ZooKeeper Avro Sqoop Oozie
More informationScientific 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 informationProgramming 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 informationIntroduction 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 informationCollective Communications I
Collective Communications I Ned Nedialkov McMaster University Canada CS/SE 4F03 January 2016 Outline Introduction Broadcast Reduce c 2013 16 Ned Nedialkov 2/14 Introduction A collective communication involves
More informationMPI Tutorial. Shao-Ching Huang. IDRE High Performance Computing Workshop
MPI Tutorial Shao-Ching Huang IDRE High Performance Computing Workshop 2013-02-13 Distributed Memory Each CPU has its own (local) memory This needs to be fast for parallel scalability (e.g. Infiniband,
More informationCEE 618 Scientific Parallel Computing (Lecture 5): Message-Passing Interface (MPI) advanced
1 / 32 CEE 618 Scientific Parallel Computing (Lecture 5): Message-Passing Interface (MPI) advanced Albert S. Kim Department of Civil and Environmental Engineering University of Hawai i at Manoa 2540 Dole
More informationDepartment of Informatics V. HPC-Lab. Session 4: MPI, CG M. Bader, A. Breuer. Alex Breuer
HPC-Lab Session 4: MPI, CG M. Bader, A. Breuer Meetings Date Schedule 10/13/14 Kickoff 10/20/14 Q&A 10/27/14 Presentation 1 11/03/14 H. Bast, Intel 11/10/14 Presentation 2 12/01/14 Presentation 3 12/08/14
More informationParallel hardware. Distributed Memory. Parallel software. COMP528 MPI Programming, I. Flynn s taxonomy:
COMP528 MPI Programming, I www.csc.liv.ac.uk/~alexei/comp528 Alexei Lisitsa Dept of computer science University of Liverpool a.lisitsa@.liverpool.ac.uk Flynn s taxonomy: Parallel hardware SISD (Single
More informationThe Message Passing Interface (MPI): Parallelism on Multiple (Possibly Heterogeneous) CPUs
1 The Message Passing Interface (MPI): Parallelism on Multiple (Possibly Heterogeneous) CPUs http://mpi-forum.org https://www.open-mpi.org/ Mike Bailey mjb@cs.oregonstate.edu Oregon State University mpi.pptx
More informationCapstone Project. Project: Middleware for Cluster Computing
Capstone Project Project: Middleware for Cluster Computing Middleware is computer software that connects software components or applications. The software consists of a set of enabling services that allow
More informationDistributed Memory Parallel Programming
COSC Big Data Analytics Parallel Programming using MPI Edgar Gabriel Spring 201 Distributed Memory Parallel Programming Vast majority of clusters are homogeneous Necessitated by the complexity of maintaining
More information15-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 informationHigh-Performance Computing: MPI (ctd)
High-Performance Computing: MPI (ctd) Adrian F. Clark: alien@essex.ac.uk 2015 16 Adrian F. Clark: alien@essex.ac.uk High-Performance Computing: MPI (ctd) 2015 16 1 / 22 A reminder Last time, we started
More informationProgramming 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 informationMPI: The Message-Passing Interface. Most of this discussion is from [1] and [2].
MPI: The Message-Passing Interface Most of this discussion is from [1] and [2]. What Is MPI? The Message-Passing Interface (MPI) is a standard for expressing distributed parallelism via message passing.
More informationIntroduction to Parallel Programming
University of Nizhni Novgorod Faculty of Computational Mathematics & Cybernetics Section 4. Part 1. Introduction to Parallel Programming Parallel Programming with MPI Gergel V.P., Professor, D.Sc., Software
More informationMPI introduction - exercises -
MPI introduction - exercises - Paolo Ramieri, Maurizio Cremonesi May 2016 Startup notes Access the server and go on scratch partition: ssh a08tra49@login.galileo.cineca.it cd $CINECA_SCRATCH Create a job
More informationWhat 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