
PVM version 3 examples
05 Mar 1994

________________________________________________________________________

This directory contains C and FORTRAN example programs using PVM 3

1.) Hello + hello_other:
	Two programs that cooperate - shows how to create a new task
	and pass messages between tasks.

2.) Master + slave, fmaster + fslave:
	A master/slave example where the master process creates and
	directs some number of slave processes that cooperate to do the
	work.  C and FORTRAN versions.

3.) Spmd, Fspmd:
	An SPMD (Single Program Multiple Data) example where a single
	"hostless" program creates copies of itself and then proceeds
	to solve a problem in parallel.  Fspmd is identical except
	written in FORTRAN. Illustrates use of group functions.

4.) Testall.f:
	Illustrates the use of most of the available PVM 3 FORTRAN
	calls and also serves to test which options are implemented at
	the present time.

5.) Timing + timing_slave:
	A simple program to illustrate how to measure network bandwidth
	and latency.

6.) hitc + hitc_slave:
    A simplified kernel of a larger supercondutor application,
    hitc illustrates dynamic load balancing using the 
    'pool of tasks' paradigm. A synthetic workload is created
    in this example, and hitc automatically places one slave per host.

7.) gexample, fgexample
    Illustrates the use of group functions including reduce f.e. global sum
    and user defined reduce functions.

8.) nntime
    A program to illustrate node to node communication on CM5, I860,
    and Paragon multiprocessors among others.

To build these examples, use the aimk program ($PVM_ROOT/lib/aimk).
******************************************************************************
 Note the fortran examples 'include' ../include/fpvm3.h
 If this file is not there, then just change this line in the example codes
 to point to the actual location. Guaranteed to be in $PVM_ROOT/include/fpvm3.h
******************************************************************************
Just type:
	aimk hello hello_other    Pair of hello programs
	aimk master slave         C version of master/slave example
	aimk fmaster fslave       FORTRAN version of master/slave example
	aimk spmd                 C version of SPMD example
	(aimk spmdh spmd          on Paragon/CM5/I860)
	aimk fspmd                FORTRAN version of SPMD example
	aimk testall              FORTRAN interface tester
    aimk gexample             C version of reduce example
    aimk fgexample            FORTRAN version of reduce example
	aimk timing timing_slave  timing example in C
	aimk hitc hitc_slave      dynamic load balance example

The executables are placed in pvm3/bin/ARCH. 

To run examples:  
The examples are independent of the number of computers in the virtual machine.

Step 1 Start PVM
Start up PVM by typing
    pvm  [hostfile]
This console allows the user to add/delete hosts if desired.

Step 2 Run a PVM program
Once the virtual machine (VM) is configured
simply execute any of the following at any UNIX prompt in the VM
	hello
	master1
	spmd (spmdh on Paragon/CM5/I860)
	testall
    gexample
	timing
    hitc
	nntime (on Paragon/CM5/I860, from pvm console: spawn -2 nntime)

Step 3 Stop PVM
When the user is through with the virtual machine 
PVM can be shut down by giving 'halt' command to PVM console.
    pvm> halt
