From: secher Date: Tue, 6 Sep 2011 13:48:52 +0000 (+0000) Subject: add test MPI2 communication X-Git-Tag: Before_0020136~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a931021f3c1a39bf7a41a70e3fadc3df7343609b;p=modules%2Fkernel.git add test MPI2 communication --- diff --git a/src/MPIContainer/launch_testMPI2.csh b/src/MPIContainer/launch_testMPI2.csh index d7b78d760..9df57235b 100755 --- a/src/MPIContainer/launch_testMPI2.csh +++ b/src/MPIContainer/launch_testMPI2.csh @@ -8,7 +8,7 @@ else set debug="" endif if $status == 0 then - setenv OMPI_URI_FILE /home/secher/ARCH_COMPO/mpi2_pub/essai/URI + 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 & @@ -22,3 +22,4 @@ if $res == 0 then else echo "KO" endif +rm -f ${OMPI_URI_FILE} diff --git a/src/MPIContainer/testMPI2.cxx b/src/MPIContainer/testMPI2.cxx new file mode 100644 index 000000000..0c863c6c9 --- /dev/null +++ b/src/MPIContainer/testMPI2.cxx @@ -0,0 +1,196 @@ +#include +#include +#include +#include +#define TIMEOUT 20 +#define EPSILON 0.00000001 + +int main(int argc, char**argv) +{ + int *indg; + double *vector, sum=0., norm, etalon; + int rank, size, grank, gsize, rsize; + int vsize=20, lvsize, rlvsize; + int i, k1, k2, imin, imax, nb; + int srv=0; + MPI_Comm com, icom; + MPI_Status status; + char port_name [MPI_MAX_PORT_NAME]; + char port_name_clt [MPI_MAX_PORT_NAME]; + std::string service = "SERVICE"; + bool debug=false; + + for(i=1;i