45
4 Parallel Computing and PVM 黃黃黃

4 Parallel Computing and PVM

  • Upload
    ivrit

  • View
    37

  • Download
    1

Embed Size (px)

DESCRIPTION

4 Parallel Computing and PVM . 黃信健. 4.1 Introduction. Parallel Virtual Machine PVM Beowulf Cluster physics2 Windows 系統下之分散式 運算 Run pssdot laplace and bug on several CPU’s. Windows 系統下之分散式運算. Distributed Computing under Windows. 4.2 Installation. PVM – the Parallel Virtual Machine - PowerPoint PPT Presentation

Citation preview

Page 1: 4 Parallel Computing and PVM

4 Parallel Computingand PVM

黃信健

Page 2: 4 Parallel Computing and PVM

4.1 IntroductionParallel Virtual Machine PVMBeowulf Cluster physics2Windows 系統下之分散式運算Run pssdot laplace and bug on several CPU’s

Page 3: 4 Parallel Computing and PVM

Windows 系統下之分散式運算Distributed Computing under

Windows

Page 4: 4 Parallel Computing and PVM

4.2 Installation

PVM – the Parallel Virtual Machine Unix/Linux vs. Windows systemsrsh rshd service Physics1 consists of 4 pc’s — 3

Windows 98 and 1 Windows Me

Page 5: 4 Parallel Computing and PVM

Physics1Pvm1(PIII500)

Pvm4(PIII200)

Pvm3(PIII200)

Pvm2(PIII233)

Page 6: 4 Parallel Computing and PVM

Physics2, workstation and HPC

32 節點 PC 叢集、刀鋒叢集、高效能平行運算電腦

Page 7: 4 Parallel Computing and PVM

Two Programming Strategies MPMD — Multiple Program Multiple Data

The Bifurcation Map SPMD — Single Program Multiple Data

2 D Laplace Equation Solver (Jacobi Method)

Page 8: 4 Parallel Computing and PVM

Case I – Bifurcation Map

)1(1 iii xxx

Page 9: 4 Parallel Computing and PVM

Result

Load Balancing 

PVM1 (PIII500)

PVM2 (PIII233)

PVM3 (PII 200)

PVM4 (PII 200)

4104K 2210K 1579K 1579K

Table 1. The size of data files

Page 10: 4 Parallel Computing and PVM

C Loop over all worker processes DO 10 K = 1, NPROCS-1C Spawn process and check for error CALL PVMFSPAWN( 'psdot', 0, 'anywhere', 1, TIDS(K), IERR ) IF (IERR .NE. 1) THEN WRITE(*,*) 'ERROR, could not spawn process #',K, $ '. Dying . . .' CALL PVMFEXIT( IERR ) STOP END IFC Send out startup info CALL PVMFINITSEND( PVMDEFAULT, IBUF ) CALL PVMFPACK( INTEGER4, J, 1, 1, IERR ) CALL PVMFPACK( REAL4, X(I), J, 1, IERR ) CALL PVMFPACK( REAL4, Y(I), J, 1, IERR ) CALL PVMFSEND( TIDS(K), 0, IERR ) I = I + J 10 CONTINUE

5.3 spmd-psdot.f - send

Page 11: 4 Parallel Computing and PVM

Case II – 2D Laplace Equation

  

Page 12: 4 Parallel Computing and PVM

ResultBenchmark Timing

  

Number of nodes 2 nodes 3 nodes 4 nodes

CPU time (%) 100 99.23 59.91

Table 2 CPU time against number of nodes

Page 13: 4 Parallel Computing and PVM

Blade Speedup

12

48

16windows

blade0

200

400

600

800

1000

perc

enta

ge

nodes

Predator-prey

Page 14: 4 Parallel Computing and PVM

A Visual Fortran Image Processing System

Page 15: 4 Parallel Computing and PVM

Distributed computing – Unsmoothed

Page 16: 4 Parallel Computing and PVM

Distributed computing – smoothed

Page 17: 4 Parallel Computing and PVM

Outline

平行運算PVMmaster-slave model

Page 18: 4 Parallel Computing and PVM

Parallel Virtual Machine (PVM)

PVM (ornl) and MPI (anl)Oak Ridge National LabArgonne National Lab

Unix / Linux / Windows systemsRemote Shell

rsh / rshd service Winrshd / Arshd

Page 19: 4 Parallel Computing and PVM

Setup PVM InstallShield Install to C:\PVMSet path for pvmd, compiler,

libraries, and temp directoryExecutable –> C:\pvm\bin\win32Output –> C:\PVM

Page 20: 4 Parallel Computing and PVM

Setup Winrshd Comercial package from

http://www.winrshd.com InstallShield Install to C:\progra~1\winrshdConfigure the trusted user

database IP list 140.137.34.* http://www.ataman.com

Page 21: 4 Parallel Computing and PVM

PVM Console Commandspvm> add host

add student25delete student25

pvm> confpvm> halt

Page 22: 4 Parallel Computing and PVM

Ex Program psdot.f – I

Page 23: 4 Parallel Computing and PVM

Ex Program psdot.f – II

Page 24: 4 Parallel Computing and PVM

Ex Program psdot.f – III

Page 25: 4 Parallel Computing and PVM

Ex Program psdot.f – IV

Page 26: 4 Parallel Computing and PVM

Ex Program psdot.f – V

Page 27: 4 Parallel Computing and PVM

Ex Program psdot.f – VI

Page 28: 4 Parallel Computing and PVM

Ex Program psdot.f – VII

Page 29: 4 Parallel Computing and PVM

Ex Program psdot.f – VIII

Page 30: 4 Parallel Computing and PVM

Ex Program master.f – I

Page 31: 4 Parallel Computing and PVM

Program master.f – II

Page 32: 4 Parallel Computing and PVM

Program master.f – III

Page 33: 4 Parallel Computing and PVM

Program master.f – IV

Page 34: 4 Parallel Computing and PVM

Program slave.f – I

Page 35: 4 Parallel Computing and PVM

Program slave.f – II

Page 36: 4 Parallel Computing and PVM

Program slave.f – III

Page 37: 4 Parallel Computing and PVM

Program slave.f – IV

Page 38: 4 Parallel Computing and PVM

Laplace’s Equation

2

2

2

2

2

2

4

0

0

U x x

U x

U x y tx

U x y ty

( ) ( )

( )

( , , ) ( , , )

(Poisson's eq.)

(Laplace's eq.)

Page 39: 4 Parallel Computing and PVM

Finite Difference

U x x y U x y Uxx U

xx

U x yx

U x x y U x x y U x yx

U x yy

U x y y U x y y U x yy

U x x y U x x y U x yx

U x y y U

( , ) ( , ) ( )

( , ) ( , ) ( , ) ( , )( )

( , ) ( , ) ( , ) ( , )( )

( , ) ( , ) ( , )( )

( , ) (

12

2

2

2

2

22

2

2 2

2

2 2

2

x y y U x yy, ) ( , )

( )

2 02

Page 40: 4 Parallel Computing and PVM

)],(),(

),(),([41),(

yxUyxU

yxyxUyxUyxU

Jocobi Method

Page 41: 4 Parallel Computing and PVM

Domain Decomposition

  

Page 42: 4 Parallel Computing and PVM

The Logistic Map

)1(1 iii xxx

x: population : growth rateA quadratic nonlinear map

Page 43: 4 Parallel Computing and PVM

The Parallel Bifurcation Map

Page 44: 4 Parallel Computing and PVM

32 節點 Windows PC 叢集Physics2

Page 45: 4 Parallel Computing and PVM

The EndNext: sequential and parallel

laplace solvers