2009年6月24日 星期三

Installing Snet

1. Install OpenMPI (openmpi-1.3.2)
$> ./configure --prefix=/the/location/you/want --enable-mpi-threads
$> make; make install

2. Install Snet

a. put the following lines in your bash shell

export MPIROOT=where the OpenMPI is located
export SNETBASE=where the snet is located
export LD_LIBRARY_PATH=$MPIROOT/lib:$SNETBASE/lib:$LD_LIBRARY_PATH
export PATH=$MPIROOT/bin:$SNETBASE/bin:$PATH

b. In the $SNETBASE directory, type "./configure; make"

c. In the $SNETBASE/demo/interface/C directory, type "make mpi"


3. Run an example code: factorial_mpi

a. In the $SNETBASE/demo/snets/factorial_mpi/Makefile,
change line 8:
LIBS = -lpthread -lC4SNet -lC4SNetc -lmpich -lsnetmpi -lsnetutil
to
LIBS = -lpthread -lC4SNet -lC4SNetc -lmpi -lsnetmpi -lsnetutil

b. type "make"

c. $> mpirun -n 4 ./factorial