270 likes | 440 Views
PVM. 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.
E N D
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
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.
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.
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.
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.
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
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.
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.
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
Sending • Initialize buffers • Pack the message • Send pvm_initsend(PvmDataDefault); pvm_pkint(&token, count, stride); pvm_send(dest, msgtag);
Receiving • Receive the message • Unpack pvm_recv(src, msgtag); pvm_upkint(&token, count, stride);
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.
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
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
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
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.
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.
Execute your application • Begin execution of your program on your local machine • % myprog • What happens from here depends upon your application.
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
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
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.
Other Problems • Another, less frequent startup problem is due to .cshrc files that require interactive input or which display messages.
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.
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.