May 22, 2004

:: MPI with SMP on dual G5

Normally the fastest way to run MPI on SMP machine is through share memory communication method because that reduced the overhead of communicating through (handle or socket?).

MPICH provides some sort of share memory support on MacOS X though it's not very mature. And it looks like LAM/MPI doesn't support share memory at this time (or is it not necessary on LAM?).

Darwin Ports project provides MPICH (net/mpich) and LAM (net/lam) ports, but I think MPICH port is broken at this time and we might want to use IBM compiler to link the binary and configure it as share memory version, too. Before we start to use MPICH, we need to check out ipcs in darwin ports because we gotta need it later. To install ipcs is very easy,

$ sudo port install ipcs; sudo port clean ipcs

and we're done.

The reason I said MPICH is not very mature on MacOS X at this time is that MacOS X doesn't have mature POSIX or Solaris like share memory support. So be careful, your program might not work.

However, if you use IBM XL compiler for C programming, share memory module will be likely to fail. So here is what I did.

I use configure option like

$ ./configure --with-device=ch_shmem -comm=shared -prefix=/usr/local/mpich

so that it will use /usr/bin/cc for C, xlC for C++, f77 (a link to xlf) and f90 (a link to xlf90) to compile MPICH. Please use
$ make ; sudo make install

to build and install.

LAM is also very easy to install

$ ./configure --prefix=/usr/local/lam CC=xlc_r CXX=xlC_r FC=xlf_r FFLAGS=-qextname --enable-shared=no
$ make; sudo make install

Be sure to re-edit /usr/local/mpich/share/machines.smp for MPICH and /usr/local/lam/etc/lam-bhost.def for LAM/MPI. Change them to "localhost:2" and "localhost cpu=2" respectively. LAM also need user to run lamboot to active LAM and lamhalt to disable LAM.

The mpirun is also easy for both. Use "/usr/local/mpich/bin/mpirun -arch smp -np 2" for MPICH and "/usr/local/lam/bin/mpirun C" for lam.

If your program crashed when running MPICH with share memory, please use ipcs to show the share memory you used and ipcrm to delete the resource or you can only reboot to run share memory MPICH again.

By mjhsieh at May 22, 2004 01:33 AM | Monthly Archives
Feedbacks

LAM/MPI is widely recommended by people in the community of SciTech mail-list.

孟叡
May 22, 2004 01:59 PM
#

Post a comment