[Ocfs2-tools-devel] [PATCH 1/4] Ocfs2-test: Add openmpi support by setup.sh

Marcos E. Matsunaga Marcos.Matsunaga at oracle.com
Thu Sep 11 06:31:15 PDT 2008


Signed-off-by: Marcos Matsunaga <Marcos.Matsunaga at oracle.com>

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.”



Tristan Ye wrote:
> 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 <tristan.ye at oracle.com>
> ---
>  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
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-tools-devel/attachments/20080911/057599dc/attachment.html 


More information about the Ocfs2-tools-devel mailing list