This page describes how to set up a Linux cluster using PVM (parallel virtual machine). It also shows some examples.
The purpose is not to show an optimized environment, but one that does work and may show how to do it basically.
The hardware setup in this tutorial is fairly simple: just to ordinary PCs. It could be your current machine and some older, not in use any more, as it is in this tutorial. Those two machines are connected through a normal ethernet connection (twisted pair). Not as spectacular as a hypercube, but sufficient for the purpose of the tutorial. Figure 1 shows the hardware setup.
Please note the heterogenous setup of one 32bit Intel and one 64bit AMD machine (and it still works).
In this setup
hydra works as master and
dev0 as slave. For the entire tutorial, I will call them hydra and dev0 as synonyms for master and slave.
|hydra||CPU: Intel Core2 Q6600 (2.4GHz)|
|OS: Kubuntu 8.04|
|IP: 192.168.100.200 (static)|
|dev0||CPU: AMD64-3800 (2.4GHz)|
|OS: Xubuntu 8.04|
|IP: 192.168.100.210 (static)|
There are several packages needed to be installed. Using the Linux distributions mentioned above, they are very easy to install (adept, synaptic or apt-get).
The software packages have to be installed on both machines. The packages are:
Go through the following sections and configure the packages.
On both machines has to exist the same user. In my case I created on both machines the user
mario which will be use throughout this tutorial.
Make sure the two machines know each other:
The easiest way is to perform this step is during installation of the system.
Feel free to install/use
BOOTP or something if you like.
Between the two machines you'll need a ssh connection.
Generate a key pair and move the public key to the server (in this case
dev0). Go through the following steps to achieve this:
Create key pair (private key and public key):
creates the file
|Append the file to
|Make sure to have a correct configuration for
the ssh serer. Edit the file
and make sure to have the following lines:
From now on you can login from hydra to
dev0 simply typing:
$ ssh dev0
For an easy transfer of the source/program form hydra to
dev0 we'll use NFS (network file system).
This tutorial assumes you will have your PVM programs in
/home/mario/pvm on hydra.
dev0 will be able to access source/binary of the program, provided by
On the Kubuntu/Xubuntu systems, the installation directory of the PVM package is
We will have to define the environment variables
PVM_ARCH. If you are not sure which architecture you will have to set, just run:
In this tutorial the architecture is defined as
The symbolic links are necessary because PVM searches for the binaries to execute in the path
$PVM_ROOT/bin/$PVM_ARCH. In this case, it is linked to place where the binaries really are (eighter local for hydra or over NFS for
In order to let the PVM programs to run,
pvmd must run on each machine.
To achieve this, make sure
pvmd is running through
/etc/init.d or start it manually:
You might want to check the virtual machine graphically using
xpvm (see Figure 2).
This chapter shows some examples, how to build them and how to run them on the cluster.
Each example will have its own Makefile with the name
Makefile.example. To build a specific example it is as easy as typing:
$ make -f Makfile.example
There is also a master Makefile, building all examples:
To clean up:
$ make clean
Please Note: since there are two architectures in this tutorial (
LINUX64), the binaries have to be compiles each on hydra and dev0.
To build and run all the examples, all examples and the current working directory have to be
This example show how to obtain the configuration of the virutal machine. Running the example shows all machines added to the virtual machine, their architecture, etc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
To build this example individually:
$ make -f Makefile.cfg
Since this program just gets the configuration, building and running must only be done on
hydra. Run it and see all machines:
More to come ...