POOMA: A C++ Toolkit for High-Performance Parallel Scientific Computing | ||
---|---|---|
Prev | Appendix A. Obtaining and Installing POOMA | Next |
To use multiple processors with POOMA requires installing the Cheetah messaging library and an underlying messaging library such as the Message Passing Interface (MPI) Communications Library or the MM Shared Memory Library. In the following section, we first describe how to install MM. Read it only if using MM, not MPI. Then we describe how to install Cheetah and configure POOMA to use it.
Cheetah, and thus POOMA, can use Ralf Engelschall's MM Shared Memory Library to pass messages between processors. For example, the author uses this library on a two-processor computer running Linux. The library, available at http://www.engelschall.com/sw/mm/, is available at no cost and has been successfully tested on a variety of Unix-like platforms.
We describe how to download and install the MM library.
Download the library from the POOMA Download page (http://pooma.codesourcery.com/pooma/download) available off the POOMA home page (http://www.codesourcery.com/pooma/pooma/).
Extract the source code using tar xzvf mm-1.1.3.tar.gz. Change directories into the resulting source code directory mm-1.1.3.
Prepare to compile the source code by configuring it using the configure command. To change the default installation directory /usr/local, specify - -prefix=directory option. The other configuration options can be listed by specifying the - -help option. Since the author prefers to keep all POOMA-related code in his poomasubdirectory, he uses
./configure - -prefix=${HOME}/pooma/mm-1.1.3
Create the library by issuing the make command. This compiles the source code using a C compiler. To use a different compiler than the MM configuration chooses, set the CC environment variable to the desired compiler before configuring.
Optionally test the library by issuing the make test command. If successful, the penultimate line should be OK - ALL TESTS SUCCESSFULLY PASSED.
Install the MM Library by issuing the make install command. This copies the library files to the installation directory. The mm-1.1.3 directory containing the source code may now be removed.
The Cheetah Library decouples communication from synchronization. Using asynchronous messaging rather than synchronous messaging permits a message sender to operate without the cooperation of the message recipient. Thus, implementing message sending is simpler and processing is more efficiently overlapped with it. Remote method invocation is also supported. The library was developed at the Los Alamos National Laboratory's Advanced Computing Laboratory.
Cheetah's messaging is implemented using an underlying messaging library such as the Message Passing Interface (MPI) Communications Library or the MM Shared Memory Library. MPI works on a wide variety of platforms and has achieved widespread usage. MM works under Unix-like operating systems on any computer with shared memory. Both libraries are available at no cost. The instructions below work for whichever library you choose.
We describe how to download and install Cheetah.
Download the library from the POOMA Download page (http://pooma.codesourcery.com/pooma/download) available off the POOMA home page (http://www.codesourcery.com/pooma/pooma/).
Extract the source code using tar xzvf cheetah-1.0.tgz. Change directories into the resulting source code directory cheetah-1.0.
Edit a configuration file corresponding to your operating system and compiler. These .conf files are located in the config directory. For example, to use g++ with the Linux operating system, use config/LINUXGCC.conf.
The configuration file usually does not need modification. However, if you are using MM, ensure shmem_default_dir specifies its location. For example, the author modified the value to "/home/oldham/pooma/mm-1.1.3".
Prepare to compile the source code by configuring it using the configure command. Specify the configuration file using the - -arch option. Its argument should be the configuration file's name, omitting its .conf suffix. For example, - -arch LINUXGCC. Some other options include
lists all the available options
indicates use of MM, not MPI
indicates use of MPI, not MM
causes the compiler to produce optimized source code
prevents use of C++ exceptions
creates a static library, not a shared library
creates a shared library, not a static library. This is the default.
specifies the installation directory where the library will be copied rather than the default.
For example, the author uses
./configure - -arch LINUXGCC - -shmem - -nompi - -noex - -static - -prefix ${HOME}/pooma/cheetah-1.0 - -optThe - -arch LINUXGCC indicates use of g++ under a Linux operating system. The MM library is used, but C++ exceptions are not. The latter choice matches POOMA's default choice. A static library, not a shared library, is created. This is also POOMA's default choice. The library will be installed in the ${HOME}/pooma/cheetah-1.0. Finally, the library code will be optimized, hopefully running faster than unoptimized code.
Follow the directions printed by configure: Change directories to the lib subdirectory named by the - -arch argument and then type make to compile the source code and create the library.
Optionally ensure the library works correctly by issuing the make tests command.
Install the library by issuing the make install command. This copies the library files to the installation directory. The cheetah-1.0 directory containing the source code may now be removed.
To use POOMA with Cheetah, one must tell POOMA the location of the Cheetah library using the - -messaging configuration option. To do this,
Set the Cheetah directory environment variable CHEETAHDIR to the directory containing the installed Cheetah library. For example,
declare -x CHEETAHDIR=${HOME}/pooma/cheetah-1.0specifies the installation directory used in the previous section. If using the csh shell, use setenv CHEETAHDIR ${HOME}/pooma/cheetah-1.0.
When configuring POOMA, specify the - -messaging option. For example, ./configure - -arch LINUXgcc - -opt - -messaging configures for Linux, g++, and an optimized library using Cheetah.