When we run the test programs from the bench directory using mpirun -np 4, the master node takes one of the processes and one of the workers takes the other 3 processes. The other 2 workers never take on part of the load.
How can we fix this?
If a master node is not used in computation, then to use mpirun make sure the following file:
$PGI/linux86/util/machines/machines.LINUX
contains the names of all the worker nodes, but not the name of the master node.
Then, if starting a process from the master, add the '-nolocal' switch to the 'mpirun' command line to direct mpirun to not run the executable on the local machine.
Obtain the file mpi.c from ftp.pgroup.com/x86/3.1/linux86-patches/mpi/mpi.c
Compile mpi.c -c with pgcc, making sure the correct mpi.h file is used. The PGI version of mpi.h is found in $PGI/linux86/include on the CDK product.
If linking in mpi.o with your pghpf application works for you, you can use ar to replace mpi.o in libpghpf_mpi.a and libpghpf_mpi_p.a.
./configure -c++=pgCC -cc=pgcc -fc=pgf77 -cflags="-Msignextend -tp px
-DUSE_U_INT_FOR_XDR -DHAVE_RPC_RPC_H=1" -opt=-fast -fflags="-tp px" -c++flags="-tp px" -f90flags="-tp px" -f90=pgf90
-prefix=/usr/local/mpich -comm=shared sed -e 's@MPIR_HOME
= .*$@MPIR_HOME = $$\\PGI/linux86@' Makefile > Makefile.pgi
% make clean
% make mpi >& Make.log
if [ "$PBS_NODEFILE" != "" ]
then
machineFile=$PBS_NODEFILE
fi
Edit $MPICH/bin/mpirun.ch_p4 and change the definition of MPIR_HOME on line 5 to "MPIR_HOME=$PGI/linux86", and delete lines 14, 13, 12, and 10.
Edit $MPICH/bin/mpirun.pg: line 78 to "machineDir=${MPIR_HOME}/util/machines" line 91 to "echo directory ${MPIR_HOME}/util/machines."
mpirun
mpirun.args
mpirun.ch_p4
mpirun.pg
tarch
tdevice
the following files from the $MPICH/mpe directory into $PGI/linux86/include:
basex11.h
mpe.h
mpe_graphics.h
mpe_log.h
mpeconf.h
mpeexten.h
mpetools.h
the following files from the $MPICH/include include into $PGI/linux86/include:
binding.h
mpi.h
mpi_errno.h
mpidefs.h
mpif.h
mpio.h
patchlevel.h
protofix.h
the following from the $MPICH/lib directory into $PGI/linux86/lib:
libampi.a
libfmpich.a
liblmpi.a
libmpe.a
libmpe_nompi.a
libmpich++.a
libmpich.a
libpmpich.a
libtmpi.a
mpe_prof.o
mpe_proff.o
and the file $MPICH/util/execer must be installed in of $PGI/linux86/util.
These configurations work for us, but building MPICH is not always easy, and if you are having trouble, consult the MPICH organization, or purchase the CDK product, which conatins an integrated MPICH in the installation.
For MPICH 1.2.1, we use
export CC=pgcc
export FC=pgf77
export F90=pgf90
./configure --enable-debug -c++=pgCC \
-cflags="-Msignextend -tp px" -opt=-fast -fflags="-tp px" \
-c++flags="-tp px" -f90flags="-tp px" \
-prefix=/usr/local/mpich
For MPICH 1.2.2, 1.2.3 and 1.2.4
./configure --enable-debug -c++=pgCC -cc=pgcc -fc=pgf77 \
-cflags="-Msignextend -tp px \
-DUSE_U_INT_FOR_XDR -DHAVE_RPC_RPC_H=1" -opt=-fast \
-fflags="-tp px" -c++flags="-tp px" -f90flags="-tp px" -f90=pgf90 \
-prefix=/usr/local/mpich
For MPICH 1.2.5
env CC=pgcc CFLAGS='-Msignextend -tp px' \
FC=pgf77 FFLAGS='-tp px' \
CXX=pgCC CCFLAGS='-tp px' \
F90=pgf90 F90FLAGS='-tp px' \
./configure --enable-debug -opt=-fast \
-prefix=/usr/local/mpich-1.2.5.2
make
make install
For MPICH 1.2.6, with 32-bit systems
env CC=pgcc CFLAGS='-Msignextend -tp px' \
FC=pgf77 FFLAGS='-tp px' \
CXX=pgCC CCFLAGS='-tp px' \
F90=pgf90 F90FLAGS='-tp px' MAKE=gmake\
./configure --enable-debug -opt=-fast \
-prefix=/usr/lib/mpich-1.2.6
gmake -f Makefile
For MPICH 1.2.6, with 64-bit systems
env CC=pgcc CFLAGS='-Msignextend ' \
FC=pgf77 FFLAGS= \
CXX=pgCC CCFLAGS= \
F90=pgf90 F90FLAGS= MAKE=gmake \
./configure --enable-debug -opt=-fast -prefix=/opt/mpi
gmake -f Makefile