To make the environment aware of various details such as where the
root directory was installed for PVM on our systems, the type of
architecture being used (LINUX), and the location for the slave PVM
daemon processes, include these lines in the .profile file:
In order for processes to know where to find system wide as well as your own compiled PVM binaries, include these lines under the section for creating a PATH:
| [ -d /usr/pvm3/bin ] && | PATH=/usr/pvm3/bin:$PATH |
| [ -d ~/pvm3/bin ] && | PATH=~/pvm3/bin:$PATH |
In order to have access to the online help through the "man" pages, you may also include this line under the section for creating a MANPATH:
| [ -d /usr/pvm3/man ] && | MANPATH=/usr/pvm3/man:$MANPATH |
PVM uses a set of "trusted" remote hosts that you will access without requiring a passwd. For that to work properly, you need to create a file called ".rhosts" that will contain the names of all systems that you want to trust. You may limit the entries to just a few machines, or else include every computer in the lab. Here is an example .rhosts file:
You will now need to create some directories that PVM will expect to find. In your home directory, create a directory called "pvm3", and under that create a directory called "bin". On that same level as "bin", you may also want to create a directory called "src" for source files. Under the "bin" directory, make a subdirectory called "LINUX" for binaries compiled on our LINUX machines. Use the directory name "SGI5" for pvm binaries that run on the INDYs.
You may also wish to have a simple script to help compile your PVM programs and to include necessary libraries for the appropriate architecture. Here is an example script you may use:
To start the console process, run the program by typing:
just "pvm" if you have set up paths properly.
When the console process is running in a window, the prompt will change to the string "pvm>" instead of whatever you had previously. At this point, the main daemon is running, but the remote systems have not been started.
To incorporate other systems listed in your .rhosts file to the active environment, just type "add" followed by the host name at the prompt.
If everything is satisfactory, the new host will be added to the active environment and a subordinate daemon will be started on that computer. To review which systems have been added to your configuration, type the command "conf". To find a list of other console commands, type "help", but you might have to look at the man pages to see what arguments they require.
Since these processes are running remotely on machines that you are not currently logged into, it is important to type the command "halt" before quitting PVM. This will terminate the console process while it signals all of the remote processes to stop, and will also delete some temporary files associated with your user ID located in /tmp on each machine.
When the environment is set up and running, then just execute PVM programs from any window other than the console used to configure the environment. Type the name of the executable as you would any other program, and the environment will handle all of the parallel communication and execution of slave task processes.
The following text shows a sample run using the programs described previously.
Console Window:
station16:~$ pvm    Start running PVM from station16
pvm> add station1     Set up the environment
1 successful
pvm> add station2
1 successful
pvm> add station3
1 successful
pvm> conf     Check the configuration
4 hosts, 1 data format
pvm> halt
HOST
DTID
ARCH
SPEED
station16 40000 LINUX 1000
station1 80000 LINUX 1000
station2 c0000 LINUX 1000
station3 100000 LINUX 1000
Runtime Window:
station16:~/pvm3/bin/LINUX$ master1     Run the master program from the LINUX directory on station16
How many slave programs (1-MAXTASKS)?
10
Init done:       Initialization is done and packets have been sent. The last column of the array will hold the sum of the elements
in the row.
0: 5.00 40.00 73.00 14.00 21.00 77.00 86.00 0.00
Slave processes are calculating sums and sending back results
1: 85.00 23.00 16.00 77.00 73.00 39.00 66.00 0.00
2: 97.00 65.00 71.00 32.00 10.00 80.00 72.00 0.00
3: 61.00 76.00 8.00 63.00 57.00 75.00 3.00 0.00
4: 24.00 1.00 0.00 81.00 93.00 26.00 96.00 0.00
5: 15.00 55.00 82.00 52.00 30.00 98.00 29.00 0.00
6: 55.00 89.00 47.00 4.00 7.00 71.00 36.00 0.00
7: 17.00 3.00 60.00 78.00 80.00 68.00 41.00 0.00
8: 37.00 96.00 97.00 13.00 49.00 97.00 95.00 0.00
9: 43.00 75.00 91.00 58.00 82.00 73.00 10.00 0.00
Master process has all data and can now print out results
I got 343.000000 from 3 which is tid 262213
I got 321.000000 from 4 which is tid 262214
I got 316.000000 from 0 which is tid 1048628
I got 484.000000 from 8 which is tid 786477
I got 379.000000 from 1 which is tid 1048629
I got 432.000000 from 9 which is tid 786478
I got 427.000000 from 2 which is tid 1048630
I got 361.000000 from 5 which is tid 524353
I got 309.000000 from 6 which is tid 524354
I got 347.000000 from 7 which is tid 524355
Final:
0: 5.00 40.00 73.00 14.00 21.00 77.00 86.00 316.00
1: 85.00 23.00 16.00 77.00 73.00 39.00 66.00 379.00
2: 97.00 65.00 71.00 32.00 10.00 80.00 72.00 427.00
3: 61.00 76.00 8.00 63.00 57.00 75.00 3.00 343.00
4: 24.00 1.00 0.00 81.00 93.00 26.00 96.00 321.00
5: 15.00 55.00 82.00 52.00 30.00 98.00 29.00 361.00
6: 55.00 89.00 47.00 4.00 7.00 71.00 36.00 309.00
7: 17.00 3.00 60.00 78.00 80.00 68.00 41.00 347.00
8: 37.00 96.00 97.00 13.00 49.00 97.00 95.00 484.00
9: 43.00 75.00 91.00 58.00 82.00 73.00 10.00 432.00
Console Window:
pvm> halt     Always remember to shut down PVM by typing halt. Otherwise, the slave processes remain alive on the other systems even after the user has logged off the console.
station16:~$ logout
Eamon Walsh
|
Mandelbrot Set and PVM Eamon used PVM to improve calculation speed for fractals such as the Mandelbrot Set. The image to the left shows the familiar image in the process of being generated. The master program displays a row at a time as soon as the slave process has returned the necessary data.
|
Mike Gordon
|
Computer Simulation and PVM Mike used PVM to increase execution speed when simulating the behavior of projectiles in flight. This graphic represents the solution set of possible hits on a target when all possible angles between 0 and 90 degrees (the vertical axis) are matched with a full range of velocities (the horizontal axis). Every pixel on the screen represented a different combination of angle and velocity that was run through the simulation. The green line indicates those combinations which hit the target whereas black means the projectile missed. A more thorough description of this activity can be found in the article Getting Started with Supercomputing.
|