MPICH Database Server

The database server, mpichdbs.exe, is a program which manages a database to be used by mpich applications.

Usage:

Running as a database server:

mpichdbs

When run without any arguments, mpchdbs acquires a port and becomes a database server, waiting in a loop for incoming tcp connection requests.  Remote clients can then connect and issue commands to the database.

mpichdbs -port portnumber

This option forces the server to use a specific port.  This is useful if you want to stop and start the database server without having to change the mpirun configuration files or scripts.

Running as a database client:

mpichdbs -feed filename host port

With this option the program does the following:

  1. Connects to the database server already running on host and port.
  2. Parses the mpich job configuration file - filename.
  3. Puts the data in the database server
  4. Disconnects and exits

mpichdbs -connect host port id

With this option the program does the following:

  1. Connect to the database server already running on host and port.
  2. Sets itself up to issue commands to the node in the database represented by id.
  3. Waits for commands to be issued from the command prompt until a quit command is typed.
  4. Disconnects from the database and exits.

MPICH Job configuration file formats:

1)

id shortuniquestring
[env var1=val1|var2=val2...]
nproc numberofprocesses

2)

id shortuniquestring
[env var1=val1|var2=val2...]
hosts
hostA nprocesses
hostB nprocesses
...

The bracketed lines are optional.  The second format is similar to the configuration files used by MPIRun.  In fact the same file can be used by both programs because they ignore lines that they don't understand (mpirun ignores the 'id' line and mpichdbs ignores the 'exe', 'arg', etc lines).

Using the database server to launch mpich applications:

If you have a launcher for your cluster that can provide only a single environment for all processes launched then you can use the database server in conjunction with your launcher to start mpich applications:

  1. Start the database server on HostA:

    mpichdbs.exe -port 1234  

    This process will hang around until "exit" or "quit" is entered.

  2. create the job configuration file: job.txt   

    id job1    
    nproc 3

  3. Send the file to the database:

    mpichdbs.exe -feed job.txt HostA 1234

  4. Create the environment:   

    MPICH_JOBID=job1   
    MPICH_DBS_HOST=HostA   
    MPICH_DBS_PORT=1234

    or

    MPICH_JOBID=job1   
    MPICH_DBS=HostA:1234

  5. Launch the app.exe processes with your own launcher.
  6. Wait for them to finish
  7. Send an exit command to mpichdbs.exe started in step 1.

Steps 1 and 7 need only occur once because the database server can be used repeatedly for multiple jobs.