27
PVM

PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Embed Size (px)

Citation preview

Page 1: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

PVM

Page 2: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

PVM - What Is It?

Stands for: Parallel Virtual Machine A software tool used to create and execute

concurrent or parallel applications. Operates on a collection of heterogenous

Unix computers connected by one or more networks.

Communication accomplished by message passing

Page 3: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

PVM - What Is It?

Comprised of two main components– the PVM daemon process (pvmd3)– library interface routines (libpvm3.a,

libfpvm3.a & libgpvm3.a) Public domain software package developed

at Oak Ridge National Laboratory.

Page 4: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

PVM Components

Page 5: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

PVM Daemon (pvmd3)

The PVM daemon (pvmd3) is a Unix process which oversees the operation of user processes within a PVM application and coordinates inter-machine PVM communications.

Page 6: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

PVM Daemon (pvmd3)

One daemon runs on each machine configured into your parallel virtual machine. Other users, with their own parallel virtual machines, will have their own pvmd3s running.

User processes communicate with each other through the daemons.

Page 7: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

PVM Libraries

libpvm3.a - Library of C language interface routines. Always required.

They contain simple subroutine calls that the application programmer may imbed in concurrent or parallel application code.

Page 8: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Provide ability to:

initiate and terminate processes pack, send, receive and broadcast messages synchronize via barriers query and dynamically change

configuration of the parallel virtual machine

Page 9: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Libraries

do not directly communicate to other processes. Instead, they send commands to the local daemon and receive status information back.

Can be installed in user filespace - default is $HOME/pvm3/lib.

Data format conversion (XDR) performed automatically between hosts of different architectures.

Page 10: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Getting Started

Create a directory ~/pvm3/bin/ARCH on each machine for your executable components.

create a soft link to the actual pvm3/lib location (% ln -s ~snell/pvm3/lib ~/pvm3/lib)

PVM_ROOT should be set to ~/pvm3 Include the appropriate PVM library routine

calls in your code.

Page 11: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

PVM Routines

Page 12: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Process Control & Information

Processes are identified by process IDs Each process must acquire a list of all the

process IDs in the group Functions

– pvm_mytid– pvm_siblings

Must call pvm_exit() to quit

Page 13: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Sending

Initialize buffers Pack the message Send

pvm_initsend(PvmDataDefault);pvm_pkint(&token, count, stride);pvm_send(dest, msgtag);

Page 14: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Receiving

Receive the message Unpack

pvm_recv(src, msgtag); pvm_upkint(&token, count, stride);

Page 15: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Compile Your Application Components

Always need libpvm3.a library. % cc -o myprog myprog.c

-I$PVM_ROOT/include -L$PVM_ROOT/lib/$PVM_ARCH -lpvm3

For Dynamic Groups, also need libgpvm3.a added before libpvm3.a

Make sure that executable components are located in ~/pvm3/bin/ARCH on each machine as required.

Page 16: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Create your PVM hostfile

Your PVM hostfile defines your parallel virtual machine. It contains the names of all desired machines, one per line

Must reside only on the machine where you start up PVM

The filename can be whatever you like Comment lines start with "#" Precede hostname with "&" if dynamically added

later

Page 17: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Other options permitted:

lo = login userid pw = password entry required dx = daemon path if not using default ep = executable program component paths

if not using default ~/pvm3/bin/ARCH

Page 18: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Create Your $HOME/.rhosts file

The .rhosts is a standard Unix "trusted hosts" file - permits remote login and command execution without password. It is not unique to PVM - simply used by PVM.

Must be in your home directory Should be readable by user only! Format: host.domain.name userid

Page 19: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Start the Master PVM Daemon

Start up the master (first) daemon. % pvmd3 hostfile & Must be started on your local machine Automatically starts up daemons on all

other machines (remote) specified in your hostfile.

Page 20: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Tips

Do not run in the background if using the password (pw) specification in your hostfile.

Should only have one pvmd3 running on each machine in your virtual machine!

PVM console can be started after pvmd3 by typing "pvm". PVM console commands can then be issued.

Page 21: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Execute your application

Begin execution of your program on your local machine

% myprog What happens from here depends upon your

application.

Page 22: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Quit PVM

Make sure all application components include a PVM library call of "pvmfexit(info)" or "pvm_exit()".

Halting the master pvmd3 will automatically kill all other pvmd3s and all processes enrolled in this PVM.

Running in pvm console mode: use "halt" command

Page 23: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

If it won't die

Abnormal terminations of PVM may leave files in /tmp which prevent you from restarting (known bug). Should delete all /tmp/pvm*. files on all machines before restarting the master pvmd3.

Try "~clement/bin/kill-pvms" if all else fails

Page 24: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Miscellaneous & Hints

The most common problem in starting PVM daemons is probably due to daemons already running on the machine(s), or the existence of a /tmp/pvmd.uid file. You'll need to kill old daemons and/or remove any /tmp/pvmd.uid files.

The second most common problem is probably due to incorrect .rhost files.

Page 25: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Other Problems

Another, less frequent startup problem is due to .cshrc files that require interactive input or which display messages.

Page 26: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Be Careful

Be careful of concurrent I/O to the same files in a shared filesystem! For concurrent I/O (writing) in a shared filesystem, you may want to implement a scheme to assign unique names to output files.

Page 27: PVM. PVM - What Is It? F Stands for: Parallel Virtual Machine F A software tool used to create and execute concurrent or parallel applications. F Operates

Your Assignment

Specifications are on the web Using a Jacobi 5 point stencil, solve the 2D

steady state temperature distribution problem on a 768 x 768 grid.

Use formula 2.1 on page 34 Report your execution times on 2, 4, and 8

processors.