From: secher Date: Wed, 7 Sep 2011 08:48:33 +0000 (+0000) Subject: update of test X-Git-Tag: Before_0020136~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=240bd34549f76638f0041116d25ad3c268fd8c55;p=modules%2Fkernel.git update of test --- diff --git a/src/MPIContainer/launch_testMPI2.csh b/src/MPIContainer/launch_testMPI2.csh index 9df57235b..7739e01af 100755 --- a/src/MPIContainer/launch_testMPI2.csh +++ b/src/MPIContainer/launch_testMPI2.csh @@ -1,25 +1,40 @@ #! /bin/csh -f -set nbproc1=2 -set nbproc2=3 -set vsize=32 +# debug mode display informations about communication if $1 == "--debug" then set debug="-debug" else set debug="" endif -if $status == 0 then - setenv OMPI_URI_FILE ${HOME}/.urifile - ompi-server -r ${OMPI_URI_FILE} - sleep 2 - mpirun -np $nbproc1 -ompi-server file:${OMPI_URI_FILE} ${KERNEL_ROOT_DIR}/bin/salome/testMPI2 -vsize $vsize $debug & - mpirun -np $nbproc2 -ompi-server file:${OMPI_URI_FILE} ${KERNEL_ROOT_DIR}/bin/salome/testMPI2 -vsize $vsize $debug - set res=$status - sleep 1 - killall ompi-server -endif +# get pid of ompi-server +setenv OMPI_URI_FILE ${HOME}/.urifile_$$ +set lpid1=`pidof ompi-server` +ompi-server -r ${OMPI_URI_FILE} +set lpid2=`pidof ompi-server` +foreach i ($lpid2) + set flag=0 + foreach j ($lpid1) + if ($i == $j) then + set flag=1 + endif + end + if ($flag == 0) then + set pid=$i + endif +end +sleep 2 +# launch two instances of executable to create communication between both +mpirun -np 2 -ompi-server file:${OMPI_URI_FILE} ${KERNEL_ROOT_DIR}/bin/salome/testMPI2 -vsize 32 $debug & +mpirun -np 3 -ompi-server file:${OMPI_URI_FILE} ${KERNEL_ROOT_DIR}/bin/salome/testMPI2 -vsize 32 $debug +set res=$status +sleep 1 +# kill ompi-server +kill -9 $pid +# delete uri file +rm -f ${OMPI_URI_FILE} +# give result of test if $res == 0 then echo "OK" else echo "KO" endif -rm -f ${OMPI_URI_FILE} +exit $res