X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMPIContainer%2Flaunch_testMPI2.csh;h=0a221ecda5d292fba1add5a321a0f6823a020de0;hb=97c540aef8c8b4a831e01218b620fe1ff8467ffa;hp=0a581ebeb8a3a070d3a3f7ded695a27875a1288f;hpb=d4617a5edb41e7acd4025a2b56160ae267ede7f6;p=modules%2Fkernel.git diff --git a/src/MPIContainer/launch_testMPI2.csh b/src/MPIContainer/launch_testMPI2.csh index 0a581ebeb..0a221ecda 100755 --- a/src/MPIContainer/launch_testMPI2.csh +++ b/src/MPIContainer/launch_testMPI2.csh @@ -1,6 +1,6 @@ #! /bin/csh -f -# Copyright (C) 2011-2014 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2011-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -19,17 +19,36 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# debug mode display informations about communication +# debug mode display information about communication if $1 == "--debug" then set debug="-debug" else set debug="" 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` +# get mpi implementation +${KERNEL_ROOT_DIR}/bin/salome/getMPIImplementation +set res = $? +if $res == 1 then + set mpi="openmpi" +else if $res == 2 then + set mpi="mpich" +endif +if $mpi == "openmpi" then +# launch ompi-server + setenv OMPI_URI_FILE ${HOME}/.urifile_$$ + set lpid1=`pidof ompi-server` + ompi-server -r ${OMPI_URI_FILE} + set lpid2=`pidof ompi-server` +else if $mpi == "mpich" then +# launch hydra_nameserver + set lpid1=`pidof hydra_nameserver` + if $lpid1 == "" then + hydra_nameserver & + endif + set lpid2=`pidof hydra_nameserver` +endif +# get pid of mpi server +set pid=0 foreach i ($lpid2) set flag=0 foreach j ($lpid1) @@ -43,14 +62,23 @@ foreach i ($lpid2) 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 +if $mpi == "openmpi" then + 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 +else if $mpi == "mpich" then + mpirun -np 2 -nameserver $HOSTNAME ${KERNEL_ROOT_DIR}/bin/salome/testMPI2 -vsize 32 $debug & + mpirun -np 3 -nameserver $HOSTNAME ${KERNEL_ROOT_DIR}/bin/salome/testMPI2 -vsize 32 $debug +endif set res=$status sleep 1 -# kill ompi-server -kill -9 $pid +# kill mpi server +if $pid != 0 then + kill -9 $pid +endif +if $mpi == "openmpi" then # delete uri file -rm -f ${OMPI_URI_FILE} + rm -f ${OMPI_URI_FILE} +endif # give result of test if $res == 0 then echo "OK"