<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffcc" text="#000066">
<tt>Signed-off-by: Marcos Matsunaga <a class="moz-txt-link-rfc2396E" href="mailto:Marcos.Matsunaga@oracle.com"><Marcos.Matsunaga@oracle.com></a></tt><br>
<pre class="moz-signature" cols="72">Regards,
Marcos Eduardo Matsunaga
Oracle USA
Linux Engineering
“The statements and opinions expressed here are my own and do not
necessarily represent those of Oracle Corporation.”
</pre>
<br>
<br>
Tristan Ye wrote:
<blockquote
cite="mid:1221130149-19467-1-git-send-email-tristan.ye@oracle.com"
type="cite">
<pre wrap="">We'd better 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.
Btw,fix a minor bug at the last line of setup.sh
Signed-off-by: Tristan Ye <a class="moz-txt-link-rfc2396E" href="mailto:tristan.ye@oracle.com"><tristan.ye@oracle.com></a>
---
programs/python_common/setup.sh | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
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
</pre>
</blockquote>
</body>
</html>