WMPI 1.5 Beta

Home
WMPI New Features
Files Included in Release
Compiling a program with WMPI
Running a WMPI program
    The Cluster Configuration
    The Process Group File
    Environment Variables
TCP Device
Shared Memory Device
Examples
   PI Calculation
    MultiPingPong
    Mandelbrot Calculation
License Agreement
Acknowledgments
WMPI Home Page

 
Running a WMPI Program

To run a WMPI program it is necessary to set two configuration files first. Since WMPI is able to use any number of devices simultaneously it is necessary to indicate which device is used to communicate with each computer, hence a Cluster Configuration file is needed.
Note: The default configuration file name is wmpi.clusterconf and must be in the same directory as the first executed program. Unless the WMPI_CLUSTER_CONF_FILE environment variable is specified.

As in the former versions of WMPI a Process Group file is necessary to identify which machines will participate in the computation, which programs are to be executed and the number of processes that are to run on that computer. This new version adds the possibility to introduce independent arguments to each executable.
Note: The Process Group file must have the same filename has the first executed program and must be in the same directory.

In order to better adapt WMPI to your environment two environment variables are available.

As in previous versions, to actually run a parallel program using WMPI you only have to execute the first process (aka Big Master), which will read the configuration files and start all the other processes.

Note: The WMPI DLL must be present in the current directory of the executables or in the system PATH environment variable.
 

Cluster Configuration
The user has to create a cluster configuration file.  In this file one specifies the set of machines that may be used in the computation and the communication devices that these use to communicate with each other.

The configuration file has two different parts: the definition of the machines and the devices that these use, and; the definition of how the processes of each machine contacts all the others. The section of how the machines are defined has to start with the string  “/Machines” and ends when the string “/Devices” is found. This last string indicates that the rest of the configuration file contains the definition of how the processes communicate. 

Definition of the machines
The user has to create an entry in the configuration file for each machine with the following syntax:
 
<Windows machine name>
<device1> <machine id using the device1>
<device2> <machine id using the device2>
<device3> <machine id using the device3>

Each entry starts with the identification of a machine, which is its Windows Computer Name (Start->Settings->Control Panel->Network->Identification).  After the name of each machine the user has to specify the devices that the machine uses to communicate with the other machines. For each device the machine has an identifier which is unique within that device (e.g. in the TCP device it is the IP number of the machine).

An example of an entry to specify the machine mountain, which has the devices tcp and shmem, is:
 
mountain
tcp mountain.dei.uc.pt
shmem mountain

Definition of the communication device between processes:

After defining all the machines it is necessary to indicate how the processes of every machine communicate with all other processes. Default communication devices can be introduced for communication between processes that are running in the same machine (internal) and for processes that are running in other machines (external). The user may also specify different devices to connect specific machines.
 
[internal device <device>]
[external device <device>]
[<Windows machine1> <Windows machine2> <device>]

An example of a configuration file is:
 
/Machines
mountain
tcp mountain.dei.uc.pt
shmem mountain
squirrel
tcp squirrel.dei.uc.pt
shmem squirrel
pacific
tcp pacific.dei.uc.pt
#Note: This machine has no shared memory device
/Devices
internal device shmem
external device tcp
pacific pacific tcp

This configuration file specifies three (3) different machines. Two of them have devices tcp and shared memory. The third one (pacific) only uses the device tcp. When configuring the devices it is specified that, by default, to communicate with a process that runs in the same machine, shared memory is used. When communicating with a processes in a remote machine, tcp is used. A special situation is the third machine, which does not have a shared memory device and so it is specified that the processes running within it should use the device tcp to communicate with each other.

The hash mark (#) may be used to place comments in the configuration file.

It is advised to build a configuration file with a superset of machines that are normally used. This file can then be used for all the different computations

Note: The default configuration file name is wmpi.clusterconf and must be in the same directory as the first executed program. Unless the WMPI_CLUSTER_CONF_FILE environment variable is specified.

Process Group File
As in the previous version of WMPI, the user has to create a file which contains the process group description. In this file the user has to indicate which machines will be involved in the computation as well as the executables that will be used.
 
<Windows Machine Name> <number of procs> <executable path> [arguments]
<Windows Machine Name> <number of procs> <executable path> [arguments]

The Windows Computer Name (the same as in the Cluster Configuration file) identifies each machine. Then the user has to specify the number of processes to run on that machine, the executable is specified afterwards. The executable path must be inserted from the point of view of the machine where the program is located. Finally, user may insert arguments for the processes that will run the executable.

An example of a Process Description file is:
mountain    2   c:\wmpi\examples\multipingpong\multipingpong 1000 256
squirrel    1   \\mountain\wmpi\examples\multipingpong\multipingpong 1000 512
pacific      1  \\mountain\wmpi\examples\multipingpong\multipingpong 2000 256

A computation that uses this file has five (5) processes, even though only 4 are specified in the process description file. The fifth process is the process started by the user and which will read this configuration file. The first executable is chosen by the user and the arguments are introduced in the command line to start the process.

The MPI ranks of the processes are derived from the order in which the processes entries are introduced in the configuration file. The process that the user starts is the process with rank 0 (zero), the other processes are ranked as they are listed in the configuration file. In this case the process with rank 1 (one) and 2 (two) run in mountain with arguments “1000” and “256”. Process with rank 3 (three) runs in squirrel executing (an executable that is in a shared directory of mountain) with arguments “1000” and “512”. Finally process number 4 (four) runs in pacific with arguments "2000" and "256".

The hash mark (#) may be used to place comments in the configuration file.

Note: The Process Group file must have the same filename has the first executed process and must be in the same directory (e.g. myprogram.pg).

Environment Variables
WMPI_CLUSTER_CONF_FILE – Since the machines that compose the cluster do not change frequently, the user may specify  a configuration file all the computations that it will start form the machine. Even if not all the machines are normally used, a default configuration file may be a superset of the machines that are normally used. Using this environment variable, the user may specify a configuration file in any directory with any name.

WMPI_PATH - When starting a new process the WMPI will try to find the exe in the path contained in this environment variable. If it is not found uses the normal Windows NT algorithm to find the executable.
Since all the devices' DLLs have to be available for every executable and to avoid to spread them around, the user may specify their location on the WMPI_PATH. Since there are different DLLs for different devices, the user may prefer to divide them among different directories to easily manage them. If this environment variable is not set the WMPI will try to find the DLLs using the Windows NT algorithm.

Note: Oppositte to the devices' DLLs, the WMPI DLL is loaded implicitly to memory, hence we have no control to where the system should find it. This DLL must be present in the same directory of the executable or in the system PATH environment variable.

© University of Coimbra
Last review 1999/12