PVM: Parallel Virtual Machine A Users' Guide and Tutorial for Networked Parallel Computing - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

PVM: Parallel Virtual Machine A Users' Guide and Tutorial for Networked Parallel Computing

Description:

... master processes simply kill of the workers when they are no longer needed ... A Beginner's Guide to PVM Virtual Machine, available through http://www.itec.uni ... – PowerPoint PPT presentation

Number of Views:279
Avg rating:3.0/5.0
Slides: 14
Provided by: tainc
Category:

less

Transcript and Presenter's Notes

Title: PVM: Parallel Virtual Machine A Users' Guide and Tutorial for Networked Parallel Computing


1
?????
  • PVM Parallel Virtual Machine A Users' Guide and
    Tutorial for Networked Parallel Computing
  • Program Examples
  • ????? ???

2
Contents
Program Examples Fork-Join  Fork Join Example
Dot Product  Example program PSDOT.F Failure 
Example program failure.c Matrix Multiply 
Example program mmult.c One-Dimensional Heat
Equation  Example program heat.c Example
program heatslv.c Different Styles of
Communication  
3
Overview
  • The first example
  • forkjoin.c
  • Show how to spawn off processes and synchronize
    with them
  • The second example
  • A Fortran dot product program
  • PSDOT.F
  • The third example
  • failure.c
  • Use the pvm_notify() call to create fault
    tolerant applications

4
Fork-Join
  • To spawn PVM tasks and synchronize with them
  • The program spawns several tasks
  • Three by default
  • Three steps
  • The children then synchronize by sending a
    message to their parent task
  • The parent receives a message from each of the
    spawned tasks
  • Print out information about the message from the
    child tasks

5
Fork-Join
  • The fork-join program contains the code for both
    the parent and the child tasks
  • See the source code of the Fork-Join example

6
Fork-Join
  • The output of running forkjoin

forkjoin t10001c t40149 tc0037 Length 4, Tag
11, Tid t40149 Length 4, Tag 11, Tid tc0037
Length 4, Tag 11, Tid t10001 c forkjoin 4
t10001e t10001d t4014b tc0038 Length 4, Tag 11,
Tid t4014b Length 4, Tag 11, Tid tc0038 Length
4, Tag 11, Tid t10001d Length 4, Tag 11, Tid
t10001e
7
Failure
  • The failure example demonstrates
  • how one can kill tasks
  • How one can find out when tasks exit or fail
  • Fining out when a task fails
  • Call pvm_notify() after spawning the tasks
  • The pvm_notify() call can tells PVM to send the
    calling task a message when certain tasks exit

8
Failure
  • The task calling pvm_notify() will receive the
    notification, not the tasks given in the task id
    array
  • The notify call can also be used to a task when a
    new host has been added or deleted from the
    virtual machine

9
Failure
  • After requesting notification, the parent task
    then kills one of the children
  • After killing one of the spawned tasks, the
    parent waits on a pvm_recv(-1, TASKDIED) for the
    message notifying it the task has died
  • The process unpacks the dead tasks id and prints
    it out

10
Failure
  • See the source code of the Failure example

11
Different Styles of Communication
  • These example demonstrate various ways of writing
    PVM programs
  • In some cases messages are used for
    synchronization
  • In others the master processes simply kill of the
    workers when they are no longer needed

12
Quiz
  • 1210000
  • Distribute the above calculation to several PVM
    tasks, for example n tasks
  • Kill the middle task, i.e. n/2
  • Try to obtain the correct calculating result from
    the remaining n-1 tasks

13
Reference
  • A Beginners Guide to PVM Virtual Machine,
    available through http//www.itec.uni-klu.ac.at/h
    arald/PVM/pvm_guide.html
Write a Comment
User Comments (0)
About PowerShow.com