Pvm

 view release on metacpan or  search on metacpan

blib/lib/Pvm.pm  view on Meta::CPAN


  use Pvm;

=head1 DESCRIPTION

The C<PVM> message passing system 
enables a programmer to configure a group of 
(possibly heterogenous) computers connected via 
a network (including the internet) into a 
parallel virtual machine.  
The system was developed by 
the University of Tennessee, Oak Ridge National 
Laboratory and Emory University. 

Using C<PVM>, applications can 
be developed which spawns parallel processes onto 
nodes in this virtual machine to perform specific tasks.  
These parallel tasks can also periodically exchange 
information using a set of message passing functions 
developed for the system.  

C<PVM> applications have mostly been developed in the scientific 
and engineering fields.  However applications 
for real-time and client/server systems can also be developed.  
C<PVM> simply provides a convenient way for managing 
parallel tasks and communications  
without need for C<rexec> or C<socket> level programming.

As a utility, C<PVM> enables an organisation to leverage on the computers 
already available for parallel processing.  
Parallel applications can be started during non-peak 
hours to utilise idle CPU cycles.  
Or dedicated workstation clusters connected via 
a high performance network like C<ATM> can be used for high 
performance computing.  

It is recommended that you read the C<PVM> manual pages and the book
C<PVM: Parallel Virtual Machine, A users's guide and tutorial 
for networked parallel computing>.  Both the C<PVM> system and the 
book can be obtained by email from C<netlib@ornl.gov> 
or anonymous ftp from C<netlib2.cs.utk.edu>.  

For the rest of 
this document we will provide a tutorial introduction to 
developing C<PVM> applications using perl.  The interface for some 
of the C<PVM> functions have been changed of course to give it a 
more perl-like feel.  

Remember think perl think parallel!  Good Luck!  

=head2 Environment Variables

After installing C<PVM> on your computer, there are two mandatory 
environment variables that have to be set in your .login or .cshrc
files; C<PVM_ROOT> and C<PVM_ARCH>.  
C<PVM_ROOT> points to the base of the C<PVM> 
installation directory, and C<PVM_ARCH> specifies the architecture 
of the computer on which C<PVM> is running.   An example of how this can 
be set for csh is shown below,

	setenv PVM_ROOT /usr/local/pvm3
	setenv PVM_ARCH `$PVM_ROOT/lib/pvmgetarch`

=head2 Setting up your rsh permission

In order for C<PVM> applications to run, C<rsh> permission 
has to be enabled.  This involves creating a C<.rhosts> 
file in your C<HOME> directory containing, for each line, the host and 
account name you wish to allow remote execution privillages.
An example C<.rhosts> file to allow a C<PVM> application to 
remotely execute on the host C<onyx> and C<prata> using the 
account C<edward> is shown below,

	onyx	edward
	prata	edward

=head2 Configuring your parallel virtual machine

Parallel process management and communications is handled by a set of 
distributed deamons running on each of the nodes of the 
virtual machine.  The daemon executable, C<pvmd>, is started 
when a computer is added to the virtual machine.  
A computer can be added to the virtual machine either statically 
in a console program or using a C<hostfile>, 
or dynamically within the application code itself.

The first method of configuring your virtual machine 
is to use the console program C<$PVM_ROOT/lib/pvm>.  
Run it from the command prompt.  The console program will first add the 
local host into the virtual machine and display the prompt 
	
	pvm>

To add a host, eg C<onyx>, as a node in your parallel virtual machine, simply
type

	pvm> add onyx

To display the current virtual machine configuration type

	pvm> conf

which will display node information pertaining to the host name, 
host id, host architecture, relative speed and data format.  
The console program has a number of other commands which can 
be viewed by typing C<help>.  

The second method of configuring your virtual machine is to use 
a C<hostfile>.   The C<hostfile> is simply an ASCII text file 
specifing the host names of the computers to be added into your 
virtual machine.  

Additional options may be also be defined 
for the nodes pertaining to the working directory, 
execution path, login name, alternative hostname etc. A simple
example of a C<hostfile> is shown below. 

	* wd=$HOME/work ep=$HOME/bin
	onyx
	prata.nsrc.nus.sg
	laksa ep=$HOME/perl5/bin



( run in 0.737 second using v1.01-cache-2.11-cpan-39bf76dae61 )