[Ocfs2-tools-devel] [PATCH 1/5] Ocfs2-test: Add openmpi support in setup.sh and config file
Tristan Ye
tristan.ye at oracle.com
Wed Sep 17 01:48:46 PDT 2008
Use mpirun to get the MPI_BIN_PATH to
make it become all mpi products compatible.as we know
lamboot did not exist in openmpi.
When getting its MPI_BIN_PATH,should be depended on its
installtion type:
1.Installation from tarball,use 'make install' can install
mpi binaries under /usr/bin
2.Installation from rpm package,it will be installed under
/usr/lib64/openmpi/1.2.5-gcc/bin,and you will be asked to
add this into PATH variable by writting this into startup script
in .bashrc etc.so here we use 'rpm -ql openmpi' to get such path.
Add MPIHOSTS variable in config files both for shell and python.
Just reserve the LAMHOSTS here to make it still workable for existing
mpi test.
Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
---
programs/python_common/config_py.skel | 2 ++
programs/python_common/config_shell.skel | 2 ++
programs/python_common/setup.sh | 20 ++++++++++++++------
3 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/programs/python_common/config_py.skel b/programs/python_common/config_py.skel
index 75cf1a7..b7e4bcc 100755
--- a/programs/python_common/config_py.skel
+++ b/programs/python_common/config_py.skel
@@ -35,6 +35,8 @@ LAMBOOT = MPIDIR + '/lamboot'
LAMHOSTS = WORKFILESDIR + '/lamhosts'
+MPIHOSTS = WORKFILESDIR + '/mpihosts'
+
RECON = MPIDIR + '/recon'
MPIRUNPARTS = BINDIR + '/mpi-run-parts'
diff --git a/programs/python_common/config_shell.skel b/programs/python_common/config_shell.skel
index 5832b5c..5310320 100755
--- a/programs/python_common/config_shell.skel
+++ b/programs/python_common/config_shell.skel
@@ -34,6 +34,8 @@ LAMBOOT=${MPIDIR}/lamboot
export LAMBOOT
LAMHOSTS=${WORKFILESDIR}/lamhosts
export LAMHOSTS
+MPIHOSTS=${WORKFILESDIR}/mpihosts
+export MPIHOSTS
RECON=${MPIDIR}/recon
export RECON
MPIRUNPARTS=${BINDIR}/mpi-run-parts
diff --git a/programs/python_common/setup.sh b/programs/python_common/setup.sh
index e69a435..21f77f1 100755
--- a/programs/python_common/setup.sh
+++ b/programs/python_common/setup.sh
@@ -22,12 +22,20 @@ if [ $# -ne 1 ]; then
echo -e 'Usage: $0 <DESTDIR>';
exit 1;
fi;
-LAMBOOT=`which lamboot`
-if [ -f ${LAMBOOT} ]; then
- MPIDIR=`dirname ${LAMBOOT}`
+
+MPIRUN=`which mpirun`
+RC=$?
+if [ "$RC" != "0" ];then
+ MPIRUN=`rpm -ql openmpi|grep bin|grep mpirun`
+ MPIDIR=`dirname ${MPIRUN}`
else
- MPIDIR=/usr/bin
-fi;
+ if [ -f ${MPIRUN} ];then
+ MPIDIR=`dirname ${MPIRUN}`
+ else
+ MPIDIR=/usr/bin
+ fi
+fi
+
BINDIR=${1}/bin
sed "s;<DESTDIR>;${1};g" ${BINDIR}/config_py.skel > ${BINDIR}/config.py
mv ${BINDIR}/config.py ${BINDIR}/config_py.skel
@@ -36,4 +44,4 @@ sed "s;<MPIDIR>;${MPIDIR};g" ${BINDIR}/config_py.skel > ${BINDIR}/config.py
sed "s;<DESTDIR>;${1};g" ${BINDIR}/config_shell.skel > ${BINDIR}/config.sh
mv ${BINDIR}/config.sh ${BINDIR}/config_shell.skel
sed "s;<MPIDIR>;${MPIDIR};g" ${BINDIR}/config_shell.skel > ${BINDIR}/config.sh
-rm -f ${BINDIR}/config_py.skel ${MPIDIR}/config_shell.skel
+rm -f ${BINDIR}/config_py.skel ${BINDIR}/config_shell.skel
--
1.5.5
More information about the Ocfs2-tools-devel
mailing list