Parallel Processing

10
Parallel Processing To study the communication among the nodes of a cluster

description

Parallel Processing. To study the communication among the nodes of a cluster. MPI-Message Passing Interface. A library of functions or an API Allows communication between processors in a distributed memory architecture. Affords portability. Uses either a C or a FORTRAN compiler. - PowerPoint PPT Presentation

Transcript of Parallel Processing

Page 1: Parallel Processing

Parallel Processing

To study the communication among the nodes of a cluster

Page 2: Parallel Processing

MPI-Message Passing Interface

A library of functions or an API Allows communication between

processors in a distributed memory architecture.

Affords portability. Uses either a C or a FORTRAN

compiler.

Page 3: Parallel Processing

MPI Data Types

MPI datatype handle C datatype

MPI_INT int

MPI_SHORT short

MPI_LONG long

MPI_FLOAT float

MPI_DOUBLE double

MPI_CHAR char

MPI_BYTE unsigned char

Page 4: Parallel Processing

MPI Program# include <stdio.h># include <mpi.h>main(int argc, char **argv) {//codingMPI_Init(&argc, &argv);//codingMPI_Finalize();//coding}

Page 5: Parallel Processing

MPI Init

NetworkNetwork

OO44

33 22

11

Page 6: Parallel Processing

MPI Finalize

NetworkNetwork

OO44

33 22

11

Page 7: Parallel Processing

Logging into linux

To login to linux, login name is test, password is test.

Applications>system>terminal test@linux:~>pwd /home/test

Page 8: Parallel Processing

Remote login to master node

rlogin 172.16.66.27 –l ppPassword: asdfgh vi <filename>.c To go to insert mode press i To come out of insert mode press Esc.

Page 9: Parallel Processing

Saving and quiting Suppose I had written vi urooj.c• :w save file as urooj.c• :w ur1.c save file as ur1.c• :w /xy/urooj.c save file as urooj.c in /xy• :w /xy/ur.c save file as ur.c in /xy• :wq save and quit• :wq ur1.c save as ur1.c and quit • :wq /xy/urooj.csave file as urooj.c in /xy and quit• :wq /xy/ur.c save file as ur.c in /xy and quit• :q quits only if work has been

saved• :q! quits without saving

Page 10: Parallel Processing

Compiling and running

mpicc –o <executable file name> <source file name>

mpirun <executable file name> mpirun –np <no> <executable file

name>