Roomy uses MPI for interprocess communication. Currently, Roomy has only been tested with MPICH2. You should install MPICH2 and become familiar with running MPI-based programs before using Roomy. The quickstart instructions in the MPICH2-1.2.1 Installer's Guide (www.mcs.anl.gov) provide a good introduction for users unfamiliar with MPI.
NOTE:
The current stable version of MPICH2 is 1.3.1 . It is no longer necessary to use a process manager (like mpd). mpd is not included in the 1.3.1 distribution. Now the "machines" file can be specified directly from the mpiexec command:
$ mpiexec -n 4 -f machines /home/dkunkle/roomy-0.9/src/tests/pancakeArray
The quickstart instructions in the MPICH2-1.3.1 Installer's Guide (www.mcs.anl.gov) provide a good introduction for users unfamiliar with MPI.
Currently, Roomy has undergone significant testing only on 64-bit Linux platforms. However, it should be possible to use Roomy on other platforms without significant problems.
The latest release of Roomy can be obtained from the Roomy Sourceforge Project Page. Decompress the downloaded archive using:
$ tar -zxvf roomy-0.9.tar.gz
Replacing 0.9 with the version you downloaded.
The most recent revision (possibly unstable) can be retrieved from the source code repository using:
$ svn co https://roomy.svn.sourceforge.net/svnroot/roomy/trunk roomy
First, change to the top-level Roomy directory and configure the build process. If using the default configuration, simply use:
$ cd roomy-0.9
$ ./configure
You can list configuration options using ./configure --help. For example, you may want to choose where the Roomy library will be installed, using the prefix option:
$ ./configure --prefix=/home/dkunkle/roomy-install
The default installation location is /usr/local/.
If you have installed MPICH2 in a non-standard location, you can configure additional paths to look for the MPI library and include files:
$ env CPPFLAGS="-I/home/dkunkle/mpich2-install/include" LDFLAGS="-L/home/dkunkle/mpich2-install/lib/" ./configure
You must also make sure that the MPI compiler script mpicc is in your PATH before building.
Then, you can build:
$ make
If all goes well, you can install the Roomy library, using:
$ make install
This will install the library, libroomy.a, and four Roomy include files, roomy.h, RoomyArray.h, RoomyHashTable.h, and RoomyList.h.
Now, we will run the test programs from the Roomy Tutorial, which solve the pancake sorting problem.
First, change to the tests subdirectory in the source tree:
$ cd src/tests/
Before running a Roomy program, there are some parameters that must be specified by editing the params.in file. This file must be present in the same directory as the binary of the Roomy program to be executed. The following is the default contents of params.in.
# Roomy Parameters
# The total amount of RAM available to Roomy per node (in MB)
PARAM MB_RAM_PER_NODE 1024
# The total amount of disk space avaiable to Roomy per node (in GB)
PARAM GB_DISK_PER_NODE 1
# Set to 1 if all nodes have access to a shared namespace (e.g. using SAN),
# set to 0 if each node has its own local disk.
PARAM SHARED_DISK 0
# The path to store disk-based data structure in. This path must exist, and
# be the same on every node. A directory named "roomy" will be created there.
# Path can not contain spaces.
# NOTE: it is important that this path be on a local disk, or a
# high-performance storage system. Storing data elsewhere, e.g., in a home
# directory on an NFS server, can greatly reduce performance.
PARAM DISK_DATA_PATH <your_data_path_here>
Each line specifying a parameter begins with the keyword PARAM, followed by the parameter name, and the assigned value.
The first two parameters, MB_RAM_PER_NODE and GB_DISK_PER_NODE, specify how much RAM (in MB) and disk (in GB) are available per Roomy process (usually one process per node on a cluster). Currently, these limits are used only for internal bookkeeping. Roomy may exceed these limits for large problems. In the future, Roomy may attempt to use different methods based on space restrictions, and exit before exceeding these limits if it is not possible to complete the computation within the given bounds.
The next parameter, SHARED_DISK, must be 0 or 1. A value of 0 specifies that the filesystem used by each Roomy process are not shared, e.g., when using a cluster with locally attached disks. A value of 1 specifies that the filesystem is shared, e.g., when using a RAID array attached to a shared memory machine, or a storage area network (SAN).
The last parameter, DISK_DATA_PATH, specifies the path where all disk-based Roomy data will be stored. As noted in the comments, this should be on a local disk or high-performance storage server for best results.
After setting the parameters in params.in, we will specify the hostnames of the machines to run the Roomy program on. Do this by editing the machines file. Currently, it contains only one line: localhost. This will work if you are running all Roomy processes on a shared memory machine. If using a cluster, you should list the hostname of each node in the cluster.
Then, boot the MPI daemons using:
$ mpdboot -n 4 -f machines
$ mpdtrace
The first line says to start MPI on the first four machines listed in the machines file. The second line will verify that the process worked by printing the hostname of each machine MPI is running on.
NOTE:
If you use mpich2-1.3.1, then it is no longer necessary to boot mpd. The machines file can be specified from the mpiexec command.
Next, we can run one of the pancake sorting solutions given in the Roomy Tutorial. The three examples are pancakeArray, pancakeHashTable, and pancakeList. Run the RoomyArray-based solution using:
$ mpiexec -n 4 /home/dkunkle/roomy-0.9/src/tests/pancakeArray
NOTE:
If you are using mpich2-1.3.1 , then the command should be:
$ mpiexec -n 4 -f machines /home/dkunkle/roomy-0.9/src/tests/pancakeArray
where -n 4 specifies the number of machines to run on. Note that you must specify the absolute path to the binary, because MPI will execute the command on each node independently. The output of the program should look like the following:
Thu Dec 10 03:08:01 2009: BEGINNING 11 PANCAKE BFS
Thu Dec 10 03:08:01 2009: Level 0 done: 1 elements
Thu Dec 10 03:08:01 2009: Level 1 done: 10 elements
Thu Dec 10 03:08:02 2009: Level 2 done: 90 elements
Thu Dec 10 03:08:02 2009: Level 3 done: 809 elements
Thu Dec 10 03:08:02 2009: Level 4 done: 6429 elements
Thu Dec 10 03:08:02 2009: Level 5 done: 43891 elements
Thu Dec 10 03:08:03 2009: Level 6 done: 252737 elements
Thu Dec 10 03:08:05 2009: Level 7 done: 1174766 elements
Thu Dec 10 03:08:11 2009: Level 8 done: 4126515 elements
Thu Dec 10 03:08:32 2009: Level 9 done: 9981073 elements
Thu Dec 10 03:09:04 2009: Level 10 done: 14250471 elements
Thu Dec 10 03:09:23 2009: Level 11 done: 9123648 elements
Thu Dec 10 03:09:27 2009: Level 12 done: 956354 elements
Thu Dec 10 03:09:27 2009: Level 13 done: 6 elements
Thu Dec 10 03:09:27 2009: Level 14 done: 0 elements
Thu Dec 10 03:09:27 2009: ONE-BIT PANCAKE BFS DONE
Finally, MPI can be shut down using:
$ mpdallexit
If you are having trouble booting MPI or running MPI programs, you may want to consult the MPICH2 Installer's Guide.
If our Roomy program is called simple.c, then we can compile it using mpicc:
$ mpicc simple.c -o simple -I/home/dkunkle/roomy-install/include -L/home/dkunkle/roomy-install/lib /home/dkunkle/roomy-install/lib/libroomy.a -lmpich -lpthread -lm
You might need to add -lmpl if you are using mpich-1.3.1, but that does not seem necessary.