Parallel Virtual Machine

Download Report

Transcript Parallel Virtual Machine

Parallel Virtual Machine
Rama Vykunta
Introduction



PVM provides a unified frame work for
developing parallel programs with the
existing infrastructure
PVM enables a collection of
heterogeneous computer systems as a
single parallel virtual machine
Transparent to the user
Introduction



A simple computing model based on
tasks is used which is given by a set of
well defined function calls
An application is written as a set of cooperating tasks
Processes communicate/synchronize
with other processes
Introduction



Process management, machine
configuration and support for
input/output is possible
User can configure the hosts according
to the demand. He can position certain
tasks on the most appropriate machines
Unit of parallelism in PVM is a task



All tasks on PVM cooperate by sending
and receiving messages from one
another
PVM supports functional and data
parallelism
A well defined library of PVM interface
routines are used for programming
Details

PVM system is composed of two parts
– Daemon(pvmd) that resides on all
computers making the virtual machine
– The second part of the system is a library
of PVM interface routines


All PVM tasks are identified by an
integer task identifier (TID)
A task can join or leave any group any
time without having to inform any other
task in the affected groups
Details


User can write programs in C, C++ or
Fortran which contain embedded calls
to the PVM library
Starting PVM
– % pvm
– pvm>add hostname
– pvm>delete hostname
– pvm>conf
– pvm>ps -a
– pvm>halt
Details


To compile use architecture
independent ‘aimk’ which automatically
determines the architecture and links
any OS specific libraries to the
application
PVM supports use of multiple consoles,
it is possible to run a console on any
host and also to run multiple consoles
on the same machine
Details



PVM supports two models of
computation namely crowd computing
and tree computing.
Crowd computing is a collection of
closely related processes, typically
executing the same code
Tree computing in which processes are
spawned dynamically as the
computation progresses
Example
main() {
int cc, tid, msgtag;
char buf[100];
printf(“I’m t%x\n”, pvm_mytid());
cc = pvm_spawn(“hello_other”, (char**)0, 0, “”, 1, &tid);
if(cc == 1) {
msgtag = 1;
pvm_recv(tid, msgtag);
pvm_upkstr(buf);
printf(“from t%x: %s\n”, tid, buf);
} else
printf(can’t start hello_other\n”);
pvm_exit();
}
Example
# include “pvm3.h”
main() {
int ptid, msgtag;
char buf[100];
ptid = pvm_parent();
strcpy(buf, “hello, world from”);
gethostname(buf + strlen(buf), 64);
msgtag = 1;
pvm_initsend(PvmDataDefault);
pvm_upkstr(buf);
pvm_send(ptid, msgtag);
pvm_exit();
}
Example



After printing the task ID it initiates the
copy of the other program called
hello_other using pvm_spawn()
function.
The main program recieves the
message using pvm_recv() function and
the buffer is exracted by pvm_upkstr()
The final pvm_exit() call dissociates the
program from the PVM system
XPVM




XPVM is a GUI tool for analyzing the
parallel programs in PVM
XPVM is can be used as a trace monitor
and a call-level debugger extension to
the PVM
XPVM is based on PVM, TCL and TK
XPVM can be used to view task
utilization, network view, space-time
view and message-queue view.
XPVM



Hosts can be added and removed form
the virtual machine
Using the task menu, tasks can be
spawned, killed or signaled
Each host is connected to the network
by a link and a color is used to indicate
the state of the host
– Green: Actively running the tasks
– White: Host is idling
– Yellow: Host is not busy collecting
information
XPVM




Space - Time view displays the status
of the tasks and hosts during a program
execution
Utilization view shows the overall
computing state during a given instance
Trace view prints the tasks during each
instance of activity
Event History view contains all the
trace events in the trace file
References

PVM: Parallel Virtual Machine: A Users'
Guide and Tutorial for Networked
Parallel Computing
MIT Press Scientific and Engineering
Computation