Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
optimize MPI_Sendrecv if a process has to exchange with himself only
authorAugustin Degomme <degomme@idpann.imag.fr>
Wed, 26 Jun 2013 15:01:38 +0000 (17:01 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Wed, 26 Jun 2013 15:01:38 +0000 (17:01 +0200)
This helps avoiding some lockings of lazy network model when one process waits for itself

src/smpi/smpi_base.c
teshsuite/smpi/mpich-test/coll/runtests

index e4ab83b..875ce4e 100644 (file)
@@ -527,7 +527,12 @@ void smpi_mpi_sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
 {
   MPI_Request requests[2];
   MPI_Status stats[2];
-
+  int myid=smpi_process_index();
+  if ((dst == myid) && (src == myid)) {
+      smpi_datatype_copy(sendbuf, sendcount, sendtype,
+                                     recvbuf, recvcount, recvtype);
+      return;
+  }
   requests[0] =
     smpi_isend_init(sendbuf, sendcount, sendtype, dst, sendtag, comm);
   requests[1] =
index 65bcdd7..9026867 100755 (executable)
@@ -83,7 +83,7 @@ else
 selector="--cfg=smpi/coll_selector:$have_selector"
 fi
 
-mpirun=" ${basedir}/bin/smpirun -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile  --log=root.thres:critical  --cfg=network/optim:Full $selector "
+mpirun=" ${basedir}/bin/smpirun -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile  --log=root.thres:critical  $selector "
 testfiles=""
 if [ $runtests = 1 ] ; then
 echo '**** Testing MPI Collective routines ****'